issuimo/UnityResolve.hpp

How to obtaining an active instance of a class at the runtime?

Opened this issue · 2 comments

while(true)
{
	// I 100% confirmed the game called this class public Void .ctor() method.
	// so that mean there is an instance exists somewhere in the game memory.
	// The reason i can't hook them because:
	//		Too late. the game called .ctor before Resolver even done.
	//		I need the instance to iterate at the runtime in my case.

	UnityResolve::Class* CProtocol_CSMsgPara = pAssembly->Get("CSMsgPara", "Protocol");

	const auto Vector1 = CProtocol_CSMsgPara->FindObjectsByType<UnityResolve::UnityType::Object*>();
	LOG(DEBUG) << Vector1.size(); // always zero didn't exists for the whole playing time

	const auto Vector2 = CProtocol_CSMsgPara->FindObjectsByType<UnityResolve::UnityType::Array<Object*>*>();
	LOG(DEBUG) << Vector2.size(); // always zero didn't exists for the whole playing time

	THIS_SLEEP(3s);
}

i searched the internet and tried this frida js version: vfsfitvnm/frida-il2cpp-bridge#341
and its working fine. the project is for android.

You can't call FindObjectsByType if you are looking for an IL2CPP Object and not a GameObject
You need to call the functions from the garbage collector like they do in frida-il2cpp-bridge

You can't call FindObjectsByType if you are looking for an IL2CPP Object and not a GameObject You need to call the functions from the garbage collector like they do in frida-il2cpp-bridge

Since i low knowledge with the il2cpp things, i'd love to see if you can give me example