Python Bindiff
python-bindiff is a python module aiming to give a friendly interface to launch
and manipulate bindiff between two binary iles.
How it works ?
The module relies on python-binexport
to extract programs .BinExport and then directly interact with the binary differ
(of zynamics) to perform the diff. The generated diff file is then correlated
with the two binaries to be able to navigate the changes.
Installation
The python module requires Bindiff. Thus first refers to Zynamics installation directives.
Then the python module can be installed with:
pip install python-bindiff
The python module needs to execute the differ executable. As such it should be available:
- either in the path
- or via the
BINDIFF_PATHenvironment variable
Usage as a python module
The simplest way to get the programs, already exported with BinExport, diffed, is:
from bindiff import BinDiff
diff = BinDiff.from_binary_files("sample1.exe", "sample2.exe", "out.BinDiff")
# or performing the diff on BinExport files
diff = BinDiff.from_binexport_files("sample1.BinExport", "sample2.BinExport", "out.BinDiff")
To load the diffing results of an existing diff.BinDiff file, do:
from bindiff import BinDiff
diff = BinDiff("sample1.BinExport", "sample2.BinExport", "diff.BinDiff")
print(diff.similarity, diff.confidence)
# do whatever you want with diff.primary, diff.secondary which are the
# two Program object
But programs can be instanciated separately:
from binexport import ProgramBinExport
from bindiff import BinDiff
p1 = ProgramBinExport("sample1.BinExport")
p2 = ProgramBinExport("sample2.BinExport")
diff = BinDiff(p1, p2, "diff.BinDiff")
Note that all the diff data are embedded inside program objects thus
after instanciating BinDiff those p1 and p2 are modified.
From the API it is also possible to directly perform the BinExport extraction and the diffing:
Usage as a command line
The bindiffer command line allows to generate a diff file from the two
.BinExport files or directly from the binaries (thanks to python-binexport and
idascript). The help message is the following:
Usage: bindiffer [OPTIONS] <primary file|dir> <secondary file|dir>
bindiffer is a very simple utility to diff two binary files using BinDiff in command line. The two input files can be either binary files (in which
case IDA is used) or directly .BinExport file (solely BinDiff is used). It also accept two directories two diff each files based on their names
Options:
-d, --disassembler [ida|ghidra|binary_ninja]
Disassembler to use
--disass-path TEXT Path of the disassembler (dir or binary for IDA, dir for Ghidra)(if not provided search $PATH or environment
variable IDA_PATH, GHIDRA_PATH)
-t, --threads INTEGER Thread number to use
--timeout INTEGER Per-file export timeout in seconds (if not set, no timeout is enforced)
-b, --bindiff-path PATH BinDiff differ directory
--stop-on-error Stop on error
-o, --output PATH Output BinDiff file, or directory for batch
--override Override existing output files (includes .BinExport files)
-bw, --bindiff-workspace PATH Create a BinDiff Workspace database
-h, --help Show this message and exit.
To work bindiff differ binary should be in the $PATH, given via
the BINDIFF_PATH environment variable or with the -b command option.
Similarly when diff binaries directly the ida64 binary should be available
in the $PATH, given with the IDA_PATH environment variable or via the
-i command option.
Metadata
Release files for python-bindiff 0.4.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 |
|---|---|---|---|---|
| python_bindiff-0.4.2.tar.gz | 22.3 kB | With provenance | Details for python_bindiff-0.4.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| python_bindiff-0.4.2-py3-none-any.whl | Python 3 | none | any | Details for python_bindiff-0.4.2-py3-none-any.whl |
Total release size: 45.5 kB
Release files / python_bindiff-0.4.2.tar.gz
| Download URL | python_bindiff-0.4.2.tar.gz |
|---|---|
| Size | 22.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
92139b3d9b4aa7648e145fc0ed5c303d10d1279254bb29b24ed826a9540d6b61
|
|
BLAKE2b-256 checksum How to use checksums |
8b5618aff907d131b0bf59ec515640aea7d4a77e6c5e353e5b605c2a60a23d0b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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 Jul 24, 2026.
Transparency logRelease files / python_bindiff-0.4.2-py3-none-any.whl
| Download URL | python_bindiff-0.4.2-py3-none-any.whl |
|---|---|
| Size | 23.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9e311d74efc80174fc7357ee968ded7f58d360805b8bbdfa293b1efa4154095d
|
|
BLAKE2b-256 checksum How to use checksums |
4145ec496ae548df9d014ad3bd1e9988bdfca328b461e41e7c7d664af04d73f3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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 Jul 24, 2026.
Transparency logSecurity for python-bindiff 0.4.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 python_bindiff-0.4.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 Jul 24, 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.