Coder Social home page Coder Social logo

vector35 / binaryninja-api Goto Github PK

View Code? Open in Web Editor NEW
871.0 45.0 195.0 66.72 MB

Public API, examples, documentation and issues for Binary Ninja

Home Page: https://binary.ninja/

License: MIT License

C++ 53.06% C 20.15% Python 16.03% JavaScript 0.08% Makefile 0.04% Batchfile 0.04% CSS 1.04% Shell 0.03% CMake 0.28% HTML 0.12% Rust 9.14%
binaryninja reverseengineering decompilation binary-analysis reverse-engineering software-analysis intermediate-representation

binaryninja-api's Introduction

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.7.2 (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:

  • background_task is a plugin that demonstrates managing a background task.*
  • 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. 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 our Architecture plugins available 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.

binaryninja-api's People

Contributors

0cyn avatar bpotchik avatar chinmaydd avatar couleeapps avatar d0ntpanic avatar emesare avatar fabianfreyer avatar fuzyll avatar galenbwill avatar jeffli678 avatar jonpalmisc avatar joshwatson avatar kylemiles avatar lucasduffey avatar lwerdna avatar mkrasnitski avatar negasora avatar njfox avatar plafosse avatar psifertex avatar rbran avatar river-li avatar rollsafe avatar rose4096 avatar rssor avatar verylazyguy avatar withzombies avatar xusheng6 avatar yrp604 avatar zznop avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

binaryninja-api's Issues

detect 64-bit python on windows

From @psifertex on September 1, 2015 21:42

Make sure the install python API menu option detects whether 64bit python is installed and error accordingly

Copied from original issue: Vector35/binaryninja#48

Console log

From @D0ntPanic on May 15, 2015 19:17

Errors and warnings already go to a console log internally, but a UI should be created to show these to the user.

Copied from original issue: Vector35/binaryninja#30

Associate .bndb files with Binary Ninja

From @D0ntPanic on September 22, 2015 2:51

Need to associate the database files with the application so that it will open the application and the database automatically when clicked in Finder/Explorer

Copied from original issue: Vector35/binaryninja#50

IDC import

Create a module to import IDC files to allow migration of structures/symbols from an existing project.

Jump table detection

Automatically identify jump tables and create destination procedures at valid functions

copy/paste/transform gui

From @psifertex on May 5, 2015 13:56

Copy/paste/transform is already in gui, just needs the functionality written along with the few modal dialogs

Copied from original issue: Vector35/binaryninja#10

visual cleanup of hex view

From @psifertex on May 5, 2015 14:20

Either adding color every 4/8 bytes (could also include an option for Jordan's gray-scale color adjustment based on byte value), or extra dividers / etc

Copied from original issue: Vector35/binaryninja#22

python shell

From @psifertex on May 5, 2015 13:57

Just like binaryninja-python

Copied from original issue: Vector35/binaryninja#11

Memory view permissions

From @psifertex on May 5, 2015 14:20

In the ELF/MACH-O/PE loaded memory view, integrate memory access permissions

Copied from original issue: Vector35/binaryninja#21

Hex Templates

From @psifertex on May 5, 2015 14:9

Definitely post-v1, gonna be a killer feature though.

Copied from original issue: Vector35/binaryninja#16

Cross-platform name demangling

From @D0ntPanic on May 18, 2015 21:41

Currently, Linux/Mac C++ symbols can only be demangled on Linux/Mac, and Windows C++ symbols can only be demangled on Windows.

Copied from original issue: Vector35/binaryninja#33

Dialogs can be hidden under tooltips

From @D0ntPanic on August 5, 2015 1:48

When a function preview tooltip is active when hovering over a function name, and you hit N to rename the function, the function name dialog can be hidden behind the tooltip. The tooltips should go away when interacting with the main window or when opening dialogs.

Copied from original issue: Vector35/binaryninja#41

Save contents as defaults to database path

From @D0ntPanic on August 5, 2015 5:56

When using the "save contents as" menu option after opening an existing database file, the file save dialog defaults to the path to the database itself. Overwriting the database with the binary contents is an easy thing to do from there. The path should default to something like the base name (without extension) so that an accidental overwrite is unlikely.

Copied from original issue: Vector35/binaryninja#42

smart patching (right/click patching)

Ability to appropriately resize or find 'dead' space, insert jumps, copy existing code, integrate patches with existing relative offsets and symbols and then add new functionality to patch on the fly.

Needs support for:

  • Mach-o
  • ELF
  • PE

internationalization

From @psifertex on May 29, 2015 20:49

we should support it -- QT has methods for it, can just use those.

Copied from original issue: Vector35/binaryninja#37

implement wrapping in the function list

From @psifertex on August 27, 2015 17:9

Long function names force the main disassembly window to take over the entire window (open up a long demangled name in gamelogic.dll to reproduce)

Copied from original issue: Vector35/binaryninja#46

plugin reloading

When developing a plugin, support reloading the plugin without restarting the entire program

about dialog

Need to add an about dialog:

  • Binary Ninja license info
  • Other open source products listed with
  • Version / build info

Crash if window is closed while popup menu is open

From @D0ntPanic on May 18, 2015 6:33

  1. Open any popup menu (the highlight menu and right click menu in the disassembly were tried)
  2. On a Mac, used Cmd+W to close the current window while the popup menu is still showing

This crashes because the parent of the menu is deleted while it is still visible.

Copied from original issue: Vector35/binaryninja#32

go relative offset

From @psifertex on July 31, 2015 1:30

Feature request: allow for relative "g" by pre-pending a + or - to the go dialog

Copied from original issue: Vector35/binaryninja#40

install updates from cache directory upon restart

Curren OS X and Linux installers will update live, they should instead update into a cache directory that is then checked on restart so that using python live won't result in being overwritten in-place.

Support kernel disassembly

From @D0ntPanic on May 20, 2015 3:25

Instructions such as in, out, hlt, etc. are currently marked as instructions that end disassembly to prevent unnecessarily large disassembly graphs when ROP gadget hunting or in anti-disassembly code. A kernel disassembly mode should be available when disassembling code that is meant to be run in kernel mode, as these instructions are allowed and expected there.

Copied from original issue: Vector35/binaryninja#34

hotkey to switch tabs

From @psifertex on October 22, 2015 8:20

CMD-Shift [ and ] or maybe CTL-PAGE UP / PAGE DOWN (or maybe both) should switch tabs similar to browsers.

Muscle memory for the win.

Copied from original issue: Vector35/binaryninja#52

calling convention / ABI

Calling convention ABI support required for better static type / dataflow through function calls.

Constant annotation cross references

From @D0ntPanic on August 19, 2015 22:24

Constants that were loaded from memory or loaded with multiple instructions should be added as cross references. This would allow string and constant pool references in ARM to have proper cross references throughout the binary.

Copied from original issue: Vector35/binaryninja#45

Elf object files

From @D0ntPanic on May 26, 2015 5:13

Should add support for disassembling .o files. On Linux they are ELF files, and Binary Ninja recognizes them as such. However, as they have no load program headers, the ELF file appears empty. Should allow disassembly of the functions inside of it.

This probably should be considered lower priority.

Copied from original issue: Vector35/binaryninja#35

collapse memory views

From @psifertex on May 5, 2015 21:21

For large sections of unused memory in the loaded module, collapse them down to not take up so much room.

Copied from original issue: Vector35/binaryninja#28

MACH-O support

From @psifertex on May 5, 2015 14:9

Maybe better for v1? Listing as post-v1 for now as we really should try for a quick release

Copied from original issue: Vector35/binaryninja#15

SCC: Initializer list support

From @plafosse on July 21, 2015 17:51

Support for initializing arrays and struct's with initializer lists

eg
int x[2] = {1, 2};

Copied from original issue: Vector35/scc#5

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.