Skip to content

Game crash on m_pObject->GetName() call. #48

@Mrproex

Description

@Mrproex

What is the game you are using with IL2CPP Resolver?

Waven

Details:

Game simply close after calling m_pObject->GetName() .

Screenshots/Video:

No response

Minimal, Complete and Verifiable Example code:

void Test() {
Unity::il2cppArrayUnity::CGameObject** m_pObjects = Unity::Object::FindObjectsOfTypeUnity::CGameObject(UNITY_GAMEOBJECT_CLASS);

printf("GameObjects found : %I64u", m_pObjects->m_uMaxLength);

for (uintptr_t u = 0U; m_pObjects->m_uMaxLength > u; ++u)
{
    Unity::CGameObject* m_pObject = m_pObjects->m_pValues[u];
    if (!m_pObject) continue; // Just in-case

    m_pObject->GetName();
}

}

void OnUpdate() {

}

void OnLoad() {
AllocConsole();
ReOpenConsoleStreams();

IL2CPP::Initialize();

IL2CPP::Callback::Initialize();
IL2CPP::Callback::OnUpdate::Add(OnUpdate);

Test();

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions