summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJordan Wiens <jordan@psifertex.com>2021-08-17 11:41:50 -0400
committerJordan Wiens <jordan@psifertex.com>2021-08-17 11:41:50 -0400
commit401b73b242bc9447bd12215b17ea8ce215c7d6ed (patch)
tree58307b57c435d48e17f0b382cf26beb4bde601b4 /docs
parent6312556eede2d80978f7f77ce8757f5290d5a900 (diff)
add more general API documentation and numerous other documentation improvements
Diffstat (limited to 'docs')
-rw-r--r--docs/dev/api.md42
-rw-r--r--docs/dev/plugins.md44
-rw-r--r--docs/guide/plugins.md6
-rw-r--r--docs/index.md7
4 files changed, 75 insertions, 24 deletions
diff --git a/docs/dev/api.md b/docs/dev/api.md
index e69de29b..1009bb82 100644
--- a/docs/dev/api.md
+++ b/docs/dev/api.md
@@ -0,0 +1,42 @@
+# Using the Binary Ninja API
+
+## Language Specific Bindings
+
+The Binary Ninja API is available through a [Core API](#core-api), through the [C++ API](#c-api), through a [Python API](#python-api), and a [Rust API](#rust-api).
+
+
+### Core API
+
+The Core API is designed to only be used as a shim from other languages and is not currently intended to be used to build C plugins directly.
+
+ - [Header](https://github.com/Vector35/binaryninja-api/blob/dev/binaryninjacore.h) (used by all other bindings)
+
+### C++ API
+
+The C++ API is what the Binary Ninja UI itself is built using so it's a robust and fully feature-complete interface to the core, however, it does not have the same level of detail in the documentation.
+
+ - [C++ Header](https://github.com/Vector35/binaryninja-api/blob/dev/binaryninjaapi.h) (along with the rest of the [repository](https://github.com/Vector35/binaryninja-api)
+ - [Build Instructions](https://github.com/Vector35/binaryninja-api#building)
+ - [C++ / UI API Documentation](https://api.binary.ninja/cpp/)
+
+
+### Python API
+
+The most heavily documented of all of the APIs, the Python API serves as a useful documentation for the other APIs. Here's a list of the most important Python API documentation resources:
+
+ - [Writing Python Plugins](plugins.md)
+ - [Python API](https://api.binary.ninja/)
+ - [API Source](https://github.com/Vector35/binaryninja-api/tree/dev/python)
+
+### Rust API
+
+The Rust API is still experimental and lacks complete coverage for all core APIs. Instructions on using are available in:
+
+ - [Rust API](https://github.com/Vector35/binaryninja-api/tree/dev/rust)
+
+
+## UI Elements
+
+There are several ways to create UI elements in Binary Ninja. The first is to use the simplified [interaction](https://api.binary.ninja/binaryninja.interaction-module.html) API which lets you make simple UI elements for use in GUI plugins in Binary Ninja. As an added bonus, they all have fallbacks that will work in headless console-based applications as well. Plugins that use these API include the [angr](https://github.com/Vector35/binaryninja-api/blob/dev/python/examples/angr_plugin.py) and [nampa](https://github.com/kenoph/nampa) plugins.
+
+The second and more powerful (but more complicated) mechanism is to leverage the _binaryninjaui_ module. Additional documentation is forthcoming, but there are several examples ([1](https://github.com/Vector35/binaryninja-api/tree/dev/python/examples/kaitai), [2](https://github.com/Vector35/binaryninja-api/tree/dev/python/examples/snippets), [3](https://github.com/Vector35/binaryninja-api/tree/dev/python/examples/triage)), and most of the APIs are backed by the [documented C++ headers](https://api.binary.ninja/cpp). Additionally, the generated _binaryninjaui_ module is shipped with each build of binaryninja and the usual python `dir()` instructions are helpful for exploring its capabilities.
diff --git a/docs/dev/plugins.md b/docs/dev/plugins.md
index 26a32c15..ee0b9433 100644
--- a/docs/dev/plugins.md
+++ b/docs/dev/plugins.md
@@ -1,4 +1,6 @@
-## Writing Plugins
+# Writing Python Plugins
+
+## Creating the Plugin
First, take a look at some of the [example](https://github.com/Vector35/binaryninja-api/tree/dev/python/examples) plugins, or some of the [community](https://github.com/Vector35/community-plugins) plugins to get a feel for different APIs you might be interested in. Of course, the full [API](https://api.binary.ninja/) docs are online and available offline via the `Help`/`Open Python API Reference...`.
@@ -7,16 +9,16 @@ To start, we suggest you download the [sample plugin](https://github.com/Vector3
- Begin by editing the `plugin.json` file
- Next, update the `LICENSE`
- For small scripts, you can include all the code inside of `__init__.py`, though we recommend for most larger scripts that init just act as an initializer and call 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.
-## Plugin Debugging Mode
-
-Available via [settings](../getting-started.md#ui.debugMode), enabling plugin debugging mode will enable additional IL types via the UI.
+## Submitting to the Plugin Manager
-## UI Elements
+If your plugin was created as described above, there's only two steps to get it submitted to the plugin manager!
-There are several ways to create UI elements in Binary Ninja. The first is to use the simplified [interaction](https://api.binary.ninja/binaryninja.interaction-module.html) API which lets you make simple UI elements for use in GUI plugins in Binary Ninja. As an added bonus, they all have fallbacks that will work in headless console-based applications as well. Plugins that use these API include the [angr](https://github.com/Vector35/binaryninja-api/blob/dev/python/examples/angr_plugin.py) and [nampa](https://github.com/kenoph/nampa) plugins.
+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.
-The second and more powerful (but more complicated) mechanism is to leverage the _binaryninjaui_ module. Additional documentation is forthcoming, but there are several examples ([1](https://github.com/Vector35/binaryninja-api/tree/dev/python/examples/kaitai), [2](https://github.com/Vector35/binaryninja-api/tree/dev/python/examples/snippets), [3](https://github.com/Vector35/binaryninja-api/tree/dev/python/examples/triage)), and most of the APIs are backed by the [documented C++ headers](https://api.binary.ninja/cpp). Additionally, the generated _binaryninjaui_ module is shipped with each build of binaryninja and the usual python `dir()` instructions are helpful for exploring its capabilities.
+For future releases all you need to do is increment the version and create a new release.
## Testing
@@ -37,18 +39,22 @@ Then just `[UP] [ENTER]` to trigger the reload when the plugin has changed.
If you wish to debug your python scripts, there are a few methods:
### Remote debugging with VSCode:
+
1. In VSCode, open the Run and Debug sidebar.
-2. Create a `launch.json` file if one does not already exist, or open `launch.json` if one does.
-3. In `launch.json`, select Add Configuration > Python > Remote Attach
-4. Enter a host of `localhost` and any port
-5. Set the path mapping to be from `/` to `/` (Windows: `C:\\` to `C:\\`)
-6. Open Binary Ninja
-7. Use `connect_vscode_debugger(port=12345)` in the Python Console, using whichever port you selected in `launch.json`.
-8. In VSCode, start debugging. You should see the bottom toolbar change color, and the debugger should be attached.
+1. Create a `launch.json` file if one does not already exist, or open `launch.json` if one does.
+1. In `launch.json`, select Add Configuration > Python > Remote Attach
+1. Enter a host of `localhost` and any port
+1. Set the path mapping to be from `/` to `/` (Windows: `C:\\` to `C:\\`)
+1. Open Binary Ninja
+1. Use `connect_vscode_debugger(port=12345)` in the Python Console, using whichever port you selected in `launch.json`.
+1. In VSCode, start debugging. You should see the bottom toolbar change color, and the debugger should be attached.
+
+### Remote debugging with IntelliJ PyCharm
+
+**WARNING**: Does not work on PyCharm Community, requires PyCharm Professional
-### Remote debugging with IntelliJ PyCharm Professional **(Does not work on PyCharm Community)**:
1. In PyCharm, add a Run Configuration for Python Debug Server. Give it a name and choose a port and host.
-2. Run the `pip install` script displayed in the Run Configuration using whichever python interpreter you have selected for Binary Ninja.
-3. In PyCharm, start debugging. You should see "Waiting for process connection..." in the Debugger panel.
-4. Open Binary Ninja
-5. Use `connect_pycharm_debugger(port=12345)` in the Python Console, using whichever port you selected in the Run Configuration. You should now see "Connected" in the PyCharm Debugger panel.
+1. Run the `pip install` script displayed in the Run Configuration using whichever python interpreter you have selected for Binary Ninja.
+1. In PyCharm, start debugging. You should see "Waiting for process connection..." in the Debugger panel.
+1. Open Binary Ninja
+1. Use `connect_pycharm_debugger(port=12345)` in the Python Console, using whichever port you selected in the Run Configuration. You should now see "Connected" in the PyCharm Debugger panel.
diff --git a/docs/guide/plugins.md b/docs/guide/plugins.md
index 7b21f2cc..d7e8c0ef 100644
--- a/docs/guide/plugins.md
+++ b/docs/guide/plugins.md
@@ -61,7 +61,7 @@ after cloning or else the submodules will not actually be downloaded.
### Installing via the API
-Binary Ninja now offers a [PluginManager API] which can simplify the process of finding and installing plugins. From the console:
+Binary Ninja now offers a [PluginManager API](https://api.binary.ninja/binaryninja.pluginmanager-module.html) which can simplify the process of finding and installing plugins. From the console:
``` text
>>> mgr = RepositoryManager()
@@ -86,7 +86,7 @@ Then just restart and your plugin will be loaded.
### Installing Prerequisites
-Binary Ninja can now automatically install pip requirements for python plugins when the plugin was installed using the plugin manager. If the plugin author has included a `reuirements.txt` file, the plugin manager will automatically install those dependencies.
+Binary Ninja can now automatically install pip requirements for python plugins when the plugin was installed using the plugin manager. If the plugin author has included a `requirements.txt` file, the plugin manager will automatically install those dependencies.
Because Windows and MacOS ship with an embedded version of Python, if you want to install plugins inside that Python, we recommend instead installing an official [python.org](https://www.python.org/downloads/windows/) (NOTE: ensure you do not accidentally install a 32-bit build) version, or a [homebrew](https://docs.brew.sh/Homebrew-and-Python) Python 3.x build.
@@ -111,4 +111,4 @@ Additionally, running a python plugin with an environment variable of `BN_DISABL
## Writing Plugins
-See the [developer documentation](../dev/plugins.md) for documentation on creating plugins. \ No newline at end of file
+See the [developer documentation](../dev/api.md) for documentation on creating plugins.
diff --git a/docs/index.md b/docs/index.md
index 473d7290..6bcf6fb3 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -4,6 +4,9 @@ A new kind of reverse engineering platform
---
-[Binary Ninja] is a reverse engineering platform. It focuses on a clean and easy to use interface with a powerful multithreaded analysis built on a custom IL to quickly adapt to a variety of architectures, platforms, and compilers.
+[Binary Ninja](https://binary.ninja/) is a reverse engineering platform. It focuses on a clean and easy to use interface with a powerful multithreaded analysis built on a custom IL to quickly adapt to a variety of architectures, platforms, and compilers.
-[Binary Ninja]: https://binary.ninja/
+The most common starting points for documentation are:
+
+- [Getting Started Guide](getting-started.md)
+- [API documentation](dev/api.md) (depending on your language of choice)