Skip to main content

Find and install Binary Ninja's Python API

Project description

binaryninja-finder

Automatically finds and adds Binary Ninja's Python API to sys.path at interpreter startup.

Installation

pip install git+https://github.com/trailofbits/binaryninja-finder

Or with uv:

uv add git+https://github.com/trailofbits/binaryninja-finder

Once installed, import binaryninja will work in any script or REPL that uses the same Python environment.

How it works

The package installs a .pth file that runs automatically when Python starts. It checks whether binaryninja is already importable and, if not, searches for a local Binary Ninja installation and adds its python/ directory to sys.path.

The search order is:

  1. BN_INSTALL_DIR environment variable — points to the BN installation root
  2. lastrun file — in the BN user config directory (written by Binary Ninja on launch)
  3. Common platform paths — e.g. /Applications/Binary Ninja.app on macOS, /opt/binaryninja on Linux, C:\Program Files\Vector35\BinaryNinja on Windows

Configuration

Environment variable Description
BN_INSTALL_DIR Override the Binary Ninja installation directory
BN_USER_DIRECTORY Override the Binary Ninja user config directory (where lastrun is stored)

License

See LICENSE for details.

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

binaryninja_finder-0.2.0.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

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

binaryninja_finder-0.2.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file binaryninja_finder-0.2.0.tar.gz.

File metadata

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

File hashes

Hashes for binaryninja_finder-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4c52262a4950ab54c743f9a8968190e97c036154fd1d9dfdd4c82c4b81ad7164
MD5 0981f6cb7823a6db7a8074f7b92f9bad
BLAKE2b-256 3a5d810a2d0cae7d029235a351ab5f9ea61458c5ca4197c37159f773d6c747ff

See more details on using hashes here.

Provenance

The following attestation bundles were made for binaryninja_finder-0.2.0.tar.gz:

Publisher: release.yml on trailofbits/binaryninja-finder

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

File details

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

File metadata

File hashes

Hashes for binaryninja_finder-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f5c8f27a707e42982ac12afc96dc4ebf9d5f916d596bdb3efc3e017c9c375275
MD5 dcc6c27edc4f7bac15895b0d801cc45b
BLAKE2b-256 d7f4a22bb803acfb07771b468133437b7d47309013a110f53289f0749ff6a5b3

See more details on using hashes here.

Provenance

The following attestation bundles were made for binaryninja_finder-0.2.0-py3-none-any.whl:

Publisher: release.yml on trailofbits/binaryninja-finder

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

Supported by

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