Bintropy
Analysis tool for estimating the likelihood that a binary contains compressed or encrypted bytes
Install / Use
/learn @packing-box/BintropyREADME
This tool is an implementation in Python of Bintropy, an analysis tool presented in this paper in the scope of packing detection based on entropy. It implements both modes of operation and an additional one, respectively on the entire binary, per section or per segment. It uses the entropy values mentioned in the paper for deciding whether the binary contains compressed/encrypted bytes.
It relies on lief for abstracting either PE, ELF or Mach-O executables. This tool thus supports these three formats.
$ pip install bintropy
$ bintropy --help
Modes of operation
Use the -m/--mode option.
0: full binary (default)1: per section2: per segment
Note that mode 2 will logically give results very similar to mode 0.
$ bintropy binary
<<< boolean >>>
$ bintropy binary --dot-not-decide
<<< highest block entropy, average block entropy >>>
$ bintropy binary --mode [1|2]
<<< boolean >>>
$ bintropy binary -m [1|2] --do-not-decide
<<< highest block entropy, average block entropy >>>
Benchmarking
Use the -b/--benchmark option to get one more value, the processing time in seconds.
$ bintropy binary -b
<<< boolean, processing time >>>
$ bintropy binary -b --do-not-decide
<<< highest block entropy, average block entropy, processing time >>>
Overriding default entropy values
The reference paper uses 6.677 for the average block entropy and 7.199 for the highest block entropy (obtained by analyzing a dataset of PE files and using the first mode of operation). These values can be overriden with the dedicated options.
$ bintropy binary --threshold-average-entropy 5.678 --threshold-highest-entropy 6.789
[...]
Plotting
This tool features plot generation for drawing binary's sections and the entropy within.
$ bintropy binary --plot
<<< boolean >>>
Example of generated figures:
<p align="center"><img src="https://github.com/packing-box/bintropy/raw/main/docs/example.png"></p>:star: Related Projects
You may also like these:
- Awesome Executable Packing: A curated list of awesome resources related to executable packing.
- 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).
:clap: Supporters
<p align="center"><a href="#"><img src="https://img.shields.io/badge/Back%20to%20top--lightgrey?style=social" alt="Back to top" height="20"/></a></p>Related Skills
openai-image-gen
328.7kBatch-generate images via OpenAI Images API. Random prompt sampler + `index.html` gallery.
claude-opus-4-5-migration
81.0kMigrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5
model-usage
328.7kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
TrendRadar
49.5k⭐AI-driven public opinion & trend monitor with multi-platform aggregation, RSS, and smart alerts.🎯 告别信息过载,你的 AI 舆情监控助手与热点筛选工具!聚合多平台热点 + RSS 订阅,支持关键词精准筛选。AI 智能筛选新闻 + AI 翻译 + AI 分析简报直推手机,也支持接入 MCP 架构,赋能 AI 自然语言对话分析、情感洞察与趋势预测等。支持 Docker ,数据本地/云端自持。集成微信/飞书/钉钉/Telegram/邮件/ntfy/bark/slack 等渠道智能推送。
