I have succefully hooked a game with imagebase 400000 (Ex:
// LRESULT __stdcall sub_6D5040(int a1, UINT Msg, WPARAM wParam, int a4)
Game.SecondaryFunctHookAddress = "0x2D5040"
and the game work.
Now I have another game with imagebase: 140000000
// __int64 __fastcall sub_1405B4B60(__int64 *a1)
I have tried:
Game.SecondaryFunctHookAddress = "0x0005B4B60"
but not work becouse detour don't attach the address.
until now I have converted the address with this function:
DWORD GetGameFunctionAddress(std::string GameFileExe, std::string Address)
{
///////////////////////////////////////////////////////////////
/// Get integer value address of the original function hook //
///////////////////////////////////////////////////////////////
return (DWORD)GetModuleHandleA(GameFileExe.c_str()) + std::strtoul(Address.c_str(), NULL, 16);
}
and always work, but now there is a imagebase of 140000000 and seem more complicated.
Can you please tell me what is the right address for sub_1405B4B60 converted to string ?
Best Regards
GetModuleHandleA
does not work to get the base address if the process is 64bit.