Solved Static Fields

Status
Not open for further replies.

EzM0dZ

Platinian
Original poster
Jun 6, 2020
22
1
3
27
united states
So I'm trying to understand static fields. Below is the static field coinCount which is a member of the class GameManager.
unknown.png


So from here I know I go into script,json and search GameManager_Typeinfo which gives me:
unknown (1).png

I know the address listed is the decimal offset of the GameManager_c pointer relative to the GameAssembly.dll

From here I find the class definition of GameManager_c inside the il2cpp.h file:
unknown (2).png


I see that within this class is a pointer to a struct that contains all the static fields inside of the GameManager class that is the size of Il2CppClass_1.
Which from my understanding is typically 92 bytes. which means at 0x5C there is an offset with a pointer to static_fields.

This is where my understanding starts to break down.
I know by searching "GameManager_StaticFields" i can see its definition like so:
unknown (3).png


And from what I understand this means at offset 0x0 theres a pointer GameManager?

My confusion is that im not sure how to use this information to give me the offset of the field address im looking for in the il2cpp.so
The tutorial I was following said that, " GameAssembly.dll + the offset listed in script.json = a pointer to a GameManager_c pointer. 0x5C bytes away from the start of the GameManager_c struct there is a pointer to another struct which contains all static fields."

Would that mean that GameAssembly.dll + 11915916 + 0x0 + 0x5C = structure of static fields for GameManager_c?
Because when i try that in HxD it says the file does not contain the offset.
What am I doing wrong?
 
Status
Not open for further replies.