Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get il2cpp functions? #220

Closed
feuerball11 opened this issue May 5, 2023 · 9 comments
Closed

How to get il2cpp functions? #220

feuerball11 opened this issue May 5, 2023 · 9 comments

Comments

@feuerball11
Copy link

Hi :-)
I was previously using the JSON output from IL2CPPInspector, but as this project is deprecated, I need to think about what I will use going forward.
While CPP2IL doesn't support JSON output, I could imagine adding that myself.
However, what I currently don't see, is a way to get il2cpp functions like
il2cpp_array_new
il2cpp_value_box
il2cpp_object_new

Which I currently need for my project.
How would I get the pointers to these functions, with Cpp2IL?

For Context: I need these pointers for an Cpp dll injection project, that does runtime hooking to these pointers.

@SamboyCoding
Copy link
Owner

Those functions are just exported from the binary. you could simply iterate over the exports.

@feuerball11
Copy link
Author

So they would be part of
LibCpp2IlGlobalMapper.MethodRefs ?

@SamboyCoding
Copy link
Owner

No.

@feuerball11
Copy link
Author

Can you give me a hint where I need to look then?
Sry, I'm not that deep into how the whole il2cpp metadata works, so I have trouble finding it myself.

@SamboyCoding
Copy link
Owner

They're not in metadata. They're ordinary binary exports, unrelated to anything IL2CPP.

@feuerball11
Copy link
Author

Ah, now I understand.
Is there anything in cpp2il already, that can parse the exports?
If not, it looks like IL2CPPInpsector has some code for that, I guess I could just port that over.

@lilmayofuksu
Copy link

you can simply get their pointers with GetProcAddress

@SamboyCoding
Copy link
Owner

you can simply get their pointers with GetProcAddress

No you can't.

Is there anything in cpp2il already, that can parse the exports?

Exports are already parsed, Il2CppBinary base class has methods related to getting them by name.

@feuerball11
Copy link
Author

Awesome. That was the hint I needed. Thanks a lot :-)
I can now try to write a JSON export, with the data I need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants