Skip to main content

Python wrapper to manipulate binexport files (protobuf)

Reason this release was yanked:

Broken release

Project description

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():
    for bb_addr, bb in fun.items():
        for inst_addr, inst in bb.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.

Project details


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.2.0.tar.gz (20.2 kB view details)

Uploaded Source

Built Distribution

python_binexport-0.2.0-py3-none-any.whl (23.2 kB view details)

Uploaded Python 3

File details

Details for the file python-binexport-0.2.0.tar.gz.

File metadata

  • Download URL: python-binexport-0.2.0.tar.gz
  • Upload date:
  • Size: 20.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.6

File hashes

Hashes for python-binexport-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7024256661e3e4fbac321cd9e9de345ce8a693d9c177632e5066d6320b8944cb
MD5 f1c1b1adbffee11b88f3086885ac00df
BLAKE2b-256 2f524e63ef5c50cf0ed573c78870fb3f8c3223333bc3e69147d556b6a91f0d58

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for python_binexport-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 23b7ed6829b4b18a393f3898de51ab87edf9d6fdcd3f54029ad0ba141fb9d8f2
MD5 cb5313ea6a7a995f458d479c12a0a6d2
BLAKE2b-256 a6f5d64d0dd2bb639747561665ffe5f6a49708c7707106310d96b92e2afa0a0e

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page