Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does one change an instruction with a hex editor?

I am messing around with some reverse engineering, but I don't know how to change a jnz to jz with a hex editor. I understand it will vary between systems but I'm not sure where to look to find this information. I'm working on Mac OS X 64 bit and I disassembled code with IDA Pro.

like image 885
carboncomputed Avatar asked Aug 20 '12 14:08

carboncomputed


People also ask

How do you use a hex editor?

A hex editor has a cursor that can be moved by clicking with the mouse or using the cursor keys. Position the cursor over the byte you want to edit, and type the value you want to change to using the keyboard. The cursor can be switched between the hexadecimal area and the character area by pressing the 'Tab' key.

Does Microsoft have a hex editor?

A hex editor is also a great learning and debugging tool for any software developer; and while there are plenty of great free hex editors out there, Hex Editor Gamma is built from the ground up for the Windows Store.

What is HxD hex editor used for?

HxD is a hex editor, disk editor, and memory editor developed by Maël Hörz for Windows. It can open files larger than 4 GiB and open and edit the raw contents of disk drives, as well as display and edit the memory used by running processes.


1 Answers

If you've found a jz, it will either look like 74 XX or 0F 84 XX XX XX XX. If it's a 74, change it to 75. If it's the one with 84, change it to 85. This information can be found, among other places, in Intel's manual (volume 2A).

It will not vary between systems, as long as they're all x86 based, and if they aren't then jz and jnz may not even exist..

like image 56
harold Avatar answered Oct 23 '22 01:10

harold