Tutorial How to find an Instance of a class to access pointers and static fields/methods

Numark

Awesome Active Platinian
Original poster
May 23, 2017
116
930
193
Hello, this is Slice again. I will be making another tutorial for modding.
Don't get me wrong on this tutorial, half of this may not be right or accurate, so free to comment on my mistakes.

Alright, so how do we find a static class?
So, I will be testing this on PG3D/Pixel Gun.

We have a class called WeaponManager that is not obfuscated.
image_2021-12-11_182403.png




So what is this about? How do we access and get the static class?


I'm sorry guys, unfortunately we need "IDA Pro".

Load the libil2cpp.so binary into IDA and wait at least 30 minutes to 2 hours for it to load, DEPENDING ON YOUR PC/LAPTOP SPECS!!!!

After this is done loading, you should see this..
image_2021-12-11_182932.png


IDLE means it is done loading. Also, load the ida script to get the names of everything.

Now theres this color progress on the top, you should see blue, yellow, black, etc.
image_2021-12-11_183145.png



You want to scroll all the way at the end until you find .bss

That is where you will get your static classes.

Now lets say our class is WeaponManager...

I have found it.

1639265582157.png


That should be it. Copy the offsets, do something magical with it.

Before we do anything else, try to find the static pointers otherwise it may not work trying to access static fields, etc.



Credits to Jbro129 for source.

Examples of Static Class and Pointer accessing: PG3D-Hook/jbro.cpp at 19737bf5540be66e00f0713748d8071bb129cc9b · jbro129/PG3D-Hook
 

asdf101

Platinian
Jun 8, 2021
15
2
3
24
-
What does the .bss mean. Can I just access the class instance by doing this:
C++:
void *WeaponManager = GetRealOffset(0x06B268AC);
I am not sure how all this works.
 

sarausa

Rookie
Jan 18, 2024
2
0
1
34
I appreciate what you share in the post. Thanks to your post, I have gained a lot of new and useful knowledge. fnf