BinStat 
Detect packed executables using statistics on the n-grams of their blocks and boosted decision trees.
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
- Split the executable into blocks of 1024 bytes
- Compute the frequencies of the unigrams (bytes) of each block
- Compute 13 statistical and information theory measures on these frequencies (Simpson's index, Canberra's distance, entropy, Kullback-Leibler's divergence, ...)
- Classify each block as packed or not with boosted decision trees
- If at least 50% of the blocks are packed, the input executable is packed ; otherwise, it is not
Related Projects
You may also like these:
- Awesome Executable Packing: A curated list of awesome resources related to executable packing.
- Bintropy: Analysis tool for estimating the likelihood that a binary contains compressed or encrypted bytes (inspired from this paper).
- Dataset of packed ELF files: Dataset of ELF samples packed with many different packers.
- Dataset of packed PE files: Dataset of PE samples packed with many different packers (fork of this repository).
- Docker Packing Box: Docker image gathering packers and tools for making datasets of packed executables.
- DSFF: Library implementing the DataSet File Format (DSFF).
- PEiD: Python implementation of the well-known Packed Executable iDentifier (PEiD).
- PyPackerDetect: Packing detection tool for PE files (fork of this repository).
- REMINDer: Packing detector using a simple heuristic (inspired from this paper).
Metadata
Release files for binstat 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| binstat-1.0.2.tar.gz | 1.7 MB | With provenance | Details for binstat-1.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| binstat-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for binstat-1.0.2-py3-none-any.whl |
Total release size: 2.4 MB
Release files / binstat-1.0.2.tar.gz
| Download URL | binstat-1.0.2.tar.gz |
|---|---|
| Size | 1.7 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f5ae72d53701357eeebb2275f40d1d76ea451316676a640f7ff0c39f435d31fc
|
|
BLAKE2b-256 checksum How to use checksums |
4022e1f330bec8d4c1778055695c7eed4d93d0f99615df55e7e2d75b4afb1041
|
| 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 Oct 30, 2026.
Transparency logRelease files / binstat-1.0.2-py3-none-any.whl
| Download URL | binstat-1.0.2-py3-none-any.whl |
|---|---|
| Size | 744.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
59f3c497b136c4d78b4cc412cc8b7624573c7a1991ef2dcc1d6e5def0f165ed4
|
|
BLAKE2b-256 checksum How to use checksums |
065127e6acb9f2ffa4fea9fa6c80972a7c35628abefe1a5a1d1fb48290cb4443
|
| 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 Oct 30, 2026.
Transparency logSecurity for binstat 1.0.2
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 2 files in this release have been uploaded with provenance metadata.
Attestation for binstat-1.0.2.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 Oct 30, 2026.
Transparency logA 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.