Hi there.
I've been trying to get value out of a multi-level pointer, but failing. The value stored in final address is players health.
Base address: "ac_client.exe" + 110D90
Offsets: 0x0, 0x35C, 0x8, 0xF8
How the pointer looks in CE:
(Attachment below)
And the code itself:
Code:
DWORD playerModuleBase = GetModuleBase( "ac_client.exe" )
DWORD playerBaseAddress = *(DWORD*)(playerModuleBase + 0x110D90);
DWORD PlayerRealAddress = GetAddressFromPointer( playerBaseAddress,offsets, 3 ); // Ignore the second and third argument as these are not used currently.
char a[10], b[10];
sprintf_s( a, sizeof( a ), "%x", (PlayerRealAddress) );
sprintf_s( b, sizeof( b ), "%x", (playerBaseAddress) );
OutputDebugString( (LPCSTR)a );
OutputDebugString( (LPCSTR)b );
DWORD GetModuleBase( char* moduleName )
{
DWORD moduleBaseAddress = (DWORD)GetModuleHandle( moduleName );
return moduleBaseAddress;
}
DWORD GetAddressFromPointer( DWORD baseAddress, DWORD offsets[], int length )
{
DWORD tempAddress;
tempAddress = *(DWORD*)( baseAddress + 0x0 );
tempAddress = *(DWORD*)( tempAddress + 0x35C );
tempAddress = *(DWORD*)( tempAddress + 0x8 );
tempAddress = *(DWORD*)( tempAddress + 0xF8 );
return tempAddress;
}
PlayerBaseAddress variable holds the right address (I've checked with CE), but the problem starts with PlayerRealAddress variable.