|
-
Apr 23rd, 2007, 05:05 AM
#1
Thread Starter
Addicted Member
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.
-
Apr 27th, 2007, 12:17 PM
#2
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|