Closed ALittlePatate closed 2 years ago
component is attached to a gameobject, you need to get component first.
Unity::CGameObject* AnyObject = Unity::GameObject::Find("TargetGameObjectName");
Unity::CComponent* NolanRankController = AnyObject->GetComponent("NolanRankController");
NolanRankController->CallMethod<void*>("SetRank", 50);
I am currently rewriting my cheat for Devour using your library but i can't call a function without an access violation happening. Original C# code (using MelonLoader) :
New C++ code (using IL2CPP Resolver) :
The code crashes at
void* GetMethodPointer(Unity::il2cppClass* m_pClass, const char* m_pMethodName, int m_iArgs)
, line 176 of Class.cpp :Result : "Access violation in GameAssembly.dll when reading at 0xFFFFFFFF20000133."
What am i missing there ?