• Stars
    star
    888
  • Rank 51,046 (Top 2 %)
  • Language
    C++
  • License
    MIT License
  • Created almost 9 years ago
  • Updated 21 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Public API, examples, documentation and issues for Binary Ninja

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:

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.

Usage and Build Instructions

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:

  • Build examples. To build the API examples, pass -DBN_API_BUILD_EXAMPLES=ON to CMake when configuring the build. After the build succeeds, you can install the built plugins by running the install target. When using the "Unix Makefiles" build generator, this looks like: make install.
  • Build UI plugins. You will need Qt 6.4.3 (as of writing) installed to build UI plugins.
  • Build headlessly. If you are using a headless Binary Ninja distribution or you do not wish to build UI plugins, pass -DHEADLESS=ON to CMake when configuring the build.

Troubleshooting

  • If Binary Ninja is installed at a different location than the platform default (defined in CMakeLists.txt), you will likely get an error stating "Binary Ninja Core Not Found." Specify the path to your Binary Ninja installation with by passing -DBN_INSTALL_DIR=/path/to/binaryninja to CMake when configuring the build setup.
  • Since Binary Ninja is a 64-bit only product, ensure that you are using a 64-bit compiling and linking environment. Errors on Windows like LNK1107 might indicate that your bits don't match.

Examples

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

  • bin-info is a standalone executable that prints some information about a given binary to the terminal.*
  • breakpoint is a plugin that allows you to select a region within an x86 binary and use the context menu to fill it with breakpoint bytes.
  • command-line disassm demonstrates how to dump disassembly to the command line.*
  • llil-parser parses Low-Level IL, demonstrating how to match types and use a visitor class.*
  • mlil-parser parses Medium-Level IL, demonstrating how to match types and use a visitor class.*
  • print_syscalls is a standalone executable that prints the syscalls used in a given binary.*
  • triage is a fully featured plugin that is shipped and enabled by default, demonstrating how to do a wide variety of tasks including extending the UI through QT.
  • workflows is a collection of plugins that demonstrate using Workflows to extend the analysis pipeline.
  • x86 extension creates an architecture extension which shows how to modify the behavior of the build-in architectures without creating a complete replacement.

* 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.

Contributing

Public contributions are welcome to this repository. All 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.

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:

Related Repositories

In addition to this main API repository being open source Vector35 also has open sourced Architecture, BinaryView and Debugger plugins open source as well:

Architectures

BinaryViewTypes

Debugger

Licensing

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

More Repositories

1

deprecated-binaryninja-python

Deprecated Binary Ninja prototype written in Python
Python
518
star
2

community-plugins

Repository for community provided Binary Ninja plugins
Python
425
star
3

PwnAdventureZ

NES zombie survival game made to be hacked
HTML
250
star
4

debugger

Binary Ninja debugger
C++
197
star
5

deprecated_python_debugger

Binary Ninja Debugger Plugin
Python
141
star
6

arch-arm64

Aarch64 architecture plugin
C
83
star
7

asmx86

C++
67
star
8

OpaquePredicatePatcher

Python
62
star
9

sigkit

Function signature matching and signature generation plugin for Binary Ninja
Python
56
star
10

community-themes

Community provided themes for the reverse engineering tool Binary Ninja
Python
47
star
11

official-plugins

Repository for officially supported Binary Ninja plugins
Python
46
star
12

tanto

Tantล slices functions into more consumable chunks
Python
45
star
13

llil_transpiler

transpile llil to c++ for execution and testing
C++
41
star
14

arch-armv7

ARMv7 architecture plugin
C++
39
star
15

arch-x86

x86/x64 architecture plugin
C++
38
star
16

kaitai

UI plugin integrating Kaitai Struct (kaitai.io) in Binja
Python
37
star
17

idb-import-plugin

IDA Database Importer plugin for Binary Ninja
Rust
37
star
18

generate_assembler

generate assemblers from disassemblers, 2018 jailbreak security summit talk
C++
37
star
19

efi-resolver

A Binary Ninja plugin that automatically resolves type information for EFI protocol usage.
Python
34
star
20

HackingGames

Hacking Games in a Hacked Game
JavaScript
29
star
21

function_detection_test_suite

suite of binaries used to test function identification
28
star
22

BinaryNinjaImporter

Python
26
star
23

idb-parser-rs

IDA Database Parser for Rust
Rust
25
star
24

dwarf_import

This loads DWARF info from an open binary and propagates function names, arguments, and type info
Python
24
star
25

shuriken16

Retro Game Engine inspired by the SNES-era
C++
24
star
26

snippets

plugin for storing and using snippets of useful Binja script
Python
22
star
27

view-macho

Mach-O view plugin
C++
20
star
28

sample_plugin

Sample Binary Ninja Plugin
Python
18
star
29

defcon2015-livectf

Challenges from the DEF CON 2015 Finals Live CTF
C
14
star
30

binaryninja-cloud-public

Home for issues on Binary Ninja Cloud
13
star
31

csaw-2019-pwny-race

Challenges from CSAW 2019 Pwn Race Edition
C
12
star
32

arch-mips

MIPS architecture plugin
C++
9
star
33

arch-ppc

Open source PPC architecture, utilizing capstone as a disassembler.
C++
9
star
34

AlgoProphet

Python
8
star
35

Z80

Z80 Architecture and BinaryViews for Z80 Files
Python
8
star
36

unpacme

Binary Ninja Plugins to work with Unpac.Me unpacking service
Python
7
star
37

view-pe

PE/COFF view plugin
C++
7
star
38

view-elf

ELF view plugin
C++
7
star
39

supermonsterball

CSAW 2016 Finals challenge
C
5
star
40

qt-build

Custom Qt patches and build scripts
Python
5
star
41

traceapi

JavaScript
5
star
42

6502

architecture plugin for 6502 and binary view for NES roms
Python
5
star
43

release_helper

simple utility to help with updating Binary Ninja plugins
Python
4
star
44

NOPcert-2017

NOP Certification Challenges from Infiltrate 2017
C
4
star
45

idb-rs

IDB parser
Rust
4
star
46

Sidekick-public

3
star
47

COMpanion

A plugin for helping to reverse engineer Microsoft COM
Python
3
star
48

agdq

branch of pwnadventurez for agdq
Assembly
2
star
49

platform-freebsd

FreeBSD platform plugin
C++
2
star
50

sample_plugin_cpp

Sample Binary Ninja Plugin in C++ with GitHub Actions CI
CMake
2
star
51

qemu-decree

qemu with user-mode DECREE emulation
C
1
star
52

ppc_disassembler

disassembler for powerpc and its variants
C
1
star
53

platform-mac

macOS platform plugin
C++
1
star
54

platform-linux

Linux platform plugin
C++
1
star
55

qt-artifacts

The build artifacts of the qt-build
1
star
56

lldb-artifacts

The build artifacts of the llvm-build
1
star
57

platform-windows

Windows platform plugin
C++
1
star
58

dbgsrv

A Windows debug server based on DbgEng
C++
1
star