Skip to main content
Binary Ninja’s plugin system allows you to extend its capabilities in powerful ways. You can create new architectures, binary format loaders, UI extensions, and workflow modifications.

Plugin types

Architecture plugins

Add support for new CPU architectures

Binary view plugins

Create custom binary format loaders

UI plugins

Extend the Binary Ninja interface

Workflow plugins

Modify the analysis pipeline

Plugin structure

Binary Ninja plugins can be written in Python, C++, or Rust. The basic structure is similar across all languages:
Python plugins are the easiest to create and don’t require compilation.
python_plugin.py
from binaryninja import PluginCommand

def my_plugin_function(bv):
    """Plugin functionality goes here"""
    print(f"Analyzing {bv.file.filename}")
    # Your analysis code

# Register the plugin command
PluginCommand.register(
    "My Plugin\\Do Analysis",
    "Performs custom analysis",
    my_plugin_function
)

Plugin installation

Plugin directories

Binary Ninja loads plugins from platform-specific directories:
~/Library/Application Support/Binary Ninja/plugins/
You can override the plugin directory using the BN_USER_DIRECTORY environment variable.

Installing a plugin

1

Copy your plugin

Copy your plugin file (.py, .so, .dylib, or .dll) to the plugins directory.For Python plugins, you can also copy an entire plugin folder.
2

Restart Binary Ninja

Restart Binary Ninja to load the new plugin.Alternatively, use Tools → Manage Plugins to reload plugins without restarting.
3

Verify installation

Check the plugin log at:
  • View → Log → Plugin in the UI
  • Or ~/.binaryninja/plugins.log

Plugin registration

Plugins must register their functionality with Binary Ninja:

Command plugins

The simplest plugin type adds menu commands:
from binaryninja import PluginCommand

def analyze_strings(bv):
    for string in bv.strings:
        if "password" in string.value.lower():
            print(f"Found password string at {hex(string.start)}")

PluginCommand.register(
    "String Analysis\\Find Passwords",
    "Finds potential password strings",
    analyze_strings
)

Background plugins

For long-running operations, use background tasks:
from binaryninja import BackgroundTaskThread, PluginCommand

class AnalysisTask(BackgroundTaskThread):
    def __init__(self, bv):
        BackgroundTaskThread.__init__(self, "Running analysis", True)
        self.bv = bv

    def run(self):
        # Long-running analysis
        total = len(self.bv.functions)
        for i, func in enumerate(self.bv.functions):
            self.progress = f"Analyzing function {i+1}/{total}"
            # Do work...

def start_analysis(bv):
    task = AnalysisTask(bv)
    task.start()

PluginCommand.register(
    "Background\\Start Analysis",
    "Runs analysis in background",
    start_analysis
)

Plugin configuration

Settings

Plugins can register custom settings:
from binaryninja import Settings

Settings().register_group("myplugin", "My Plugin")
Settings().register_setting(
    "myplugin.enabled",
    '{"title": "Enable Analysis", "type": "boolean", "default": true}'
)

# Access settings
if Settings().get_bool("myplugin.enabled"):
    # Do something
    pass

Metadata

Store plugin-specific data in the binary view:
from binaryninja import Metadata

# Store metadata
bv.store_metadata("myplugin.analysis_results", {"count": 42})

# Retrieve metadata
if bv.query_metadata("myplugin.analysis_results"):
    results = bv.query_metadata("myplugin.analysis_results")

Debugging plugins

Logging

Use Binary Ninja’s logging system:
from binaryninja import log_info, log_warn, log_error

log_info("Plugin initialized")
log_warn("Potential issue detected")
log_error("Failed to analyze function")

Python console

For Python plugins, use the integrated console:
  1. Open View → Console
  2. Test your plugin functions interactively
  3. Access current_view and current_function variables

Debugging tips

Use Tools → Manage Plugins → Reload to reload Python plugins.For C++/Rust plugins, you must restart Binary Ninja.
Verify your plugin’s api_REVISION.txt matches your Binary Ninja installation:
cat "$BN_INSTALL_DIR/api_REVISION.txt"
Set the log level in Edit → Preferences → Settings:
"core.log.minLevel": "DebugLog"

Example plugins

Binary Ninja includes many example plugins in the API repository:
Many production plugins are open source. Search GitHub for binaryninja-plugin to find examples.

Next steps

Architecture plugins

Add CPU architecture support

Binary view plugins

Create format loaders

UI plugins

Extend the interface

Workflow plugins

Modify analysis pipeline

Build docs developers (and LLMs) love