Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 23 additions & 6 deletions docs/dev/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,35 @@ To start, we suggest you download the [sample plugin](https://github.com/Vector3
- For small scripts, you can include all the code inside `__init__.py`, though we recommend for larger scripts that `__init__.py` just act as an initializer and calls into functions organized appropriately in other files.
- If you have python dependencies, create a [requirements.txt](https://pip.pypa.io/en/latest/cli/pip_freeze/) listing any python dependencies.

### Submitting to the Plugin Manager
### Plugin Description Display

If your plugin was created as described above, there's only two steps to get it submitted to the plugin manager!
Binary Ninja displays plugin descriptions differently depending on the contents of the `plugin.json` file.

- If `longdescription` exists **and is longer than 100 characters**, the Extension Manager displays the `longdescription`.
- If `longdescription` is missing, or is **100 characters or fewer**, the Extension Manager instead displays the contents of the plugin repository's `README.md`.

### Images in README Files

When you include images for preview in the Extension Manager, be aware that animated gifs are not fully supported. They will be rendered as static images of the first frame.

Additionally, all images should be included using FULL GitHub URLs as they will not render in the Extension Manager without that.

For example:

![](https://raw.githubusercontent.com/Vector35/6502/refs/heads/master/media/nes.png)

### Submitting to the Extension Manager

If your plugin was created as described above, there's only two steps to get it submitted to the Extension Manager!

1. First, create a release either [manually](https://binary.ninja/2019/07/04/plugin-manager-2.0.html#5-create-a-release) or using our [release helper](https://github.com/Vector35/release_helper).
1. Next, just [file an issue](https://github.com/Vector35/community-plugins/issues/new/choose) letting us know about your plugin.
2. Next, just [file an issue](https://github.com/Vector35/community-plugins/issues/new/choose) letting us know about your plugin.

For future releases all you need to do is increment the version and create a new release.

### Using Your Own Plugin Repository

The simplest way to run your own plugin repository using the new V2 plugin manager is to use the [mock server](https://github.com/Vector35/binaryninja-api/blob/dev/python/examples/mock_extension_server.py) helper script (a copy is available offline as well in the install path, in the python exapmle scripts subfolder).
The simplest way to run your own plugin repository using the new Extension Manager is to use the [mock server](https://github.com/Vector35/binaryninja-api/blob/dev/python/examples/mock_extension_server.py) helper script (a copy is available offline as well in the install path, in the python exapmle scripts subfolder).

Once you've created your test repository, use the `pluginManager.unofficialName` and `pluginManager.unofficialUrl` settings to add your third-party repository.

Expand Down Expand Up @@ -381,9 +398,9 @@ There are a few other options you can use to assist in debugging:
As a footnote, it should be noted that most of the team at Vector 35 use VSCode as a bare text editor
and use command-line lldb or gdb to debug their code. Shout-outs to people trying to get this working in Vim.

## Submitting to the plugin manager
## Submitting to the Extension Manager

While native plugins are not fully supported in the plugin manager at this time, it's possible to work around this limitation by pre-building a native plugin for all three platforms and using a python plugin that acts as a loader for the native plugin. Additionally, you can submit a plugin as "view_only" which helps with discoverability.
While native plugins are not fully supported in the Extension Manager at this time, it's possible to work around this limitation by pre-building a native plugin for all three platforms and using a python plugin that acts as a loader for the native plugin. Additionally, you can submit a plugin as "view_only" which helps with discoverability.

## Examples

Expand Down
193 changes: 93 additions & 100 deletions docs/guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ The contents of the user folder includes:
- `lastrun`: A text file containing the directory of the last Binary Ninja binary path -- very useful for plugins to resolve the installation locations in non-default settings or on Linux
- `license.dat`: License file
- `plugins/`: Folder containing all manually installed user plugins
- `repositories/`: Folder containing files and plugins managed by the [Plugin Manager API](https://api.binary.ninja/binaryninja.pluginmanager-module.html)
- `repositories/`: Folder containing files and plugins managed by the [Extension Manager API](https://api.binary.ninja/binaryninja.pluginmanager-module.html)
- `settings.json`: User settings file (see [settings](settings.md))

The following files and folders may be created in the user folder but are not created by default without some additional action:

- `keybindings.json`: Custom key bindings (see [key bindings](#custom-hotkeys))
- `startup.py`: Default Python commands run once the UI is loaded in the context of the scripting console
- `signatures/`: Any user-created signatures can be stored in platform-specific sub-folders in this location
- `pythonVER/`: Any pip dependencies from plugin manager plugins are installed to the appropriate Python version subfolder such as `python310`, or `python311`
- `pythonVER/`: Any pip dependencies from Extension Manager plugins are installed to the appropriate Python version subfolder such as `python310`, or `python311`
- `symbols/`: Used to store automatically downloaded PDBs
- `update/`: Used to store update caches for pending updates
- `snippets/`: Used to store snippets created using the official Snippet plugin
Expand Down Expand Up @@ -243,13 +243,13 @@ The status of currently installed plugins will be displayed in the bottom right.

![plugin status ><](../img/plugin-status-widget.png "Plugin Status Widget"){ width="400" }

Pressing each of the icons will navigate you to the Plugin Manager with the corresponding filter:
Pressing each of the icons will navigate you to the Extension Manager with the corresponding filter:

- Green Circle: `@installed`
- Error Symbol: `@failed_to_load`
- Update Icon: `@update_available`

Pressing the gear or using the hotkeys (macOS: `[CMD+SHIFT] + M`, Windows/Linux: `[CTRL+SHIFT] + M`) will open the plugin manager with no filters, so you can browse available plugins.
Pressing the gear or using the hotkeys (macOS: `[CMD+SHIFT] + M`, Windows/Linux: `[CTRL+SHIFT] + M`) will open the Extension Manager with no filters, so you can browse available plugins.

### Commercial/Ultimate Features

Expand Down Expand Up @@ -662,68 +662,6 @@ To search in the keybindings list, just click to make sure it's focused and star
- `[CTRL-SHIFT] -` (Windows/Linux) : Graph view zoom out
- Other hotkeys specifically for working with types are listed in the [type guide](types/type.md#direct-ui-manipulation)

## Graph View

![graph view](../img/graphview.png "Graph View"){ width="800" }

Binary Ninja offers a graph view that groups the basic blocks of disassembly into visually distinct blocks with edges showing control flow between them.

Features of the graph view include:

- Ability to double-click edges to quickly jump between locations
- Zoom (CTRL-mouse wheel)
- Zoom to Fit - Zooms out until the whole graph is visible (`w`)
- Zoom to Cursor - Zooms to 100% at the position of the cursor (`z`)
- Vertical Scrolling (Side scroll bar as well as mouse wheel)
- Horizontal Scrolling (Bottom scroll bar as well as SHIFT-mouse wheel)
- Individual highlighting of arguments, addresses, immediate values, types, etc.
- Full type signature of current function shown in an interactive header:
- Selecting elements in the header highlights them in the graph view
- Change type (`y`) and Rename (`n`) shortcuts work on elements in the header
- Reanalyze function button on left edge of the header
- Edge colors indicate whether the path is the true (green) or false (red) case of a conditional jump (a color-blind option in the preferences is useful for those with red-green color blindness) and blue for unconditional branches
- Context menu that can trigger some function-wide actions as well as some specific to the highlighted instruction (such as inverting branch logic or replacing a specific function with a NOP)

## View Options

![options >](../img/options.png "View options"){ width="400" }

Each of the views (Hex, Graph, Linear) have a variety of options configurable from the ☰ menu on the top right of the view pane.

Current options include:

- Hex (and Linear View where hex values are shown)
- Background highlight
- None
- Column
- Byte value
- Color highlight
- None
- ASCII and printable
- Modification
- Contrast
- Normal
- Medium
- Highlight
- Graph & Linear Views
- Expand Long Opcode
- Indent HLIL Function Body (HLIL only)
- Show Address
- Show Call Parameter Names (MLIL/HLIL only)
- Show Function Address
- Show Opcode Bytes
- Show Register Set Highlighting
- Show Type Casts (`[SHIFT+CMD/CTRL] + C`)
- Show Variable Types
- At Assignment (MLIL graph only)
- At Top of Function
- Single Function View
- Advanced
- Show All Expression Types (MLIL/HLIL only)
- Show IL Flag Usage (Lifted IL only)
- Show IL Opcodes
- Show Stack Pointer Value (LLIL only)

## Triage Summary

![triage summary](../img/triagesummary.png "Triage Summary"){ width="800" }
Expand Down Expand Up @@ -805,17 +743,95 @@ clickable to navigate to the virtual address.
Strings can be double-clicked to navigate to them, and the table can be sorted or the list filtered by
typing in the search box.

## Byte Overview
## View Options

![byte overview](../img/byteoverview.png "Byte Overview"){ width="800" }
![options >](../img/options.png "View options"){ width="400" }

The Byte Overview (or "Bytes" when selected in the view switcher) shows the binary (mapped or raw, depending on the
top-level selection) as a [Code Page 437](https://en.wikipedia.org/wiki/Code_page_437) view. This view is commonly used
by malware analysis researchers using the [Hiew](http://hiew.ru) tool.
Each of the views (Hex, Graph, Linear) have a variety of options configurable from the ☰ menu on the top right of the view pane.

Current options include:

- Hex (and Linear View where hex values are shown)
- Background highlight
- None
- Column
- Byte value
- Color highlight
- None
- ASCII and printable
- Modification
- Contrast
- Normal
- Medium
- Highlight
- Graph & Linear Views
- Expand Long Opcode
- Indent HLIL Function Body (HLIL only)
- Show Address
- Show Call Parameter Names (MLIL/HLIL only)
- Show Function Address
- Show Opcode Bytes
- Show Register Set Highlighting
- Show Type Casts (`[SHIFT+CMD/CTRL] + C`)
- Show Variable Types
- At Assignment (MLIL graph only)
- At Top of Function
- Single Function View
- Advanced
- Show All Expression Types (MLIL/HLIL only)
- Show IL Flag Usage (Lifted IL only)
- Show IL Opcodes
- Show Stack Pointer Value (LLIL only)

## Linear View

![linear](../img/linear.png "Linear View"){ width="1000" }

Linear view is a hybrid view between a graph-based disassembly window and the raw hex view. It lists the entire binary's memory in a linear fashion and is especially useful when trying to find sections of a binary that were not properly identified as code or even just examining data.

Linear view is commonly used for identifying and adding type information for unknown data. To this end, as you scroll, you'll see data and code interspersed. Much like the graph view, you can turn on and off addresses via the command palette `Show Address` or the ☰ menu on the top right of the linear view pane. Many other [options](#view-options) are also available.

### High Level IL

![HLIL Scoping Options >](../img/hlil-scope.png "HLIL Scoping Options"){ width="400" }

Binary Ninja features a decompiler that produces High Level IL (HLIL) as output. HLIL is not intended to be a representation of the code in C, but some users prefer to have a more C-like scoping style.

You can control the way HLIL appears in the settings.

The different options are shown below:

![HLIL Scoping Display](../img/hlil-braces.png "HLIL Scoping Display"){ width="500" }

### Pseudo C

![Pseudo C](../img/pseudo-c.png "Pseudo C View"){ width="800" }

Binary Ninja offers an option to render the HLIL as a decompilation to "Pseudo C". This decompilation is intended to be more familiar to the user than the HLIL. It is not necessarily intended to be "compliant" C or even recompilable. In some cases, it may be possible to edit it into a form that a C compiler will accept, but the amount of effort required will vary widely, and no guarantee is made that it will be possible in all cases.


## Graph View

![graph view](../img/graphview.png "Graph View"){ width="800" }

Binary Ninja offers a graph view that groups the basic blocks of disassembly into visually distinct blocks with edges showing control flow between them.

Features of the graph view include:

- Ability to double-click edges to quickly jump between locations
- Zoom (CTRL-mouse wheel)
- Zoom to Fit - Zooms out until the whole graph is visible (`w`)
- Zoom to Cursor - Zooms to 100% at the position of the cursor (`z`)
- Vertical Scrolling (Side scroll bar as well as mouse wheel)
- Horizontal Scrolling (Bottom scroll bar as well as SHIFT-mouse wheel)
- Individual highlighting of arguments, addresses, immediate values, types, etc.
- Full type signature of current function shown in an interactive header:
- Selecting elements in the header highlights them in the graph view
- Change type (`y`) and Rename (`n`) shortcuts work on elements in the header
- Reanalyze function button on left edge of the header
- Edge colors indicate whether the path is the true (green) or false (red) case of a conditional jump (a color-blind option in the preferences is useful for those with red-green color blindness) and blue for unconditional branches
- Context menu that can trigger some function-wide actions as well as some specific to the highlighted instruction (such as inverting branch logic or replacing a specific function with a NOP)

While this view is less feature-rich than the Hex view, it allows for a much higher information density as every byte is
represented by one character as opposed to four total characters when in Hex view (including the space between hex
digits and the ASCII representation).

## Hex View

Expand All @@ -827,17 +843,11 @@ The hex view is particularly good for transforming data in various ways via the

If you're using the hex view for a Binary View like ELF, Mach-O or PE, you probably want to make sure you're also in the `Raw` view if you want to see the file as it exists on disk in hex view.


### Live Preview

Any changes made in the Hex view will take effect immediately in any other views open into the same file (new views can be created via the `Split to new tab`, or `Split to new window` options under `View`, or via [splitting panes](#tiling-panes)). This can, however, cause large amounts of re-analysis so be warned before making large edits or transformations in a large binary file.

## Linear View

![linear](../img/linear.png "Linear View"){ width="1000" }

Linear view is a hybrid view between a graph-based disassembly window and the raw hex view. It lists the entire binary's memory in a linear fashion and is especially useful when trying to find sections of a binary that were not properly identified as code or even just examining data.

Linear view is commonly used for identifying and adding type information for unknown data. To this end, as you scroll, you'll see data and code interspersed. Much like the graph view, you can turn on and off addresses via the command palette `Show Address` or the ☰ menu on the top right of the linear view pane. Many other [options](#view-options) are also available.

## Edit Function Properties Dialog

Expand Down Expand Up @@ -903,23 +913,6 @@ This element is a table containing a row for each register stack (e.g. x87) in t

This dropdown selects the [function-level workflow](https://docs.binary.ninja/dev/workflows.html#workflow) which is used to analyze this function.

## High Level IL

![HLIL Scoping Options >](../img/hlil-scope.png "HLIL Scoping Options"){ width="400" }

Binary Ninja features a decompiler that produces High Level IL (HLIL) as output. HLIL is not intended to be a representation of the code in C, but some users prefer to have a more C-like scoping style.

You can control the way HLIL appears in the settings.

The different options are shown below:

![HLIL Scoping Display](../img/hlil-braces.png "HLIL Scoping Display"){ width="500" }

## Pseudo C

![Pseudo C](../img/pseudo-c.png "Pseudo C View"){ width="800" }

Binary Ninja offers an option to render the HLIL as a decompilation to "Pseudo C". This decompilation is intended to be more familiar to the user than the HLIL. It is not necessarily intended to be "compliant" C or even recompilable. In some cases, it may be possible to edit it into a form that a C compiler will accept, but the amount of effort required will vary widely, and no guarantee is made that it will be possible in all cases.

## Dead Store Elimination

Expand Down Expand Up @@ -1126,9 +1119,9 @@ See the [plugin development guide](../dev/plugins.md#debugging-using-other-ides)

## Using Plugins

Plugins can be installed by one of two methods. First, they can be installed via the Plugin Manager accessed via the `Plugins` / `Manage Plugins` menu or `[CMD/CTRL] m` hotkey.
Plugins can be installed by one of two methods. First, they can be installed via the Extension Manager accessed via the `Plugins` / `Manage Plugins` menu or `[CMD/CTRL] m` hotkey.

![plugin manager](../img/plugin-manager.png "Plugin Manager"){ width="1000" }
![Extension Manager](../img/plugin-manager.png "Extension Manager"){ width="1000" }

Second, they can be manually installed by adding the plugin (either a `.py` file or a folder implementing a Python module with a `__init__.py` file) to the appropriate path:

Expand Down
Loading