Vector35 / binaryninja-api

Public API, examples, documentation and issues for Binary Ninja
https://binary.ninja/
MIT License
941 stars 213 forks source link
binary-analysis binaryninja decompilation intermediate-representation reverse-engineering reverseengineering software-analysis

slack

Binary Ninja API

This repository contains documentation and source code of the C++, Python, and Rust APIs for the Binary Ninja reverse engineering platform.

Documentation

Online documentation is available for the following APIs:

Usage and Build Instructions

In order to build the Binary Ninja API, you will need to use the specific revision that matches the hash from the file api_REVISION.txt. This file should be located in the root install folder for Linux and Windows or the Contents/Resources sub-folder of the app on macOS. The easiest way to do this is by cloning this repository (or adding it as a submodule) and doing something like git checkout $(cat api_REVISION.txt | awk -F/ '{print $NF}'). Documentation for how to set this up with something like cmake can be found here.

To write Binary Ninja plugins using C++, you'll need to build the C++ API. Building the API library is done similarly to most CMake-based projects; the basic steps are outlined as follows:

# Get the source
git clone https://github.com/Vector35/binaryninja-api.git
cd binaryninja-api
git submodule update --init --recursive

# Configure an out-of-source build setup
cmake -S . -B build # (additional arguments go here if needed)

# Compile
cmake --build build -j8

In addition to the default build setup, you may want to:

Troubleshooting

Examples

There are many examples available. The Python examples folder demonstrates many different applications of the Python API, while C++ examples include:

* Requires license supporting headless API access.

Issues

The issue tracker for this repository tracks not only issues with the source code contained here but also the broader Binary Ninja product.

Branches

This repository has two primary branches dev and master.

The dev branch has the latest updates and tracks the latest development build of Binary Ninja; pull requests should be made against this branch. The master branch tracks the stable build of Binary Ninja. If you have just installed Binary Ninja for the first time, you are likely on the stable release channel.

Contributing

Public contributions are welcome to this repository. Most of the API and documentation in this repository is licensed under an MIT license, however, the API interfaces with a closed-source commercial application, Binary Ninja. Additionally, the Rust API is licensed under a Apache 2.0 license.

If you're interested in contributing when you submit your first PR, you'll receive a notice from CLA Assistant that allows you to sign our Contribution License Agreement online.

Platforms

This repository contains all of our Platform plugins available here:

Architectures

This repository contains all of the Architecture plugins available in Personal and Commercial editions of Binary Ninja. You can find each architecture here:

BinaryViewTypes

This repository contains all of our Binary View Type plugins available here:

DebugInfo

Related Repositories

In addition to this main API repository being open source Vector35 also has open sourced the Debugger and the Objective-C plugins open source as well:

Licensing

Some components may be released under compatible but slightly different open source licenses and will have their own LICENSE file as appropriate.

Remaining components are released under an MIT license.

Note that .lib files are included the native binary builds of Binary Ninja for windows. Those lib files are also released under the same license as this repository and may be distributed accordingly.