I wanted to see if someone could help me understand the following code and what I have to do to get it to work... like what header files you need and should somthing like this be an injected dll or can it be ran in a console app... also how to get a offset from a base/function address. I know it's base address - function address but when the address is like
Code:
Base : 0x52290000 || Address : 0x5234CBC0 || Offset : 0xBCBC0
I dont understand how you get 0xBCBC0 as the offset. Thanks in advance!!
Code:
DWORD dwEngine = (DWORD)GetModuleHandle( "engine.dll" );
DWORD dwClientInit = dwFindPattern( dwEngine, dwClientDLL_Size, reinterpret_cast<PBYTE>(szClientDLL_Sig), szClientDLL_Mask );
LogMessage( "Base: 0x%X || Address: 0x%X || Offset: 0x%X", dwEngine, dwClientInit, dwClientInit - dwEngine );
To be clear I do understand that DWORD dwEngine = (DWORD)GetModuleHandle( "engine.dll" ); gets the base address of engine.dll and that dwFindPattern(); is to find the pattern to get the function address and that LogMessage( "Base: 0x%X || Address: 0x%X || Offset: 0x%X", dwEngine, dwClientInit, dwClientInit - dwEngine ); is giving me a message showing me the base, address and finally the offset based on dwClientInit - dwEngine. but I don't understand how one would compiling it and make use of it and also how to do the calculation on getting the offset...
I don't get how you to do the math...
0x52290000 - 0x5234CBC0= 0xBCBC0
can someone explain how this works.. thanks!!