Binlex: turning binaries into searchable genetic traits
A Binary Genetic Traits Lexer Framework
At a glance
- What is it?
- Binlex is a Rust framework that extracts instructions, basic blocks and functions from PE, ELF and Mach-O binaries and emits JSON traits built on a genomics-inspired model of genomes, chromosomes, alleles and genes. It suits reverse engineers who need pattern-level comparison and YARA generation across large sample sets.
- Who is it for?
- Binlex fits a reverse engineering team that already has a large sample corpus and wants structural similarity rather than byte-for-byte comparison, because the wildcarded chromosome model and the YARA generation path are the parts that scale across variants of the same family.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 114 days ago.
- What is it written in?
- Mainly Rust, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on October 24, 2026, and from our analysis. They are not legal advice.
Editorial analysis
Binlex lexes a binary into traits rather than into functions
Binlex is described as a binary genetic traits lexer framework, and the phrasing is literal about the method. Instead of handing you a decompiled function listing, it walks the binary and emits searchable JSON traits for instructions, basic blocks and functions, aimed at reverse engineering, hunting and similarity workflows. The representation borrows from genomics on purpose. Genomes are the units, meaning instructions, blocks and functions. Chromosomes are wildcarded patterns. Allele pairs are bytes, and genes are nibbles. That hierarchy is the project's actual contribution, because it makes comparison happen at the pattern level rather than at the byte level. Two samples of the same malware family rarely match byte for byte after a recompile or a packer pass, but their structural traits often line up. Binlex is therefore aimed at clustering and signature generation across large sample sets, and the README is explicit that the point is to make malware analysis and binary similarity systematic rather than manual.
The CLI suite covers hashing, symbols, images and YARA
The tool suite is wider than the single binary the name suggests, and the README lists the members. binlex is the main CLI for binary trait extraction. binlex-hash is a hashing utility, binlex-image is an image-related utility, and binlex-symbols handles symbol ingestion and conversion. binlex-yara generates YARA rules from Binlex-style patterns or streams, which is the step where traits turn into something a scanner can run. Two more are infrastructure rather than end-user tools. binlex-server is a processor transport server for http workflows, and binlex-mcp is a Model Context Protocol server that exposes Binlex tools to MCP clients, which is how an assistant-driven analysis session reaches the extractor. The processor framework itself lives in Rust, with fast external execution over ipc and http transports, and you can build your own Rust processors to perform additional analysis on top of it. The command line guide is in docs/command-line.md and the custom processor guide is in docs/processors.md.
Hashing, traits and normalization for similarity work
The feature list describes the layers of the pipeline. The hashing and traits layer offers MinHash, TLSH, SHA256, entropy and wildcard patterns, which is a deliberate mix of exact and approximate fingerprints. SHA256 tells you two files are identical, TLSH and MinHash tell you they are probably related, and entropy tells you whether a region is compressed or encrypted rather than code. The wildcard patterns are the trait side of the family, and they are what makes the chromosome model work. Above that sits a normalization and feature pipeline explicitly aimed at ML-oriented similarity workflows, which is where the burn dependency in the manifest comes from, with the standard, dispatch and ndarray features and CUDA and Vulkan backends enabled. The Machine learning angle is a stated direction of the project rather than a detail: the dependency list includes a pre-release version, 0.21.0-pre.2, which tells you this part of the stack is still settling.
Building the workspace and the Python bindings
Build and install is documented in four separate routes depending on what you want to run. The Rust route is two commands: an xtask run that prepares the build, then a release build of the whole workspace. The xtask step is not optional decoration, since the Makefile runs it in the prepare target that every other target depends on, including test and build.
cargo run --manifest-path xtask/Cargo.toml
cargo build --release --workspaceThe Python bindings are built separately inside bindings/python, with a virtualenv, maturin and patchelf, then a develop install so the module is importable in the current environment.
cd bindings/python/
virtualenv -p python3 venv/
source venv/bin/activate
pip install maturin[patchelf]
maturin developThe IDA plugin follows the same virtualenv shape from the plugins/ida directory, ending with an install command run through the binlex_ida module. Packaged builds are driven from the Makefile, with a zst target for Arch Linux, a deb target for Debian-based systems and a wheel target for the Python wheel, each of which runs the prepare step and then the release build first.
Docker brings up a server, an MCP endpoint and a web interface
The compose file shows the intended service topology, and it is the clearest statement of what this project is becoming. The binlex-server service exposes port 5000 and is configured through a set of environment variables: the config file path, an embeddings setting that defaults to llvm, and variables for processors, processes and the processor directory. It mounts three volumes, for processors, config and local data. The binlex-mcp service listens on port 3000 and takes a base URL that points at the server, plus a samples directory, so an MCP client talks to the extractor over HTTP. The binlex-web service takes a listen address, a port, a URL for itself, a server URL pointing at binlex-server and a corpus setting, which shows the web interface is expected to talk to the processor server rather than doing its own extraction. Starting the stack locally means building the images, while the remote variant pulls published images.
docker compose -f compose.yml -f compose.local.yml up --build -d
docker compose -f compose.yml -f compose.remote.yml up -dConfiguration outside containers lives under a per-platform directory, with a TOML file under the XDG config home or the home config directory on Linux, under Application Support on macOS and under the appdata directory on Windows.
Where the genomics framing earns its keep, and where it does not
The framework is genuinely useful for one thing: answering whether an unfamiliar sample belongs to a family you have already seen. Wildcarded chromosomes and allele pairs give you a representation where a shifted offset or a patched byte does not destroy the comparison, and the YARA generation path turns that representation into a rule a scanner can run. The limits follow from the same choice. Traits describe structure and bytes, not intent. A binary that does the same thing through a different library produces different traits, and a heavily obfuscated or packed sample produces traits that describe the packer rather than the payload. The tooling does not attempt to answer what the program does. Anything requiring semantic analysis, decompilation by a human, or behavioural observation is outside what the framework offers. There is also a release maturity gap worth naming plainly. The recent tags are v2.0.0-rc2 from 2025-01-14, v2.0.0-rc1 from 2024-12-09 and v1.1.1 from 2023-03-04, so the version numbers are release candidates rather than a settled stable line, and the last push to the repository was on 2026-07-01. Code that has to sit in a scanning pipeline should be prepared for interface churn.
Licence and citation terms that are unusual for a security tool
The project is MIT licensed, which is the permissive end and means the code can be used inside commercial tooling without a copyleft obligation on your product. The citation request is the unusual part. If you use Binlex in a journal publication or in an open-source AI model, the README asks you to cite it, and it supplies a BibTeX entry for that purpose. For any other corporate or personal usage, or for generated outputs such as YARA rules, citation is not required. That distinction matters in practice for a security team, because generated YARA rules are exactly the kind of artifact that ends up embedded in a detection platform or shared with other teams, and the terms say those outputs do not require attribution. The repository carries the usual surrounding files, with a CODE_OF_CONDUCT.md, a CONTRIBUTING.md, a SECURITY.md and a CLA.md at the top level, which tells you where to take a vulnerability report and where to propose a change.
Editorial conclusion
Binlex fits a reverse engineering team that already has a large sample corpus and wants structural similarity rather than byte-for-byte comparison, because the wildcarded chromosome model and the YARA generation path are the parts that scale across variants of the same family. It does not fit a workflow that needs to read what a program actually does, since traits describe structure and bytes rather than semantics, and it does not fit a machine without LLVM available to the build, since the toolchain depends on inkwell and llvm-sys. Before adopting it, build the workspace with cargo build --release --workspace, confirm your corpus formats are covered by the PE, ELF and Mach-O support, and check the trait JSON output against the binlex-image and binlex-symbols helpers before you generate any YARA rules from it.
Frequently asked questions
What does Binlex extract from a binary?
It extracts instructions, basic blocks and functions, and emits them as searchable JSON traits for reverse engineering, hunting and similarity workflows. The traits are modelled as genomes, chromosomes, allele pairs and genes.
Which binary formats and architectures does Binlex support?
The supported platforms are Linux, macOS and Windows, and the supported formats are PE, ELF and Mach-O. The listed architectures are AMD64, I386 and CIL.
How do I build Binlex from source?
Run cargo run --manifest-path xtask/Cargo.toml to prepare the build, then cargo build --release --workspace. The Makefile targets for packages and tests depend on that same prepare step.
Can Binlex generate YARA rules?
Yes. The binlex-yara tool generates YARA rules from Binlex-style patterns or streams, and the README states that citation is not required for generated outputs such as YARA rules.
Does Binlex have an IDA plugin and a Python API?
Both are provided. The interfaces listed are a CLI, a Rust API, Python API and bindings, and an IDA plugin, and the plugin is installed from the plugins/ida directory with python -m binlex_ida install.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/c3rb3ru5d3d53c-binlex)Was this useful?