Hi so I was just trying to learn reverse-engineering and when I open my program in IDA pro I find this address sub_11330
(rebased to 0) https://gyazo.com/1c34d2c31f29583f05d0dd4d956d6f74 however when I try to hook this function the address GetModuleHandle(NULL) + 0x11330
doesn't work so I just tried to print the base address of the function with std::cout << (DWORD)callme - (DWORD)GetModuleHandle(NULL)
and when I try this address it works (0x1128a) why can't I find it with IDA ? sorry if I wasn't clear if you can't understand what I'm trying to explain I'll re write my post.
this is how I'm hooking it
int WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
if (dwReason == DLL_PROCESS_ATTACH)
{
std::cout << "injected" << std::endl;
Detour((PBYTE)GetModuleHandle(NULL) + 0x1128a, (PBYTE)&func);
}
return true;
}
my function detours just changes the first 5 bytes of the function and this one works i'm compiling with vs2015 in debug mode my program is a console application written in c++
callme
?)