Free "Hex" Editors
Introduction
Although some Hex Editors
can even display a text file the same way Text Editors do (and
all of them should at least show you the ASCII text characters on part of the
screen), Hex Editors excel at two things that are impossible for most
text editing programs:
1) Showing you every single byte that makes up a
file (any kind of file; including executable programs), and
2) Saving the file with only the changes that you make; unlike
many old Text Editors which always add a couple extra
bytes at the end of each file* (
See note below).
Also, most Text Editors will drastically change
or even truncate binary files (chop off a
large portion at the end of the copied file when loading it into the editor),
so you should never use a Text Editor to make changes to a file
unless you know for sure it's a plain text type file!
Note: You should always make a
copy of any file you need to open with a Hex Editor. Unlike text
files, changing a single byte in a program or
binary data file (such as a Word .DOC file); especially by
accident, may make it impossible to ever run or use the file
again! |
Although I'm trying to
comment on a number of helpful 'free' Hex editors here, the first one on the
list (FRHED) is, in my opinion, the best everyday workhorse; a
program for searching through and making changes to dozens of files per session
on a daily basis.
Take this link for a full Review of:
FRHED - FRee
Hex EDitor
HxD
by Maël Hörz.
Maël's
Home Page.
New:
Tutorial using HxD
HxD
is a proven Hex Editor not only for editing any
binary files on your system but also for
editing your hard disk drive sectors from within Windows™ 2000/XP! This made it the
first FREE Disk Editor that can do many of things people purchase the commercial editor
WinHex for! HxD is still being developed, and its author continues to be interested in any
bugs you might possibly find and open to suggestions for new features! HxD already has
all the basic features you would want in such an editor: Both Hex and ASCII (including Unicode)
search/replace, and will open files, memory locations, hard drives (as either logical or physical)
and disk image files too. The program was written in Delphi. Here's a view of HxD.exe inside of HxD
after it found and highlighted a location for the string "Delphi" using its "Search" menu:
And here's a view showing our hard disk's Master
Boot Record (the first sector of our PC's physical hard disk, "Hard Disk 1,") along with
TABs at the top where HxD.exe remains open, with the Memory locations for an instance of NOTEPAD. You
can just barely see a light-gray line; between offsets 1FFh and 200h, separating Sector 0 and Sector 1
(each sector being comrpised of 512 bytes). The new controls and specifically the "Sector"
box at the top the window are for jumping directly to a desired Sector:
HexIt by Mikael Klasson.
Mikael's Home Page, or:
Direct to The HexIt Homepage.
I'm listing this
editor here for a special reason: Because it can be used to disassemble
x86 machine code Instructions up to and including those requiring
a Pentium II CPU (with MMX) along with all FPU instructions as
well; whereas the disassembler in DEBUG can only do so for the old 8086
CPU and 8087 FPU instructions. If you're completely dependent upon GUI interfaces,
you probably won't like this program, but there are very few free programs that
can do this! See the documentation for a list of many other features, and make
sure to read the help file for its many keyboard commands.
Part of HexIt in Code Mode in a DOS-window:
It looks much better when run at full-screen.
Part of HexIt in Hex Mode in a DOS-window:
(Note: Pic of display has been slightly altered to fit my web
page parameters.)
MS-DOS Editor (EDIT.COM)
version
2.0.026 ©1995 or later by Microsoft
Yes, I mean the old
Edit.com program that comes standard with all Microsoft OSs! I wanted to
point out that in a 'pinch' when nothing else is available or accessible for
some reason, this program can be used as a Hex editor (something which most
of today's GUI-dependent users don't know!)
If you never bothered to look at the 'helps' for Edit.com or start the
program without using a filename parameter, you might never realize there's
a BINARY Mode. You can open a binary file from a command line using: edit /nn path\file.ext
where 'nn' specifies how many characters you want to see on each line
before they wrap around onto the next line ( there are
no normal line endings even for a text file opened in
Binary Mode, since all characters such as Carriage Return or Line Feed are
simply displayed along with all the other bytes. So you have to tell
Edit.com where it should end each line! For example, I chose 64 characters
in the display below. )
The second method for turning on Binary Mode is by selecting it from
the OPEN file dialog box like this:
And here's how the file appears when you open it:
The first thing you
might notice is that you'll have to place the cursor (yellow in the pic
above) under a character to see its byte value (shown in the red circle)!
Other reasons why Techs avoid using Edit.com for making changes to BINARY
files are:
1) The byte values are shown only in Decimal (not Hex).
2) It can be very DIFFICULT to enter a byte value that's not
directly accessible from the keyboard -- If you try using the method of 'ALT
key plus byte value' from the Number Keypad, you'll quickly find that
most of the Control Code values (0-31) are used by Edit.com to carry out
cursor movements and other functions! If you're stuck with having to use
Edit.com, I suggest creating a small file comprised of at least the byte
values 0 through 31 that you can COPY a value from and then PASTE it into
the target file.
3) You can't really
tell where the end of the file is unless you first press the 'CTRL + END'
keys, go UP one line to the actual last line of the file, press the END key
and finally go one character to the LEFT! This last step is because
Edit.com always places the cursor AFTER the last byte in a line rather than
under the last byte in a line. So, why all the hassle? It's because Edit.com
creates a screenful of spaces (byte value 32) at the end of each line and a
blank line at the end of the file WHILE you are editing a file. (None of
these bytes are ever included when you actually SAVE the file though.)
4) Edit.com won't find any character strings you search for if
they start on one line and continue to the next! E.g., it can't find 'CD' in
the file shown above (just 'cd'). See below for more on Search problems!
5) You can't see any differences between the byte values
0, 32 and 255 on the display.
But for all its faults, Edit.com is almost guaranteed to be on a Windows
system (just like DEBUG), and might be OK for changing a quick byte or two
in a small file; assuming you know how to FIND those bytes(!)... Why? Rather
than just being very difficult (as it is when trying to enter certain bytes
into the edit window), it's almost impossible to place the byte values 0
(Null - no affect), 8 (BACKSPACE), 9 (TAB), 13 (Line Feed) or 27 (ESC key)
into the Search box without having those actions take place! For the other
control characters, you can use the 'ALT key plus Number Keypad'
method mentioned above.
XVI32 Hex-Editor by Christian Maas.
This is a very good and stable entry in the
class of 'free' Hex editors. However, some comments here are based upon
my personal preferences as one who opens many instances of binary files
daily. If you're new to binary file editing, or have specific changes
you want to make to certain files, this program may be just right for you!
The author of this program is concerned about anything you might
perceive as a 'bug.' And although in the past I had used the words 'Negative
review' to describe his program here, he was very professional in his email
to me and took the time to make some changes in his program!
Control characters can now appear as blank
spaces in the 'text' window, and the old 'grid pattern' display around all
the bytes and characters has been moved to an options menu. Although the
author did make some changes trying to cure the main drawback I had with his
older version, it's still a problem for me. He reduced the rate at which the
program scrolls through files when using the Arrow/Page keys, but the ASCII
characters in the text window still 'jump' (like using a page up/down key)
rather than scroll through the data. And more importantly, if you have very
large files to examine, trying to increase the rate by using the mouse on
the 'scroll bar,' keeps the characters from ever changing in the text window
(you'll see the word 'scrolling' near the bottom of the display) until after
you release it. This makes it impossible to scan large files with your
eyes at a reasonable rate; something I do quite often when looking
through system files or files that might contain viruses, or when searching
for any number of interesting patterns which are unknown to me at the time.
Christian is aware of this, but appears to be unable to do anything about
it due to the kind of software he uses.
HexEdit by
Andrew W. Phillips
Free
from Simtel (FTP): hexfre20.zip.
V 2.6 HexEdit Homepage.
( Note: Only HexEdit version 2.0 is free; the latest version
2.6 is commercial !! )
If you want a large Windows program with lots of colored buttons to push,
give this one a try. Actually it may be quite helpful for those who've never
used a Hex editor before. It has a very nice Introduction (in the Windows
Help file) which explains quite a bit about using a Hex editor, various
file types and extensions you're likely to come across and some of the terms
used in Hex editing.
( Note: If you use
a 640 x 480 display, try pressing the 'Decrease Font Size' button until all
the characters in the program window fit your screen size.)
BIEW
http://biew.sourceforge.net/en/biew.html
Binary Viewer/Hex Editor
Various OS versions!
Hex Wizard [ Not reviewed yet. ]
*
Notepad.exe (in Win 9x/NT, etc.) does NOT
add any bytes to the end of a file. You can even REMOVE excess bytes from a TEXT
file using Notepad. On the other hand, I had an old DOS version of Q-Edit that
not only added the bytes, 0d 0a
(the standard 'DOS' Carriage Return + Line Feed pair), but it also added the byte
1a (an End-of-File marker from
CP/M days or earlier!) to every file I edited with it!
So, know what your particular text editor does to a file!
Though MS-DOS certainly didn't need an
'End-of-File' marker (the Directory entries contained the exact length of each
file; just as FAT32 or NTFS FILE entries still do today), you may need to press
the 'CTRL' and 'Z' keys under DOS to let some app. or command know that
it's reached the 'End of your input'. For example, when you enter:
copy con newfilename at a DOS prompt, you must finish your
input with a ^Z character by pressing the Control and then
Z keys without letting up the Control key. This will still work under
a Win2000/XP/2003 DOS-box!
Updated: 10 JUL 2008
(Link to HxD Tutorial).
Updated: 20 NOV 2010 (New pictures for HxD).
The
Starman's Free Tools
for Windows Page