diff options
| author | Jordan Wiens <jordan@psifertex.com> | 2023-05-01 14:16:57 -0400 |
|---|---|---|
| committer | Peter LaFosse <peter@vector35.com> | 2023-05-01 14:24:37 -0400 |
| commit | 5d3e98685591b2521f8dc3151d9a3c36095401b6 (patch) | |
| tree | 192470df14f1d8d3ca65609dd7d300dd6db743b3 /docs/dev | |
| parent | 9aa07762230234bf7222d2b2c19c1fe49ef71d9a (diff) | |
many fixes to missing links in documentation
Diffstat (limited to 'docs/dev')
| -rw-r--r-- | docs/dev/annotation.md | 28 | ||||
| -rw-r--r-- | docs/dev/batch.md | 6 | ||||
| -rw-r--r-- | docs/dev/bnil-llil.md | 2 | ||||
| -rw-r--r-- | docs/dev/cookbook.md | 2 | ||||
| -rw-r--r-- | docs/dev/index.md | 4 | ||||
| -rw-r--r-- | docs/dev/plugins.md | 2 | ||||
| -rw-r--r-- | docs/dev/workflows.md | 5 |
7 files changed, 26 insertions, 23 deletions
diff --git a/docs/dev/annotation.md b/docs/dev/annotation.md index 23433b6f..e7acc7b5 100644 --- a/docs/dev/annotation.md +++ b/docs/dev/annotation.md @@ -1,15 +1,12 @@ -# Annotation +# Applying Annotations -This document is organized into two sections describing how to work with types in Binary Ninja. The [first section](#symbols) is about how to work with Symbols in a binary. - -The [second section](#types) is how to create and interact with types through the API. - -The [third section](#tags) is about how to create tags and bookmarks. - -The [forth section](#type-library) explains how to work with the Type Library. This includes multiple sources of information from which Binary Ninja can automatically source for type information from and how you can add to them. - -Next, the [fifth section](#signature-library) explains how to work with the signature library. While the signature library technically does not directly inform types, it will help automatically match statically compiled functions which are then matched with the type libraries described in the previous section. +This document is organized into five sections describing how to work with types in Binary Ninja: +1. [Symbols](#symbols) covers how to work with Symbols in a binary +1. [Types](#types) is how to create and interact with types through the API +1. [Tags](#tags) is about how to create tags and bookmarks +1. [Type Libraries](#type-libraries) explains how to work with Type Libraries, including multiple sources of information from which Binary Ninja can automatically source for type information from and how you can add to them +1. [Signature Libraries](#signature-library) explains how to work with the signature library which match statically compiled functions which are then matched with type libraries ## Symbols @@ -32,7 +29,7 @@ Other objects or variables may need a [symbol](https://api.binary.ninja/binaryni >>> bv.define_user_symbol(mysym) ``` -Note that `here` and `bv` are used in many of the previous examples. These shortcuts and [several others](./index.md#script-python-console) are only available when running in the Binary Ninja python console and are used here for convenience. +Note that `here` and `bv` are used in many of the previous examples. These shortcuts and [several others](../guide/index.md#script-python-console) are only available when running in the Binary Ninja python console and are used here for convenience. Valid symbol types [include](https://api.binary.ninja/binaryninja.enums.SymbolType.html): @@ -439,7 +436,7 @@ Note that most of the APIs that take a Type object also take a C-style type stri ### Headers -Importing a header goes through the same code path as parsing source directly. You will just have to read the file and specify the appropriate command-line arguments as an array. See [above](#import-header-file) for directions for choosing arguments. +Importing a header goes through the same code path as parsing source directly. You will just have to read the file and specify the appropriate command-line arguments as an array. See [user type guide](../guide/type.md#import-header-file) for directions for choosing arguments. ```python >>> with open('C:\projects\stdafx.h', 'r') as f: @@ -746,11 +743,11 @@ At this moment, there is no built in functionality to apply named objects to an ## Signature Library -While many signatures are [built-in](https://github.com/Vector35/binaryninja-api/issues/1551) and require no interaction to automatically match functions, you may wish to add or modify your own. First, install the [SigKit](https://github.com/Vector35/sigkit/) plugin from the [plugin manager](plugins.md#plugin-manager). +While many signatures are [built-in](https://github.com/Vector35/binaryninja-api/issues/1551) and require no interaction to automatically match functions, you may wish to add or modify your own. First, install the [SigKit](https://github.com/Vector35/sigkit/) plugin from the [plugin manager](../guide/plugins.md#plugin-manager). ### Running the signature matcher -The signature matcher runs automatically by default once analysis completes. You can turn this off in `Settings > Analysis > Autorun Function Signature Matcher` (or, [analysis.signatureMatcher.autorun](settings.md#analysis.signatureMatcher.autorun) in Settings). +The signature matcher runs automatically by default once analysis completes. You can turn this off in `Settings > Analysis > Autorun Function Signature Matcher` (or, [analysis.signatureMatcher.autorun](../guide/settings.md#analysis.signatureMatcher.autorun) in Settings). You can also trigger the signature matcher to run from the menu `Tools > Run Analysis Module > Signature Matcher`. @@ -779,7 +776,8 @@ Binary Ninja loads signature libraries from 2 locations: - [$INSTALL_DIR](https://docs.binary.ninja/guide/#binary-path)/signatures/$PLATFORM - [$USER_DIR](https://docs.binary.ninja/guide/#user-folder)/signatures/$PLATFORM -**WARNING**: Always place your signature libraries in your user directory. The install path is wiped whenever Binary Ninja auto-updates. You can locate it with `Open Plugin Folder` in the command palette and navigate "up" a directory. +???+ Danger "Warning" + Always place your signature libraries in your user directory. The install path is wiped whenever Binary Ninja auto-updates. You can locate it with `Open Plugin Folder` in the command palette and navigate "up" a directory. Inside the signatures folder, each platform has its own folder for its set of signatures. For example, `windows-x86_64` and `linux-ppc32` are two sample platforms. When the signature matcher runs, it uses the signature libraries that are relevant to the current binary's platform. (You can check the platform of any binary you have open in the UI using the console and typing `bv.platform`) diff --git a/docs/dev/batch.md b/docs/dev/batch.md index 841027a6..3b0896a2 100644 --- a/docs/dev/batch.md +++ b/docs/dev/batch.md @@ -6,7 +6,7 @@ This document describes some general tips and tricks for effective batch process ## Install the API -First, make sure to run the [install_api.py](https://github.com/Vector35/binaryninja-api/tree/dev/scripts) script. Note that the script is shipped with Binary Ninja already, just look in your [binary path](../guide/#binary-path) inside of the `scripts` subfolder. Run it like: +First, make sure to run the [install_api.py](https://github.com/Vector35/binaryninja-api/tree/dev/scripts) script. Note that the script is shipped with Binary Ninja already, just look in your [binary path](../guide/index.md#binary-path) inside of the `scripts` subfolder. Run it like: ``` python3 ~/binaryninja/scripts/install_api.py @@ -90,7 +90,7 @@ with open_view("/bin/ls", options={'analysis.limits.maxFunctionSize': 0}) as bv: ### Logging and Exceptions -By default, logging will follow whatever the setting is for [minimum log level]([https://docs.binary.ninja/guide/settings.html#all-settings](https://docs.binary.ninja/guide/settings.html#python.log.minLevel)) (`WarningLog` if not changed). However, for batch-process, it's often convenient to use the [`disable_default_log`](https://api.binary.ninja/index.html#binaryninja.disable_default_log) API to shut off logging entirely. Note that you may still need to handle python exceptions with a "try/except" pattern in the event of malformed files that do not process as expected. +By default, logging will follow whatever the setting is for [minimum log level](../guide/settings.md#python.log.minLevel) (`WarningLog` if not changed). However, for batch-process, it's often convenient to use the [`disable_default_log`](https://api.binary.ninja/index.html#binaryninja.disable_default_log) API to shut off logging entirely. Note that you may still need to handle python exceptions with a "try/except" pattern in the event of malformed files that do not process as expected. ### Further Customization @@ -150,5 +150,5 @@ os.environ["BN_DISABLE_REPOSITORY_PLUGINS"] = "True" import binaryninja ``` -Other alternative solutions include setting the environment variable before running your script, or manually moving your settings file from your [user folder](../getting-started.md#user-folder) before running your automation. +Other alternative solutions include setting the environment variable before running your script, or manually moving your settings file from your [user folder](../guide/index.md#user-folder) before running your automation. diff --git a/docs/dev/bnil-llil.md b/docs/dev/bnil-llil.md index 5d59d3f0..df520e4e 100644 --- a/docs/dev/bnil-llil.md +++ b/docs/dev/bnil-llil.md @@ -36,7 +36,7 @@ Next, enter the following in the console: This will print out all the LLIL instructions in the current function. How does this code work? -First we use the global magic variable `current_function` which gives us the python object [`function.Function`](http://api.binary.ninja/function.Function.html) for whatever function is currently selected in the UI. The variable is only usable from the python console, and shouldn't be used for headless plugins. In a script you can either use the function that was passed in if you [registered your plugin](https://api.binary.ninja/binaryninja.plugin-module.html#binaryninja.plugin.PluginCommand.register_for_function) to handle functions, or you can compute the function based on [a specific address](https://api.binary.ninja/binaryninja.binaryview-module.html?highlight=get_functions_at#binaryninja.binaryview.BinaryView.get_functions_at), or maybe even just iterate over all the functions in a BinaryView (`for func in bv.functions:`). +First we use the global magic variable `current_function` which gives us the python object [`function.Function`](https://api.binary.ninja/binaryninja.function-module.html#binaryninja.function.Function) for whatever function is currently selected in the UI. The variable is only usable from the python console, and shouldn't be used for headless plugins. In a script you can either use the function that was passed in if you [registered your plugin](https://api.binary.ninja/binaryninja.plugin-module.html#binaryninja.plugin.PluginCommand.register_for_function) to handle functions, or you can compute the function based on [a specific address](https://api.binary.ninja/binaryninja.binaryview-module.html?highlight=get_functions_at#binaryninja.binaryview.BinaryView.get_functions_at), or maybe even just iterate over all the functions in a BinaryView (`for func in bv.functions:`). Next we get the [`lowlevelil.LowLevelILFunction`](http://api.binary.ninja/binaryninja.lowlevelil.LowLevelILFunction.html) from the `Function` class: `current_function.low_level_il`. Iterating over the `LowLevelILFunction` class provides access to the [`lowlevelil.LowLevelILBasicBlock`](http://api.binary.ninja/binaryninja.lowlevelil.LowLevelILBasicBlock.html) classes for this function. Inside the loop we can now iterate over the `LowLevelILBasicBlock` class which provides access to the individual [`lowlevelil.LowLevelILInstruction`](http://api.binary.ninja/binaryninja.lowlevelil.LowLevelILInstruction.html) classes. diff --git a/docs/dev/cookbook.md b/docs/dev/cookbook.md index 0a0926a4..61cd6386 100644 --- a/docs/dev/cookbook.md +++ b/docs/dev/cookbook.md @@ -61,7 +61,7 @@ bv.find_next_data(0, b"\x90" * 10) ### Change a function's type signature -Make sure to check out the much more in-depth [type guide](../guide/type.md#using-the-api) as well. +Make sure to check out the much more in-depth [applying annotations](annotation.md) as well. ```python current_function.type = Type.function(Type.void(), []) diff --git a/docs/dev/index.md b/docs/dev/index.md index 983655c2..d9abcde6 100644 --- a/docs/dev/index.md +++ b/docs/dev/index.md @@ -1,6 +1,6 @@ # Using the Binary Ninja API -Welcome to the Binary Ninja API documentation. Much like the [User Manual](./guide/index.html), some larger sections have been split off into their own sections on the left, while the table of contents for this documentation is on the right. +Welcome to the Binary Ninja API documentation. Much like the [User Manual](../guide/index.md), some larger sections have been split off into their own sections on the left, while the table of contents for this documentation is on the right. ## Language Specific Bindings @@ -11,6 +11,8 @@ The Binary Ninja API is available through a [Core API](#core-api), through the [ The Python API is the most common third-party API and is used in many [public plugins](https://github.com/vector35/community-plugins). Here's a list of the most important Python API documentation resources: - [Writing Python Plugins](plugins.md) + - [Applying Annotations](annotation.md) + - [Script Cookbook](cookbook.md) with common examples and concepts explained - [Python API Reference](https://api.binary.ninja/) (available offline via the Help menu) - [API Source](https://github.com/Vector35/binaryninja-api/tree/dev/python) diff --git a/docs/dev/plugins.md b/docs/dev/plugins.md index 3de9f089..7907cd3b 100644 --- a/docs/dev/plugins.md +++ b/docs/dev/plugins.md @@ -32,7 +32,7 @@ Once you've created your test repository, use the `pluginManager.unofficialName` The [`add_repository`](https://api.binary.ninja/binaryninja.pluginmanager-module.html#binaryninja.pluginmanager.RepositoryManager.add_repository) API can also be used to add the repository, though it [may require manual creation of the repository folder](https://github.com/Vector35/binaryninja-api/issues/2987). ### Testing -It's useful to be able to reload your plugin during testing. On the Commercial edition of Binary Ninja, this is easily accomplished with a stand-alone headless install using `import binaryninja` after [installing the API](https://github.com/Vector35/binaryninja-api/blob/dev/scripts/install_api.py). (install_api.py is included in each platforms respective [installation folder](../guide/#binary-path)) +It's useful to be able to reload your plugin during testing. On the Commercial edition of Binary Ninja, this is easily accomplished with a stand-alone headless install using `import binaryninja` after [installing the API](https://github.com/Vector35/binaryninja-api/blob/dev/scripts/install_api.py). (install_api.py is included in each platforms respective [installation folder](../guide/index.md#binary-path)) For other plugins, we recommend the following workflow from the scripting console which enables easy iteration and testing: diff --git a/docs/dev/workflows.md b/docs/dev/workflows.md index 106f7087..72115998 100644 --- a/docs/dev/workflows.md +++ b/docs/dev/workflows.md @@ -21,6 +21,8 @@ This capability is experimental with no guarantees of API stability or future co - [Activity](#activity) - [Workflow](#workflow) - [Analysis Context](#analysis-context) + +<!-- - [Execution Model](#execution-model) - [Activity Description](#activity-description) - [Workflow Description](#workflow-description) @@ -28,6 +30,7 @@ This capability is experimental with no guarantees of API stability or future co - [Strategies](#strategies) - [Core Analysis Descriptions](#core-analysis-descriptions) - [Extended Analysis Descriptions](#extended-analysis-descriptions) +--> --- # What Is Workflows @@ -173,4 +176,4 @@ The Analysis Context provides access to the current analysis hierarchy along wit # Extended Analysis Descriptions --- ---- >
\ No newline at end of file +--- > |
