Skip to main content

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.

CI PyPI version PyPI downloads License: MIT


Demo

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/0xFF padding.
  • 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 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:$GID to 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.11, 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:


Contributing

Contributions are welcome! If you would like to add support for a new format or improve an existing one:

  1. Open an issue to describe the format (hex dumps, spec links, and sample files help a lot).
  2. Read the development guide to learn how to write handlers and extractors.
  3. 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.11.26

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for unblob 26.11.26
File Size Uploaded Provenance Actions
unblob-26.11.26.tar.gz 195.9 kB With provenance Details for unblob-26.11.26.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for unblob 26.11.26
File Actions
unblob-26.11.26-cp311-abi3-musllinux_1_1_x86_64.whl CPython 3.11 abi3 Linux musl 1.1+ x86-64 Details for unblob-26.11.26-cp311-abi3-musllinux_1_1_x86_64.whl
unblob-26.11.26-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.11 abi3 Linux glibc 2.17+ x86-64 Details for unblob-26.11.26-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
unblob-26.11.26-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.11 abi3 Linux glibc 2.17+ ARM64 Details for unblob-26.11.26-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
unblob-26.11.26-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details for unblob-26.11.26-cp311-abi3-macosx_11_0_arm64.whl
unblob-26.11.26-cp311-abi3-macosx_10_12_x86_64.whl CPython 3.11 abi3 macOS 10.12+ x86-64 Details for unblob-26.11.26-cp311-abi3-macosx_10_12_x86_64.whl

Total release size: 3.1 MB

Release files / unblob-26.11.26.tar.gz

Download URL unblob-26.11.26.tar.gz
Size 195.9 kB
Tags Source
SHA-256 checksum
How to use checksums
dc4a31dfafed6992c66893a8766ad2a1f75a85a7332d45f64741acfaa6b4b959
BLAKE2b-256 checksum
How to use checksums
1151310960b253ec50e3972cbad5a87c8846d4dbefe66e3ae429079a8b8e9dd5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

Release files / unblob-26.11.26-cp311-abi3-musllinux_1_1_x86_64.whl

Download URL unblob-26.11.26-cp311-abi3-musllinux_1_1_x86_64.whl
Size 769.6 kB
Tags CPython 3.11 Linux musl 1.1+ x86-64 abi3
SHA-256 checksum
How to use checksums
e3d5e24f3320b702c11d9428c64ed9af5481312ade126e0f59d7c1846aa65d79
BLAKE2b-256 checksum
How to use checksums
439a6016a5aaa43d3b3a656032a55ce78569926007db1cbeb88e97ce9b32f1be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

Release files / unblob-26.11.26-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL unblob-26.11.26-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 565.5 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
6c478f1e55fe326ff853eb460f47c0d4f441dda1091a7257635c72c2c160ba7f
BLAKE2b-256 checksum
How to use checksums
a29b610a67f77f16d7ae465aa3821d83d6d72bfa60a6389c1cf0473eea30f01b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

Release files / unblob-26.11.26-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL unblob-26.11.26-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 562.3 kB
Tags CPython 3.11 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
aca0e0c784a1f0d251ae0111df72b2882df5bf6f1bd6b34df689ebb9bb1141cc
BLAKE2b-256 checksum
How to use checksums
0d5848efc80ac80a3dfba7b04bc443108c42eff873a5232c8575bab24f986cdf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

Release files / unblob-26.11.26-cp311-abi3-macosx_11_0_arm64.whl

Download URL unblob-26.11.26-cp311-abi3-macosx_11_0_arm64.whl
Size 517.4 kB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
3c3d5dd0c3ce0a39e814924ade125f93a21e262a63a3dbf34d059f2a95160ed1
BLAKE2b-256 checksum
How to use checksums
04c6dddb91e11a75854d20643a0ad139ca6987f968f2f6ba2d6a8acb04a3fc44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

Release files / unblob-26.11.26-cp311-abi3-macosx_10_12_x86_64.whl

Download URL unblob-26.11.26-cp311-abi3-macosx_10_12_x86_64.whl
Size 514.9 kB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
a58902025e915e4f9e74e8474fb7da4c69cd3fc91fb43340219c12459e914d8f
BLAKE2b-256 checksum
How to use checksums
af001808fe45001e0cafd3bca69c9871653049efd61362211a751c1113934b4d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

Security for unblob 26.11.26

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for unblob-26.11.26.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page