Skip to main content

BinStat Tweet

Detect packed executables using statistics on the n-grams of their blocks and boosted decision trees.

PyPi Python Versions Read The Docs Build Status Security Coverage Status License

BinStat is an implementation of this paper into a Python package with a console script to detect whether an executable is packed, using statistics on the n-grams of its blocks and boosted decision trees.

Models trained on PE (the default one) and ELF (used for ELF executables) files are included ; scikit-learn is only needed for training your own models.

$ pip install binstat
$ binstat --help
[...]
usage examples:
- binstat detect program.exe
- binstat detect program.exe --threshold 0.6 --ratio
- binstat features program.exe --label yes
- binstat train -p packed/ -n not-packed/ -o model.json --max-blocks 100

Detection Mechanism

  1. Split the executable into blocks of 1024 bytes
  2. Compute the frequencies of the unigrams (bytes) of each block
  3. Compute 13 statistical and information theory measures on these frequencies (Simpson's index, Canberra's distance, entropy, Kullback-Leibler's divergence, ...)
  4. Classify each block as packed or not with boosted decision trees
  5. If at least 50% of the blocks are packed, the input executable is packed ; otherwise, it is not

You may also like these:

Back to top

Metadata

Release files for binstat 1.0.4

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

Source distribution (sdist)

Source distribution for binstat 1.0.4
File Size Uploaded Provenance Actions
binstat-1.0.4.tar.gz 1.7 MB With provenance Details for binstat-1.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for binstat 1.0.4
File Interpreter ABI Platform Actions
binstat-1.0.4-py3-none-any.whl Python 3 none any Details for binstat-1.0.4-py3-none-any.whl

Total release size: 2.4 MB

Release files / binstat-1.0.4.tar.gz

Download URL binstat-1.0.4.tar.gz
Size 1.7 MB
Tags Source
SHA-256 checksum
How to use checksums
3207b5e161e6e6656cd60f9e2a9e72bd760e0e26a37b92e9211e01c90ab87450
BLAKE2b-256 checksum
How to use checksums
87cd013ffd6ef15bfeb522ef451bf900870f9dc24e35e9bf60ec6ef540e41af3
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 2, 2026.

Transparency log

Release files / binstat-1.0.4-py3-none-any.whl

Download URL binstat-1.0.4-py3-none-any.whl
Size 744.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2cc54c547e0c037f00ddd8fc9702c89da9b1ff5d52d0701308180db1eefbbd0a
BLAKE2b-256 checksum
How to use checksums
3952f5727a8930214dc59c3cc74c7d486cc22622411759871a9aea87a74f2421
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 2, 2026.

Transparency log

Security for binstat 1.0.4

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for binstat-1.0.4.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 2, 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