• # Thread: Using pointers and offsets

1. ## Using pointers and offsets

Hi everyone this is a brief tutorial about multi level pointers specifically for External Hacks. We will be using ReadProcessMemory(RPM) and WriteProcessMemory(WPM) so if you know how those functions are or what they do check out my tutorial on those because it will make this easier to follow. https://guidedhacking.com/showthread...eProcessMemory This tutorial is for noobs who are confused with when to use pointers / offsets and their general purpose. I will not be showing you how to find addresses using cheat engine because there are plenty videos on that. The game I will be referring to is Assault Cube. So lets begin.

When trying to change your health or ammo in a game we have to find the address and then change the value of it once we obtain the correct address. When making hacks we have things such as static pointers. These are pointers that always point to a certain thing. The address that a static pointer points to is usually dynamic and will change every time you close and reopen your game. In Assault Cube and most games there is no static address for our health and ammo so we have to use multi level pointers to get to it. I will show you how we can get to our health address and the general logic behind it.

In Assault Cube we have a static pointer that points to our player base address. That static pointer is 509B74. Remember that is not the player base address it POINTS to your player base address. We also have offsets such as 0xF8 which is health and 0x150 which is ammo. 0xF8 and 0x150 are offset from our player base address. When we add F8 to our player base address we then get our health address. This might be a little confusing at first so I made a picture showing you the general concept. This is specific to finding your players health address in the game assault cube.

The red is your addreses and offsets and the green arrows show the logic flow. We have our static address 509B74. This address is a pointer and will always point to our player base. Our player base address how ever is dynamic and will always change every time the game is closed then opened. Our health address is dynamic as well but the offset to our health address is always 0xF8. So how would we get to our health? Using multilevel pointers. First we would scan our player base pointer. We would take the address we get which would then be our player base address. We would then add our offset F8 to it. This new address which is the product of our offset and player base is our health address. We could use this address to WPM and change our health value or RPM and read our health value. So lets look at some code that would get to our health address. Remember this code won't work by itself because we need a handle to the game. This is just to show the general concept of multi level pointers.

```DWORD pLocalPlayer = 0x509B74;	//local player pointer
DWORD health = 0x0;					//health address

The code that you just saw reads what is stored in pLocalPlayer which is our pointer to our player base address. It then stores that in playerObjectAddress which is the same thing as our player base address. We then add our player base and our health offset to get our health address. We could then do things like store our health value you in int healthValue and display it by adding this code.

```int healthValue = 0;
std::cout << "your health is: " << healthValue;```

Some times you will come accrossed multiple offsets to get to the address you want. You can find them using the same idea above. You use your static pointer to read your player base. Then you add your first offset to your player base. If it has more then one offset you would RPM your first offset and your player base address combined. Because those two things combined aren't your address they are simply a pointer. You would then have to take what it points to and add your second offset. I will not show an example of this because you should first understand finding one offset addresses and if you understand that, then you will understand how to find pointers with multiple offsets with my simple explanation.

I hoped this helped new hackers understand the logic behind using static pointers to addresses and how to use offsets. I will be making a tutorial on organization techniques in external hacks and show useful functions you can use to make multilevel pointer scanning easier! If there are any errors let me know and I will fix them!

2. ```DWORD pLocalPlayer = 0x509B74;  //local player pointer
DWORD health = 0x0;            //health address
int healthValue = 0;        //health value
HANDLE hProcHandle = OpenProces.....