sneakyevil / IL2CPP_Resolver

A run-time API resolver for IL2CPP Unity.
https://sneakyevil.gitbook.io/il2cpp-resolver/
The Unlicense
323 stars 65 forks source link

Issue finding methods and method name #36

Closed Shillersan closed 7 months ago

Shillersan commented 7 months ago

I used to loop over methods but it prints gibberish like this: U‹ìÿu\fÿu\x10ÿU\b‹M\x18ƒÄ\b‰\x1]ÃÌÌÌÌÌÌÌÌÌÌU‹ì‹U\x14ÿu\f‹B\bÿr\fƒì\x10\xf\x10

Unity::il2cppClass* m_pClass = IL2CPP::Class::Find("MyClass");
void* methodIterator = nullptr;
Unity::il2cppMethodInfo* currentMethod = nullptr;

while ((currentMethod = IL2CPP::Class::GetMethods(m_pClass, &methodIterator)) != nullptr) {
    Logger::AddLog("%s", currentMethod->m_pName);
}

And is there a way to get methods with same name but different parameters?

extremeblackliu commented 7 months ago

read https://github.com/sneakyevil/IL2CPP_Resolver/blob/a260132fb7fa9fb724133128af9c945396afee8e/API/Class.hpp#L191

Shillersan commented 7 months ago

Apparently the issue was the MethodInfo struct is different from what is there in IL2CPP_Resolver. Unity version: 2022.3.8f1

extremeblackliu commented 7 months ago

solved