Skip to main content

Python-Binexport

python-binexport is a python module aiming to give a friendly interface to load and manipulate binexport files.

What is binexport ?

Binexport is a protobuf format used by Bindiff to extract IDA database and to process them outside. It gives a very optimizated (in size) representation of the program.

Dependencies

Python-binexport can load any .BinExport files generated from the supported disassemblers IDA, Ghidra and Binary Ninja.

However to perform the export with binexporter or from the API ProgramBinexport.from_binary_file() the IDA plugin must be installed as it is the only supported at the moment. For that it has to be installed first from the github page. To use the feature python-binexport requires IDA >=7.2 (as it calls the BinExportBinary IDC function).

[!WARNING] If you export files from python-binexport make sure the IDA Pro binexport plugin is properly installed and works when running it manually before trying to use it from the python library (it can hang if not properly installed).

[!NOTE] The possibility to export files using Ghidra, or Binary Ninja from python-binexport might be supported in the future.

Installation

pip install python-binexport

Python module usage

The main intended usage of python-binexport is as a python module. The main entry point is the class ProgramBinExport which triggers the loading of the whole file. Here is a snippet to iterate on every expression of every instruction in the program:

from binexport import ProgramBinExport

p = ProgramBinExport("myprogram.BinExport")
for fun_addr, fun in p.items():
    with fun:  # Preload all the basic blocks
        for bb_addr, bb in fun.items():
            for inst_addr, inst in bb.instructions.items():
                for operand in inst.operands:
                    for exp in operand.expressions:
                        pass  # Do whatever at such deep level

Obviously ProgramBinExport, FunctionBinExport, InstructionBinExport and OperandBinExport all provides various attributes and method to get their type, and multiple other infos.

If the module idascript is installed you can directly generate a BinExport file using the Program.from_binary_file static method.

Command line usage

The executable script binexporter provides a very basic utility to export a BinExport file straight from the command line (without having to launch IDA etc..). This is basically a wrapper for Program.from_binary_file.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_binexport-0.4.5.tar.gz (23.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_binexport-0.4.5-py3-none-any.whl (26.7 kB view details)

Uploaded Python 3

File details

Details for the file python_binexport-0.4.5.tar.gz.

File metadata

  • Download URL: python_binexport-0.4.5.tar.gz
  • Upload date:
  • Size: 23.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for python_binexport-0.4.5.tar.gz
Algorithm Hash digest
SHA256 31a7aa000a192219b236f109e69cda61cda6aa42732f52af977f33caebb4fc6d
MD5 f407e2ba2e483d782ba47d17dd9199f4
BLAKE2b-256 2ee2bd40804fb2859352e3e0a85835fa89e0f2eb6a8a4cf0ebae30928a68f284

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_binexport-0.4.5.tar.gz:

Publisher: release.yml on quarkslab/python-binexport

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file python_binexport-0.4.5-py3-none-any.whl.

File metadata

File hashes

Hashes for python_binexport-0.4.5-py3-none-any.whl
Algorithm Hash digest
SHA256 ff998c61bcbd4e6582145a8e1a6825f8e25f2565d9bc0656e200bcf23711e181
MD5 0475df82c1f59fa25afba0221573bfcc
BLAKE2b-256 5cd9494dfbdd07cd87cfd98581c9b1c0ec7d666225150826b484fa0b430bef93

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_binexport-0.4.5-py3-none-any.whl:

Publisher: release.yml on quarkslab/python-binexport

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.4.5 This release

2 files

0.4.4

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.7

2 files

0.3.6

2 files

0.3.5

2 files

0.3.4

2 files

0.3.3

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.1

2 files

0.2.0

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page