Hex Editor
   HOME

TheInfoList



OR:

A hex editor (or ''binary file editor'' or ''byte editor'') is a
computer program A computer program is a sequence or set of instructions in a programming language for a computer to execute. Computer programs are one component of software, which also includes documentation and other intangible components. A computer program ...
that allows for manipulation of the fundamental
binary Binary may refer to: Science and technology Mathematics * Binary number, a representation of numbers using only two digits (0 and 1) * Binary function, a function that takes two arguments * Binary operation, a mathematical operation that ta ...
data that constitutes a
computer file A computer file is a computer resource for recording data in a computer storage device, primarily identified by its file name. Just as words can be written to paper, so can data be written to a computer file. Files can be shared with and trans ...
. The name 'hex' comes from ' hexadecimal', a standard numerical format for representing binary data. A typical computer file occupies multiple areas on the storage medium, whose contents are combined to form the file. Hex editors that are designed to
parse Parsing, syntax analysis, or syntactic analysis is the process of analyzing a string of symbols, either in natural language, computer languages or data structures, conforming to the rules of a formal grammar. The term ''parsing'' comes from Lat ...
and edit
sector Sector may refer to: Places * Sector, West Virginia, U.S. Geometry * Circular sector, the portion of a disc enclosed by two radii and a circular arc * Hyperbolic sector, a region enclosed by two radii and a hyperbolic arc * Spherical sector, a p ...
data from the physical segments of
floppy A floppy disk or floppy diskette (casually referred to as a floppy, or a diskette) is an obsolescent type of disk storage composed of a thin and flexible disk of a magnetic storage medium in a square or nearly square plastic enclosure lined wi ...
or hard disks are sometimes called ''sector editors'' or ''
disk editor A disk editor is a computer program that allows its user to read, edit, and write raw data (at character or hexadecimal, byte-levels) on disk drives (e.g., hard disks, USB flash disks or removable media such as a floppy disks); as such, they ...
s''.


Details

With a hex editor, a user can see or edit the raw and exact contents of a file, as opposed to the interpretation of the same content that other, higher level
application software Application may refer to: Mathematics and computing * Application software, computer software designed to help the user to perform specific tasks ** Application layer, an abstraction layer that specifies protocols and interface methods used in a ...
may associate with the file format. For example, this could be raw image data, in contrast to the way image editing software would interpret and show the same file. Hex editors may be used to correct data corrupted by system or application program problems where it may not be worthwhile to write a special program to make the corrections. They are useful to bypass application edit checks which may prevent correction of erroneous data. They have been used to "patch" executable programs to change or add a few instructions as an alternative to recompilation. Program fixes for
IBM mainframe IBM mainframes are large computer systems produced by IBM since 1952. During the 1960s and 1970s, IBM dominated the large computer market. Current mainframe computers in IBM's line of business computers are developments of the basic design of th ...
systems are sometimes distributed as patches rather than distributing a complete copy of the affected program. In most hex editor applications, the
data In the pursuit of knowledge, data (; ) is a collection of discrete Value_(semiotics), values that convey information, describing quantity, qualitative property, quality, fact, statistics, other basic units of meaning, or simply sequences of sy ...
of the computer file is represented as hexadecimal values grouped in 4 groups of 4
byte The byte is a unit of digital information that most commonly consists of eight bits. Historically, the byte was the number of bits used to encode a single character of text in a computer and for this reason it is the smallest addressable uni ...
s (or two groups of 8 bytes), followed by one group of 16 printable
ASCII ASCII ( ), abbreviated from American Standard Code for Information Interchange, is a character encoding standard for electronic communication. ASCII codes represent text in computers, telecommunications equipment, and other devices. Because ...
characters which correspond to each pair of hex values (each byte). Non-printable ASCII characters (e.g., Bell) and characters that would take more than one character space (e.g., tab) are typically represented by a dot (".") in the following ASCII field. ; Size limits Unlike conventional text editors, Hex editors are able to efficiently handle files with indefinite sizes, as only a portion of the file is loaded while browsing it and modified when saving it, rather than the entire file at once.


Early history

Since the invention of computers and their different uses, a variety of file formats has been created. In some special circumstances it was convenient to be able to access the data as a series of raw digits. A program called SUPERZAP (AMASPZAP) was available for IBM
OS/360 OS/360, officially known as IBM System/360 Operating System, is a discontinued batch processing operating system developed by IBM for their then-new System/360 mainframe computer, announced in 1964; it was influenced by the earlier IBSYS/IBJOB ...
systems which could edit raw disk records and also understood the format of executable files. Pairs of hexadecimal digits (each pair can represent a byte) are the current standard, because the vast majority of machines and file formats in use today handle data in units or groups of 8-bit bytes. Hexadecimal and also
octal The octal numeral system, or oct for short, is the base-8 number system, and uses the digits 0 to 7. This is to say that 10octal represents eight and 100octal represents sixty-four. However, English, like most languages, uses a base-10 number ...
are common because these digits allow one to see which bits in a byte are set. Today, decimal instead of hexadecimal representation is becoming a popular second option due to the more familiar number base and additional helper tools, such as template systems and data inspectors, that reduce the benefits of the hexadecimal numerical format.


Template systems

Some hex editors offer a template system that can present the sequence of bytes of a
binary file A binary file is a computer file that is not a text file. The term "binary file" is often used as a term meaning "non-text file". Many binary file formats contain parts that can be interpreted as text; for example, some computer document fil ...
in a structured way, covering part or all of the desired file format. Usually the
GUI The GUI ( "UI" by itself is still usually pronounced . or ), graphical user interface, is a form of user interface that allows users to interact with electronic devices through graphical icons and audio indicator such as primary notation, inste ...
for a template is a separate tool window next to the main hex editor. Some cheat engine systems consist only of such a template GUI. Typically, a template is represented as a list of labeled text boxes, such that individual values of a file can be easily edited in the appropriate format (e.g., as string, color, or decimal number). Without template support, it is necessary to find the right offset in a file where the value that is to be changed is stored. Also, raw hex editing may require conversion from hexadecimal to decimal, catering for
byte order In computing, endianness, also known as byte sex, is the order or sequence of bytes of a word of digital data in computer memory. Endianness is primarily expressed as big-endian (BE) or little-endian (LE). A big-endian system stores the most sig ...
, or other data type conversion peculiarities. Templates can be stored as files, thereby exchanged by users, and are often shared publicly over the manufacturer's website. Most if not all hex editors define their own template file format; there is no trend to support a standard or even compatibility between the various formats out in the wild.


Scripting systems

Advanced hex editors have scripting systems that let the user create macro like functionality as a sequence of user interface commands for automating common tasks. This can be used for providing scripts that automatically patch files (e.g., game cheating, modding, or product fixes provided by community) or to write more complex/intelligent templates. Scripting languages vary widely, often being product specific languages resembling MS-DOS batch files, to systems that support fully-fledged scripting languages such as
Lua Lua or LUA may refer to: Science and technology * Lua (programming language) * Latvia University of Agriculture * Last universal ancestor, in evolution Ethnicity and language * Lua people, of Laos * Lawa people, of Thailand sometimes referred t ...
or
Python Python may refer to: Snakes * Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia ** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia * Python (mythology), a mythical serpent Computing * Python (pro ...
.


Plugin systems

A few select editors have a plugin system that allows to extend the GUI and add new functionality, usually loading dynamic link libraries written in a C-compatible language.


See also

*
Comparison of hex editors The following is a comparison of notable hex editors. General Features {, class="wikitable sortable" style="font-size: 85%; border: gray solid 1px; border-collapse: collapse; text-align: center; width: 100%;" , - style="background: #ece ...
*
Disk editor A disk editor is a computer program that allows its user to read, edit, and write raw data (at character or hexadecimal, byte-levels) on disk drives (e.g., hard disks, USB flash disks or removable media such as a floppy disks); as such, they ...
* Hex dump * Hexadecimal *
Octal The octal numeral system, or oct for short, is the base-8 number system, and uses the digits 0 to 7. This is to say that 10octal represents eight and 100octal represents sixty-four. However, English, like most languages, uses a base-10 number ...


References

* {{cite web, url=http://www.linfo.org/hex_editor.html, title=Hex Editor Definition, author=The Linux Information Project, access-date=2010-05-30 Computer data Hexadecimal numeral system Utility software types