Jump to content

C++ Help


unknown1

Recommended Posts

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

 

Base : 0x52290000 || Address : 0x5234CBC0 || Offset : 0xBCBC0 I dont understand how you get 0xBCBC0 as the offset. Thanks in advance!!

 

 

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 );

 

 

Link to comment
https://forums.phpfreaks.com/topic/249810-c-help/
Share on other sites

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...

Link to comment
https://forums.phpfreaks.com/topic/249810-c-help/#findComment-1282240
Share on other sites

What do you mean you don't know how you get that offset? You just said you know it's base - function. Which it is.

 

And compile what?

 

 

base - function??? but I don't understand how to subtract  0x52290000 - 0x5234CBC0  to get  0xBCBC0

can you explain how that works??

Link to comment
https://forums.phpfreaks.com/topic/249810-c-help/#findComment-1282248
Share on other sites

I was quoting you. You had the right idea but got the terms backwards.

0x5234CBC0 - 0x52290000 = 0x000BCBC0

 

But you already knew this.

I know it's base address - function address

To be clear I do understand... 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

Link to comment
https://forums.phpfreaks.com/topic/249810-c-help/#findComment-1282249
Share on other sites

Okay I get it now i think

 

0x5BD50000

0x5BF7F4DD 

-

___________

=0xD2F4DD

 

is this correct?? now how do I make that code work?? show it be a dll file and be injected to work or can I make a console app??

Also how to I make this work??

 dwFindPattern( dwEngine, dwClientDLL_Size, reinterpret_cast<PBYTE>(szClientDLL_Sig), szClientDLL_Mask );

Link to comment
https://forums.phpfreaks.com/topic/249810-c-help/#findComment-1282255
Share on other sites

Okay I get it now i think

 

0x5BD50000

0x5BF7F4DD 

-

___________

=0xD2F4DD

 

is this correct??

If you reversed the operands, yes.

 

now how do I make that code work?? show it be a dll file and be injected to work or can I make a console app??

Also how to I make this work??

 dwFindPattern( dwEngine, dwClientDLL_Size, reinterpret_cast(szClientDLL_Sig), szClientDLL_Mask );

I still don't know what you're trying to do. Make what work? What DLL file?

Link to comment
https://forums.phpfreaks.com/topic/249810-c-help/#findComment-1282457
Share on other sites

How do I make a program out of the following code.

Also what headers are required to make it work....

Do I need to create a dll file and inject to make everything work or can I just run as a regular console app??

Just need someone to explain the code and how to use it....

 

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 );

 

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/249810-c-help/#findComment-1282483
Share on other sites

How do I make a program out of the following code.

Also what headers are required to make it work....

Do I need to create a dll file and inject to make everything work or can I just run as a regular console app??

Just need someone to explain the code and how to use it....

 

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 );

 

If i compile it now it doesn't work so what do I need to do to make it functional????

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/249810-c-help/#findComment-1282549
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.