Hex Dump

Background

This is a fairly low level utility to discover the contents of a file. The output is displayed as an unformatted stream of 2 character hexadecimal values.

Why

The output of this program can be used as the input to hexsearch.

Usage

Usage: hexdump infile [start offset] [length]
The start offset is 0 based. Some validation is performed.

Examples

1. Display the content of a text file containing the string 'this':
hexdump in.txt
Output:
74686973

2. Display the content of a unicode text file containing the string 'this':
hexdump in.txt
Output:
fffe7400680069007300

3. Display the last 4 bytes of a file:
hexdump in.txt 6 4
Output:
69007300

4. Display the 2nd last 2 bytes of a file:
hexdump in.txt 6 2
Output:
6900

Notes

1. The entire input file is read into memory for speed. Extremely large files should not be read using this program.

Download

The Win32 console application is available in the download page.

Back to index.