diff options
| author | Jordan Wiens <github@psifertex.com> | 2026-05-27 14:55:28 -0400 |
|---|---|---|
| committer | Jordan Wiens <github@psifertex.com> | 2026-05-27 14:55:28 -0400 |
| commit | 162b406ea28aa5bacc34a00745d8780bcbf58753 (patch) | |
| tree | 39802866489bd352c54599024e24ee346b44cd35 /docs/guide | |
| parent | f2ae12d97604da6136b26c184eb7fe30531b4d5e (diff) | |
add better syntax highlighting for code blocks
Diffstat (limited to 'docs/guide')
| -rw-r--r-- | docs/guide/efiresolver.md | 2 | ||||
| -rw-r--r-- | docs/guide/index.md | 6 | ||||
| -rw-r--r-- | docs/guide/plugins.md | 2 | ||||
| -rw-r--r-- | docs/guide/troubleshooting.md | 8 | ||||
| -rw-r--r-- | docs/guide/types/platformtypes.md | 6 | ||||
| -rw-r--r-- | docs/guide/types/typeimportexport.md | 118 | ||||
| -rw-r--r-- | docs/guide/types/typelibraries.md | 6 |
7 files changed, 84 insertions, 64 deletions
diff --git a/docs/guide/efiresolver.md b/docs/guide/efiresolver.md index a11545eb..ad3867ed 100644 --- a/docs/guide/efiresolver.md +++ b/docs/guide/efiresolver.md @@ -44,7 +44,7 @@ steps: 2. Define a GUID in the following format: - ``` + ```json { "EFI_EXAMPLE_CUSTOM_PROTOCOL_GUID": [ 19088743, 35243, 52719, diff --git a/docs/guide/index.md b/docs/guide/index.md index 058e4e91..bb51f690 100644 --- a/docs/guide/index.md +++ b/docs/guide/index.md @@ -1087,8 +1087,10 @@ The interactive python prompt also has several built-in "magic" functions and va The python interpreter can be customized to run scripts on startup using `startup.py` in your user folder. Simply enter commands into that file, and they will be executed every time Binary Ninja starts. By default, it comes with an import helper: - # Commands in this file will be run in the interactive python console on startup - from binaryninja import * +```python +# Commands in this file will be run in the interactive python console on startup +from binaryninja import * +``` From here, you can add any custom functions or objects you want to be available in the console. If you want to restore the original copy of `startup.py` at any time, simply delete the file and restart Binary Ninja. A fresh copy of the above will be generated. diff --git a/docs/guide/plugins.md b/docs/guide/plugins.md index a064f967..57a8d8b6 100644 --- a/docs/guide/plugins.md +++ b/docs/guide/plugins.md @@ -95,7 +95,7 @@ Binary Ninja ships with an embedded version of Python on Windows and macOS. On L You may also wish to use your own custom interpreter which you can set with the [python.interpreter setting](settings.md#python.interpreter) to point to the appropriate install location. Note that the file being pointed to should be a `.dll`, `.dylib`, or `.so` though homebrew will often install libraries without any extension. For example: -``` +```bash $ file /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/Python /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/Python: Mach-O 64-bit dynamically linked shared library x86_64 ``` diff --git a/docs/guide/troubleshooting.md b/docs/guide/troubleshooting.md index 70cb6b5c..954ddf5f 100644 --- a/docs/guide/troubleshooting.md +++ b/docs/guide/troubleshooting.md @@ -128,7 +128,7 @@ You may also manually create a `settings.json` file in your [user folder](./inde macOS Ventura enables more in-depth code signing verification that can cause issues with Binary Ninja when migrating between versions. If you receive a warning that `“Binary Ninja.app” is damaged and can’t be opened. You should move it to the Trash.`, it is likely that you have merely upgraded from an older version of Binary Ninja and older files in the application bundle are impacting code signing. The simplest fix is to simply request a [new download bundle](https://binary.ninja/recover/), drag the old bundle to the trash and drag the new bundle in place. Alternatively, if your bandwidth is low or you do not have an active license, you can try manually removing extra folders. In case you are migrating from 3.1.3439 to 3.2.3811, that would be: -``` +```bash rm -rf /Applications/Binary\ Ninja.app/Contents/Frameworks/Python.framework/Versions/3.9/ ``` @@ -142,7 +142,7 @@ Below are a few of the most common problems with Linux installations: - Some unzip utilities do not maintain the `+x` executable bit on files when extracted. To fix this, we recommend: - ``` + ```text chmod +x binaryninja/*.so.* chmod +x binaryninja/plugins/* ``` @@ -172,7 +172,7 @@ If you have installed Binary Ninja into a path outside your home folder such as Ubuntu 22.04 and newer ship Firefox as a snap that is confined by AppArmor. The confinement blocks `snap.firefox.firefox` from reading arbitrary system paths outside the user's home directory, so paths such as `/opt/binaryninja/docs` are inaccessible. Binary Ninja's local help viewer fails under these conditions because Firefox cannot open the documentation files it launches from `/opt/binaryninja/`, and `dmesg` will show `apparmor="DENIED"` entries similar to: -``` +```text apparmor="DENIED" operation="open" profile="snap.firefox.firefox" name="/opt/binaryninja/docs/index.html" requested_mask="r" denied_mask="r" ``` @@ -275,7 +275,7 @@ With the addition of [projects](../guide/projects.md) and [type archives](../gui 1. Update to a version with support for the new extensions (builds 4860 or newer) 1. Run: -``` +```text /System/Library/Frameworks/CoreServices.framework/Versions/Current/Frameworks/LaunchServices.framework/Versions/Current/Support/lsregister -f -R -trusted "/Applications/Binary Ninja.app" ``` diff --git a/docs/guide/types/platformtypes.md b/docs/guide/types/platformtypes.md index cf1b8fc4..93e5f0f4 100644 --- a/docs/guide/types/platformtypes.md +++ b/docs/guide/types/platformtypes.md @@ -7,13 +7,13 @@ Binary Ninja pulls type information from a variety of sources. The highest-level Platform types are used to define types that should be available to all programs available on that particular platform. They are only for global common types. Consider, for example, that you might want to add the following on Windows: -``` +```c typedef uint8_t u8; ``` You could write this type into: -``` +```text /home/user/.binaryninja/types/platform/windows-x86.c ``` @@ -30,7 +30,7 @@ The base path for these files is in your [user folder](../index.md#user-folder) For example, something like: -``` +```bash $ pwd /home/user/.binaryninja/types/platform $ cat windows-x86.c diff --git a/docs/guide/types/typeimportexport.md b/docs/guide/types/typeimportexport.md index c245deef..775e0064 100644 --- a/docs/guide/types/typeimportexport.md +++ b/docs/guide/types/typeimportexport.md @@ -57,51 +57,61 @@ Since you need to specify the include paths for system headers, you will need to On these systems, you can run a command to print the default search path for compilation: - gcc -Wp,-v -E - - clang -Wp,-v -E - +```bash +gcc -Wp,-v -E - +clang -Wp,-v -E - +``` For the directories printed by this command, you should include them with `-isystem<path>` in the order specified. For example on macOS, with Xcode 13: - $ clang -Wp,-v -E - - clang -cc1 version 13.0.0 (clang-1300.0.29.3) default target arm64-apple-darwin21.6.0 - ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/local/include" - ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Library/Frameworks" - #include "..." search starts here: - #include <...> search starts here: - /usr/local/include - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/13.0.0/include - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks (framework directory) - End of search list. +```text +$ clang -Wp,-v -E - +clang -cc1 version 13.0.0 (clang-1300.0.29.3) default target arm64-apple-darwin21.6.0 +ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/local/include" +ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Library/Frameworks" +#include "..." search starts here: +#include <...> search starts here: + /usr/local/include + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/13.0.0/include + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks (framework directory) +End of search list. +``` From this example, the flags would be: (note: not including the framework directory line) - -isystem/usr/local/include - -isystem/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/13.0.0/include - -isystem/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include - -isystem/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include +```text +-isystem/usr/local/include +-isystem/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/13.0.0/include +-isystem/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include +-isystem/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include +``` Another example on Arch Linux: - $ gcc -Wp,-v -E - - ignoring nonexistent directory "/usr/lib/gcc/x86_64-pc-linux-gnu/12.2.0/../../../../../../../../x86_64-pc-linux-gnu/include" - #include "..." search starts here: - #include <...> search starts here: - /usr/lib/gcc/x86_64-pc-linux-gnu/12.2.0/include - /usr/local/include - /usr/lib/gcc/x86_64-pc-linux-gnu/12.2.0/include-fixed - /usr/include - End of search list. +```text +$ gcc -Wp,-v -E - +ignoring nonexistent directory "/usr/lib/gcc/x86_64-pc-linux-gnu/12.2.0/../../../../../../../../x86_64-pc-linux-gnu/include" +#include "..." search starts here: +#include <...> search starts here: + /usr/lib/gcc/x86_64-pc-linux-gnu/12.2.0/include + /usr/local/include + /usr/lib/gcc/x86_64-pc-linux-gnu/12.2.0/include-fixed + /usr/include +End of search list. +``` From this example, the flags would be: - -isystem/usr/lib/gcc/x86_64-pc-linux-gnu/12.2.0/include - -isystem/usr/local/include - -isystem/usr/lib/gcc/x86_64-pc-linux-gnu/12.2.0/include-fixed - -isystem/usr/include +```text +-isystem/usr/lib/gcc/x86_64-pc-linux-gnu/12.2.0/include +-isystem/usr/local/include +-isystem/usr/lib/gcc/x86_64-pc-linux-gnu/12.2.0/include-fixed +-isystem/usr/include +``` ##### For Windows @@ -109,29 +119,35 @@ For windows, there's no easy command to list all the include paths, so you have You will end up with something like the following for user mode: - -x c -std=c99 - -isystem"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29333\include" - -isystem"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt" - -isystem"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared" - -isystem"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um" +```text +-x c -std=c99 +-isystem"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29333\include" +-isystem"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt" +-isystem"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared" +-isystem"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um" +``` Or, for kernel mode: - -x c -std=c99 - -isystem"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29333\include" - -isystem"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt" - -isystem"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared" - -isystem"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\km" +```text +-x c -std=c99 +-isystem"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29333\include" +-isystem"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt" +-isystem"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared" +-isystem"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\km" +``` Note that some header files might require manually including a specific `windows.h` header which necessitates specifying a target platform to get the appropriate includes: - --target=x86_64-pc-windows-msvc - -x c -std=c99 - -include"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\windows.h" - -isystem"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29333\include" - -isystem"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt" - -isystem"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared" - -isystem"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um" +```text +--target=x86_64-pc-windows-msvc +-x c -std=c99 +-include"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\windows.h" +-isystem"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29333\include" +-isystem"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt" +-isystem"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared" +-isystem"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um" +``` ##### Cross-Platform Targets @@ -151,13 +167,13 @@ Binary Ninja pulls type information from a variety of sources. The highest-level Platform types are used to define types that should be available to all programs available on that particular platform. They are only for global common types. Consider, for example, that you might want to add the following on Windows: -``` +```c typedef uint8_t u8; ``` You could write this type into: -``` +```text /home/user/.binaryninja/types/platform/windows-x86.c ``` @@ -172,7 +188,7 @@ You may wish to provide types that are common across multiple architectures or p For example, something like: -``` +```bash $ pwd /home/user/.binaryninja/types/platform $ cat windows-x86.c diff --git a/docs/guide/types/typelibraries.md b/docs/guide/types/typelibraries.md index 5848cc8e..8dfece4d 100644 --- a/docs/guide/types/typelibraries.md +++ b/docs/guide/types/typelibraries.md @@ -32,8 +32,10 @@ Type Libraries contain details about a specific library that is imported by bina Type Libraries are named after the source library they are providing types for. When a binary is opened, Binary Ninja finds all of its linked library dependencies, and looks up Type Libraries for them. Those with a File Name or Alternative Name matching the exact text of a library used by the binary will be imported into the analysis. You can see this process in the Log: - elf: searching for 'libc.so.6' in type libraries - Type library 'libc.so.6' imported +```text +elf: searching for 'libc.so.6' in type libraries +Type library 'libc.so.6' imported +``` The [Developer Guide](../../dev/typelibraries.md) contains more details about the implementation details of the Type Library format. |
