View Full Version : newbie Q: convert assembler 2 hex
chitech
August 29th, 2002, 21:57
Alo everybody
I have some problem when I try to make inline patch. How do I convert assembler code to hex. Please guide me (links?)
For example how is this converted?
:00405BF2 E909800000 jmp 0040DC00
Thx
Chitech
DakienDX
August 29th, 2002, 22:10
Hello chitech !
How Call and Jmp instructions are calculated has be discussed already lately.
Please read this (http://www.woodmann.net/forum/showthread.php?threadid=3607) post.
For everything else go to the Intel homepage and download the opcode reference for the processor you have (I don't know if AMD has something like this also). But beware, you'll end up in 500 pages of text or even more.
chitech
August 30th, 2002, 00:09
alo DakienDX
endlocation = (orginal call location - (currentlocation +5))
Now it works
Just a question: why do I have to add 5 bytes to currentlocation?
Thx a lot to u
Chitech
DakienDX
August 30th, 2002, 00:45
Hello chitech !
This was also discussed.
The relative address is counted from the end of the instruction.
The Call instruction is 5 bytes long. (E8 ?? ?? ?? ??)
You have to add 5 to the current location, so you're at the end of the instruction where the relative counting starts.
If you're in 16-bit code, the Call is only 3 bytes long. (E8 ?? ??)
So you would have to add 3 to the current location.
chitech
August 30th, 2002, 01:09
Alo DakienDX
Ok...now I see it......U r right. It has been discussed
Now it's time to add func. to programs. It's fun when u can calculate the offsets and it's working
Thx again
Chitech
Powered by vBulletin® Version 4.2.2 Copyright © 2018 vBulletin Solutions, Inc. All rights reserved.