A tool and library infrastructure for hexadecimal analysis, reversing, searching, dumping and more.
Project description
rawdumper
Rawdumper is a library based on adamlibrary designed to convert hexadecimal code into binary by directly dumping the hexadecimal code in Python, and to analyze hexadecimal data, offering search and reversing support.
This is a library first, CLI second: importing rawdumper never
parses argv or touches stdin. The command-line interface is a thin,
optional layer on top.
Install
pip install -e .
Library usage
import rawdumper
data = open("file.bin", "rb").read()
# Render a hex dump as text
print(rawdumper.dump(data, width=16))
# Search for a byte pattern
offsets = rawdumper.find(data, b"needle")
print(rawdumper.contains(data, b"needle"))
# Shannon entropy (bits per byte)
print(rawdumper.entropy(data))
# Restore a hex dump back to binary
text = rawdumper.dump(data, squeeze=False)
restored = rawdumper.restore(text)
assert restored == data
Every function in the public API (rawdumper.dump, rawdumper.find,
rawdumper.entropy, rawdumper.restore, etc.) is a plain function that
takes bytes in and returns a value — no global state, no CLI
side effects.
Optional CLI
Installing this package also registers a rawdumper console script,
and the package can be run directly as a module:
rawdumper file.bin
python -m rawdumper file.bin --width 8 --find "Wolf" --stats
python -m rawdumper --reverse dump.hex -o restored.bin
CLI flags:
| Flag | Description |
|---|---|
--width N |
bytes per line (default 16) |
--offset N |
starting offset, 0x.. supported |
--length N |
number of bytes to read |
--find TEXT |
search for a pattern and highlight matching lines |
--octal |
show bytes in octal instead of hex |
--no-squeeze |
disable collapsing of repeated identical lines |
--stats |
print size and Shannon entropy before the dump |
--reverse |
treat input as a hex dump and restore it to binary |
-o, --output |
output path when used with --reverse |
What's C-backed and why
| Module | adamlibrary function used | Purpose |
|---|---|---|
rawdumper.core |
adam.memcpy |
chunk byte copying |
rawdumper.core |
datasetname.itoa |
decimal→octal string formation |
rawdumper.search |
memreplication_cutline.memchr |
byte pattern search |
rawdumper.stats |
math.log |
Shannon entropy calculation |
rawdumper.reverse |
stringer.strdup |
owned copy of input before parsing |
Package layout
rawdumper/
├── __init__.py # public API surface (dump, find, entropy, restore, ...)
├── core.py # dump/format logic
├── search.py # pattern search
├── stats.py # entropy
├── reverse.py # hex-to-binary restore
└── __main__.py # optional CLI, only runs via `python -m rawdumper` or the console script
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rawdumper-1.0.0-py3-none-any.whl.
File metadata
- Download URL: rawdumper-1.0.0-py3-none-any.whl
- Upload date:
- Size: 21.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
851ab5dceb157d44c8999383d1da51f327cf616263a8fc485dff35e8a72dedb5
|
|
| MD5 |
28adac9f4b8ec4a31460ba78bcb9687b
|
|
| BLAKE2b-256 |
1c9c64660c6f63c5ceba60eedb4a5b1bba62b400c832c6afa6030a810dd24c74
|