unblob
Accurate, fast, and easy-to-use extraction suite for binary blobs.
unblob parses unknown binary blobs for 78+ archive, compression, and file-system formats, extracts their content recursively, and carves out unknown chunks. It is the perfect companion for extracting, analyzing, and reverse engineering firmware images.
Demo
Features
- 78+ supported formats — archives, compression streams, and file systems including SquashFS, JFFS2, UBI/UBIFS, ext, CPIO, ZIP, 7-Zip, gzip, XZ, LZMA, LZ4, and many more. See the full list.
- Recursive extraction — extracts containers within containers up to a configurable depth (default: 10 levels).
- Precise chunk detection — identifies both start and end offsets of each chunk according to the format standard, minimizing false positives.
- Unknown chunk carving — carves out and reports data that does not match any known format, automatically identifying null/
0xFFpadding. - Entropy analysis — calculates Shannon entropy and chi-square probability for unknown chunks, useful for spotting encrypted or compressed data.
- JSON metadata reports — generates structured reports with chunk offsets, sizes, entropy, file ownership, permissions, timestamps, and more.
- Multi-processing — uses all available CPU cores by default for fast extraction.
- Extensible plugin system — write custom format handlers and extractors and load them at runtime with
--plugins-path. - No elevated privileges required — runs safely as a regular user.
- Battle-tested — fuzz tested against a large corpus of firmware images; relies on audited, pinned dependencies.
Installation
pip (recommended for most users)
pip install unblob
Then install the required external extractor tools. On Ubuntu/Debian:
sudo apt install android-sdk-libsparse-utils e2fsprogs p7zip-full unar zlib1g-dev liblzo2-dev lzop lziprecover libhyperscan-dev zstd lz4
For SquashFS support, also install sasquatch:
curl -L -o sasquatch_1.0.deb "https://github.com/onekey-sec/sasquatch/releases/download/sasquatch-v4.5.1-6/sasquatch_1.0_$(dpkg --print-architecture).deb"
sudo dpkg -i sasquatch_1.0.deb && rm sasquatch_1.0.deb
Verify that all extractors are available:
unblob --show-external-dependencies
Docker (batteries included)
The Docker image bundles all extractors — no extra setup needed:
docker run \
--rm \
--pull always \
-v /path/to/extract-dir:/data/output \
-v /path/to/files:/data/input \
ghcr.io/onekey-sec/unblob:latest /data/input/firmware.bin
Note: Mount directories must be owned by the same
uid:gid. On multi-user systems, add-u $UID:$GIDto the command.
Kali Linux
sudo apt install unblob
Nix
nix profile install nixpkgs#unblob
Or add it to your NixOS/home-manager configuration — see the installation docs for flake and overlay examples.
From source
git clone https://github.com/onekey-sec/unblob.git
cd unblob
uv sync --no-dev
uv run unblob --show-external-dependencies
Requires Python ≥ 3.10, uv, and a Rust toolchain (for the compiled extensions).
Usage
Command line
Extract a file (output goes to <filename>_extract/ by default):
unblob firmware.bin
Specify a custom output directory:
unblob -e /tmp/output firmware.bin
Generate a JSON metadata report:
unblob --report report.json firmware.bin
Limit recursion depth and enable entropy analysis:
unblob -d 5 -n 2 firmware.bin
Skip files matching a magic string prefix:
unblob --skip-magic "POSIX tar archive" firmware.bin
Load a custom handler plugin:
unblob -P ./myplugins/ firmware.bin
Full CLI reference
Usage: unblob [OPTIONS] FILE
Options:
-e, --extract-dir DIRECTORY Extract the files to this directory.
-f, --force Force extraction even if outputs already exist.
-d, --depth INTEGER Recursion depth (default: 10).
-n, --entropy-depth INTEGER Entropy calculation depth (default: 1; 0 = off).
-P, --plugins-path PATH Load plugins from the provided path.
-S, --skip-magic TEXT Skip files with a given magic prefix.
-p, --process-num INTEGER Number of parallel worker processes (default: CPU count).
--report PATH Write a JSON metadata report to this file.
-k, --keep-extracted-chunks Keep extracted chunks on disk.
--delete-extracted-files TEXT Delete intermediate files after extraction.
-v, --verbose Increase verbosity (-v, -vv, -vvv).
--show-external-dependencies List required external tools and their status.
-h, --help Show this message and exit.
Python API
from pathlib import Path
from unblob.processing import ExtractionConfig, process_file
config = ExtractionConfig(
extract_root=Path("/tmp/output"),
randomness_depth=1,
)
result = process_file(config, Path("firmware.bin"))
To also write a JSON report:
process_file(config, Path("firmware.bin"), report_file=Path("report.json"))
ExtractionConfig accepts the same options as the CLI: max_depth, process_num, skip_magic, force_extract, keep_extracted_chunks, and more. See the API reference for the full list.
Testing
unblob uses pytest. Integration test fixtures are stored in Git LFS.
# Install Git LFS (one-time setup)
git lfs install
# Install all development dependencies
uv sync --all-extras --dev
# Run the full test suite
uv run pytest tests/ -v
Documentation
Full documentation is available at https://unblob.org:
- Installation
- User guide
- Supported formats
- API reference
- Development guide — writing custom handlers, extractors, and plugins
- Contribution guide
Contributing
Contributions are welcome! If you would like to add support for a new format or improve an existing one:
- Open an issue to describe the format (hex dumps, spec links, and sample files help a lot).
- Read the development guide to learn how to write handlers and extractors.
- Fork the repository, implement your changes, and open a pull request.
If you just need a format supported and don't want to implement it yourself, open an issue — we'll consider adding it.
See CONTRIBUTING for more details.
License
unblob is licensed under the MIT License.
Metadata
Release files for unblob 26.6.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| unblob-26.6.4.tar.gz | 163.2 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| unblob-26.6.4-cp39-abi3-musllinux_1_1_x86_64.whl | CPython 3.9 | abi3 | Linux musl 1.1+ x86-64 | Details |
| unblob-26.6.4-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.9 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| unblob-26.6.4-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.9 | abi3 | Linux glibc 2.17+ ARM64 | Details |
| unblob-26.6.4-cp39-abi3-macosx_11_0_arm64.whl | CPython 3.9 | abi3 | macOS 11.0+ ARM64 | Details |
| unblob-26.6.4-cp39-abi3-macosx_10_12_x86_64.whl | CPython 3.9 | abi3 | macOS 10.12+ x86-64 | Details |
Total release size: 2.9 MB
Release files / unblob-26.6.4.tar.gz
| Download URL | unblob-26.6.4.tar.gz |
|---|---|
| Size | 163.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5dac92c617912d77fef471b28df86cdd7aa3817de3b6febd9bb9251fb41552fa
|
|
BLAKE2b-256 checksum How to use checksums |
b07130a7ff4b91e99e45a9df491cd16d048ce50d2e2998c1dbdd3a0ba6558f5f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.13.3
|
Release files / unblob-26.6.4-cp39-abi3-musllinux_1_1_x86_64.whl
| Download URL | unblob-26.6.4-cp39-abi3-musllinux_1_1_x86_64.whl |
|---|---|
| Size | 734.4 kB |
| Tags | CPython 3.9 Linux musl 1.1+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
3ee8696c2aa883d136047cb565ce25826adf5daa6b77fbf89803438e0c4c696f
|
|
BLAKE2b-256 checksum How to use checksums |
1f7e08898b09543f36e58e171f8faecaa4275e7fb7d831cafe19ba157503d197
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.13.3
|
Release files / unblob-26.6.4-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | unblob-26.6.4-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 530.7 kB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
0fc16e9c7dc92fcf86b8b61475700c9dd16e1dddacf34467574ea965a5d3584e
|
|
BLAKE2b-256 checksum How to use checksums |
33c01a794c156f0f4dc88542357850decd0854e65dadd7f63da85fba5ad37dbe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.13.3
|
Release files / unblob-26.6.4-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | unblob-26.6.4-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 525.6 kB |
| Tags | CPython 3.9 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
0d5dfdd3850ab8849c6be5f9c27724d679b8e55e909b92726e3835cd1b67cff7
|
|
BLAKE2b-256 checksum How to use checksums |
0b5cf956c5dba696f2a012711847703b53cb2338f0c090640aacdc88dac7d091
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.13.3
|
Release files / unblob-26.6.4-cp39-abi3-macosx_11_0_arm64.whl
| Download URL | unblob-26.6.4-cp39-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 478.0 kB |
| Tags | CPython 3.9 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
a2276495ae5ec3ed760af85c4c486711998205bbff97b09bde970b3d007b1476
|
|
BLAKE2b-256 checksum How to use checksums |
e7bfafe6d513884431111d808af37ee58be29251385d44466bfcf78b0d15bdfc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.13.3
|
Release files / unblob-26.6.4-cp39-abi3-macosx_10_12_x86_64.whl
| Download URL | unblob-26.6.4-cp39-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 484.0 kB |
| Tags | CPython 3.9 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
7b3d1a1a41e031395d052d6ac3d52c7edef0f40f2c4438514c6e5565361aaef7
|
|
BLAKE2b-256 checksum How to use checksums |
5d13e41ce1e1f93df5d8c936609cd081e3fe5d94722344667fa0ac343b0211b1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.13.3
|