nevermoe / unity_metadata_loader

GNU General Public License v2.0
522 stars 127 forks source link

A better way to find g_MethodPointers #10

Closed NyaMisty closed 6 years ago

NyaMisty commented 7 years ago

The current approach is not very reliable in binaries compiled with different version Unity. Instead we can find a long pointer list, and then lookup the cross-references to it, which should be in either Il2CppMetadataRegistration or Il2CppCodeRegistration (let's call it struct A). In order to know exactly what struct A is, we can then have a look at xrefs to A. Then we can get to the following function: inline void il2cpp_codegen_register (const Il2CppCodeRegistration* const codeRegistration, const Il2CppMetadataRegistration* const metadataRegistration) Now we know where those fields are according to the corresponding version of libil2cpp. This approach is much more accurate than the old one. Hope helps. :)

sterling0x1 commented 7 years ago

That would only work on android tho...

nevermoe commented 7 years ago

hey, thank you guys. I'll try your solution. But I don't have enough time recently. Any PR is welcome!

NyaMisty commented 7 years ago

@sterling0x1 however I'm reversing an iOS app :)

NyaMisty commented 7 years ago

@nevermoe OK I'll try.

nevermoe commented 6 years ago

updated a new way to locate the methods and strings in "v24" branch