Results 1 to 2 of 2

Thread: how to determine the hex values?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2005
    Location
    Cleveland, Ohio
    Posts
    255

    how to determine the hex values?

    Sorry if I'm asking this in the wrong section or something. It has to do with C++ and Assembly.

    Well, here's the deal. I'm dealing with a dynamic JMP instruction in a game. Meaning, every time the game loads, the address it JMP's to changes. Here is an example:

    Code:
    00469F00: E9 BB76DB02     jmp mylibrary.032215C0
    The JMP address is determined by a calculation: mylibrary.dll + 0x15C0.

    My question is, how would I go about writing the JMP and the calculated address from C++? I can patch existing instructions, but I'm having a hard time figuring out how 'BB76DB02' is supposed to be '032215C0'. I know that 0xE9 means JMP, but its the parameter that I don't understand how its hex value is determined.

    Code:
    static const void *mylib_jump = (GetModuleHandle("mylibrary.dll") + 0x15C0);
    BYTE bJump[] = {0xE9};
    memcpy((PVOID)dwAddress,bJump,1);
    // Now what to put here? possibly this?
    memcpy((PVOID)dwaddress+1,mylib_jump,4);
    I was as clear as possible.. sorry if you don't understand.. thanks for the help.

  2. #2
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: how to determine the hex values?

    It's the base address of the dll + 0x15C0, so you'll need to know where the dll is loaded.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width