A simple binary dump tool for fun:)
- C 100%
| .gitignore | ||
| bindump.c | ||
| COPYING | ||
| README.md | ||
bindump
A simple binary dump tool for fun:)
Usage
bindump < data.bin > dump.txt # Encode mode.
bindump -d < dump.txt > data.bin # Decode mode.
Examples of execution
Encode
- data.bin
This is data of data.bin
- Output of
bindump < data.bin
010101000110100001101001011100110010000001101001011100110010000001100100011000010111010001100001001000000110111101100110001000000110010001100001011101000110000100101110011000100110100101101110
Decode
- dump.txt
0101010001101000011010010111001100100000011010010111001100100000011011110111001001101001011001110110100101101110011000010110110000100000011101000110010101111000011101000010000001100010011001010110011001101111011100100110010100100000011001010110111001100011011011110110010001101001011011100110011100101110
- Output of
bindump < dump.txt
This is original text before encoding.
Options
-d : Decode binary dump text to binary data.
-i <filename> : Load data from file instead of stdin.
-o <filename> : Write data to file instead of stdout.
-h --help : Show this help.
-v --version : Show version info.
Build instructions
You can compile this program with any compilers that supports C89 or later.
If you are using gcc, follow the command like this:
gcc bindump.c -o bindump -O2
Supported platforms
This program should be compiled and run on any platforms.
These platforms are tested by developer:
Compilers
- gcc
- clang
- Microsoft Visual C++
- Microsoft QuickC
- OpenWatcom
Operating systems
- GNU/Linux
- Debian 13
- Ubuntu 24.04
- Windows
- Windows 98
- Windows XP
- Windows 11
- macOS 26 Tahoe
- MS-DOS (both PC/AT Compatibles and NEC PC-9800 Series)
Notes
This tool was designed mainly for fun. This may not suitable for development, office use and other than playing.
Why did you create this? There is already a greater and richer features program xxd.
Yes, I know that.
However, it seemed complicated and didn’t accomplish what I was looking for.
I ran the following command:
xxd -g0 -c0 -ps -b < file.bin > dump.txt
I expected the output to look like 0101010…, but I received:
xxd: only one of -b, -e, -u, -p, -i can be used
This indicates that xxd cannot produce an unformatted binary dump.
I needed a simple and easy‑to‑understand program that can output unformatted binary dump as text and restore it.
License
MIT License