Skip to content

1Dodge/hexdump

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hexdump: A tool with a lot of features

I am a windows user and it botheres me, that there is no native hexdump tool. So i decided to make my own, even better one! The tool is completely written in Rust and it was a great learning experience.

Install

You can either download the latest released pre-compiled binaries or compile the tool yourself. (When you build it yourself, you have to build the release using cargo build --release).
After building or downloading the pre-compiled binaries, move the hexdump.exe into a distinct folder. For example: C:\Users\<you>\Documents\hexdumpTool.
Then add that folder path to your Environment Variables, so you can use the tool in your cmd/powershell/terminal.

How to use

You can use hexdump like this:

hexdump <FILE> [OPTIONS]

Required arguments

  • <FILE>: Path to the file to dump

Options

  • -h, --help: Prints the help
  • -v, --visualization: In what style the data should be printed
  • -s, --start: At what address the dump should start
  • -n, --num-bytes: How many bytes should be dumped
  • -e, --end: At what address the dump should end

Features

hexdump features a lot of options:

Visualization modes

You can set different visualization modes via the -v argument. Currently there are:

  1. -v ascii: Data bytes that are drawable as ascii characters are drawn green and all others red.

  2. -v zeros: Data bytes that have the value 0 are drawn magenta and all others white.

  3. -v high: Data bytes that are bigger than 0x80 are drawn blue and all others white.

  4. -v control: Data bytes that are ascii control characters are drawn yellow and all others white.

Address modes

You can use -s, -n and -e in different combinations:

  1. -s: Dumps all bytes in the range of start_address to EOF1.

  2. -n: Dumps n bytes starting from address 0.

  3. -e: Dumps all bytes in the range of 0 to end_address.

  4. -s -n: Dumps n bytes starting from start_address.

  5. -s -e: Dumps all bytes in the range of start_address to end_address.

  6. -n -e: Dumps n bytes ending at end_address (therefore it starts from end_address - (n - 1)).

  7. -s -n -e: Using all address related arguments at the same time results in UB2 and is therefore an invalid argument combination.

Notice: You can pass the value of -s, -n or -e either in decimal (eg: -n 256) or hex (eg: -s 0x100). Also, the number of digits used when printing the Base Address adjusts automatically, but is always at least 4.

Examples

First lets dump a text file with plain style:

plain dump

Now lets take a look at the -v argument:

-v ascii dump
-v control dump

Lets make use of the -n argument on a big file!

-n dump

Lets use a combination of our arguments!

-s -n -v high dump

How about we slice out some data from the middle of the file?

sliced dump

And finally lets make use of the -v zeros option!

-s -e -v zeros dump

Footnotes

  1. EOF: End Of File

  2. UB: Undefiend Behaviour

About

Hexdump tool for windows with nice formatted output (colorfull) and a wide range of arguments.

Resources

License

Stars

Watchers

Forks

Contributors

Languages