Frouk Grandmaster Cheater
Reputation: 5
Joined: 22 Jun 2021 Posts: 515
|
Posted: Mon Mar 02, 2026 2:40 am Post subject: il2cpp header for C Code |
|
|
I wrote a quick header for using IL2CPP easier, without need of writing il2cpp objects
Make sure to rename the extension to .h, and move it into Cheat Engine/include/ directory
| Code: | {$c}
#define UNITY_VERSION_2022_3_8F1 // if later or this build
#include <il2cpp.h>
{$asm} |
This should be used before any code
Examples:
| Code: | {$ccode}
Il2CppClass *kl = FindClass("Example", "MyClass");
if (!kl)
return;
void *(__fastcall *GetNewMethod)(Il2CppString *arg1, int arg2) = Class_GetMethod(kl, "GetNewMethod", -1)->m_pMethodPointer;
Il2CppString *str = StringUTF16_NoGC_New(L"SomethingSomething");
GetNewMethod(str, 0);
il2cpp_free(str); // On any allocation make sure to use il2cpp_free
{$asm} |
| Code: | {$ccode}
Il2CppClass *kl = FindClass("Example", "MyClass");
if (!kl)
return;
Il2CppFieldInfo *instField = il2cpp_class_get_field_from_name(kl, "_instance");
void *instance = NULL;
il2cpp_field_static_get_value(instField, &instance);
if (instance)
...
|
| Description: |
|
 Download |
| Filename: |
il2cpp.lua |
| Filesize: |
19.57 KB |
| Downloaded: |
6 Time(s) |
|
|