Offset, as already answered, is where is allocated a process information relative to a position. In written form this is, but for the subject, I prefer to give examples and show images:
To base ourselves better, let’s assume that a game (process) has the following architecture:
Let’s assume the following offsets:
ClientDll = 0x12EA567; //Em relação ao ponto inicial, esse seria o modulo em que vamos trabalhar
Localplayer = 0x4BCD3F; //Em relação ao ClientDll
Vida = 0x100; //Em relação ao Localplayer
How do I get the life of the local player? Simple! Add it all up:
VidaDoJogador = ClientDll + Localplayer + Vida;
Understand that what we did, is to take information that is contained in a process from an address that we got through the offsets.
In real code (C++ & Winapi):
int VidaDoJogador = 0;
DWORD endereço = ClientDll + Localplayer + Vida;
ReadProcessMemory(processo, (void*)endereço, &VidaDoJogador, sizeof(VidaDoJogador), 0);
Where processo
is the HANDLE
of the process.
- Why not work with offsets?
Offsets are very dynamic and can change whenever the process source code changes. I recommend reading Pattern Scanner, where instead of creating variables for the offsets and having to keep changing, it finds them for you, according to the static values next to it.
That’s right, the displacement relative to an initial position or root position.
– Piovezan