PDA

View Full Version : [ASM / Hex] How is the address of say "JMP 0x010203" stored as hex?


CBWhiz
07-16-2005, 07:01 PM
I want to create a JMP, in memory, to hook a procedure.

To do this I want to create a JMP to my own code.

Using C, I can get the address of the code I want to JMP to as a DWORD.

Looking up JMP online, it's opcode is 0xEA.

So I must replace the code at the hooked location with 0xEA xx xx xx xx.

How do I convert the DWORD memory address into the format needed (xx xx xx xx), and do I need to?

Thanks for the help.

aman
07-17-2005, 04:26 AM
hrm, it's hard to tell exactly what you mean.. you are trying to use a memory address that your find in your code during runtime, and convert that into a hex address that you can use as a static address for a hex editor?

I've read something about that somewhere, where it might be possible to calculate the offset based on the the difference between the mem address and the program entry point address, but it is unlikely to work, especially if dynamic memory is used.

Google around a bit, you're bound to find answers.

Bry Man
07-17-2005, 10:46 PM
Sounds very similar to game hacking to me, Ive done that in the past and know of some pretty helpful sites....however it is a form of hacking I would suppose so i cant really give you a link to the site, but im fairly certain if one were to google 'Game Hacking' it would return as one of the hiher ranked sites... But they have articles about how to defeat dynamic memory allocation and how to make code injections etc into a games memory inorder to cheat it.