How to edit files in a hex editor.

Hi guys, good morning! I'm looking to learn how to edit files in a hex editor. They can be photos, music, any type of file. Thank you.
binary files require some effort on your part.
a rough how to
1) edit a text file with your hex editor, get a feel for the tool. See cool stuff like end of line bytes, and how the letters look in both hex and text in your editor.
2) pick something to edit. Pick something simple at first: compressed images and sound files are very challenging to edit because the compression makes it effectively a header and footer around a giant blob of random bytes. Uncompressed RGB type images are easy.
3) make a backup copy of it. never, ever, edit a file without a backup. you are going to screw it up beyond using repeatedly before you figure your edits out.
4) study the file format for the selected file type online, if such exists publicly. Most standard document types and executables have documented formats and this is a tremendous help to see what is what.
5) wade thru the file, seeing what you can figure out
6) actually edit something and see if it worked as expected. Repeat, reverting to backup when broken, until you unlock what you need to do for the edit you want to make.

7) be smart. it is kind of foolish to edit images in hex when there are, you know, a half million photo editing tools out there. Same for sound files. You hex edit as a last resort, to reverse engineer something or to hack an executable program or to repair a damaged file that can't be replaced or fixed without it, and it can be useful to make files to test code with or to look at and edit your own files to test code. But it is tedious, difficult, and time consuming to hex edit so keep it in mind as that last resort and see what other options you have first.
Last edited on
Registered users can post here. Sign in or register to post.