diff options
| author | Jordan Wiens <jordan@psifertex.com> | 2020-05-19 11:23:00 -0400 |
|---|---|---|
| committer | Jordan Wiens <jordan@psifertex.com> | 2020-05-19 11:23:28 -0400 |
| commit | 9e20ebaac658add3878ed7d070a1ef6d4a5927a7 (patch) | |
| tree | 768482ccff831ca444ba980d7a26cd931096ab7a /docs/guide | |
| parent | f4a6890da148a51d8f0aaa3790dd25cdc00bd4db (diff) | |
fix syntax highlighting and add css files for offline highlighting to prevent windows help docs delay
Diffstat (limited to 'docs/guide')
| -rw-r--r-- | docs/guide/plugins.md | 8 | ||||
| -rw-r--r-- | docs/guide/troubleshooting.md | 22 | ||||
| -rw-r--r-- | docs/guide/type.md | 38 |
3 files changed, 34 insertions, 34 deletions
diff --git a/docs/guide/plugins.md b/docs/guide/plugins.md index ba7bed02..aa46dfb4 100644 --- a/docs/guide/plugins.md +++ b/docs/guide/plugins.md @@ -57,7 +57,7 @@ You can manually install a plugin either by adding a folder which contains it (t Note, if manually cloning the [api repository](https://github.com/Vector35/binaryninja-api), make sure to: -``` +``` text git submodule update --init --recursive ``` @@ -67,7 +67,7 @@ after cloning or else the submodules will not actually be downloaded. Binary Ninja now offers a [PluginManager API] which can simplify the process of finding and installing plugins. From the console: -``` +``` text >>> mgr = RepositoryManager() >>> dir(mgr) ['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'add_repository', 'check_for_updates', 'default_repository', 'handle', 'plugins', 'repositories'] @@ -92,7 +92,7 @@ Then just restart, and your plugin will be loaded. Because Windows ships with an embedded version of Python, if you want to install plugins inside that Python, you'll need to either adjust your `sys.path` to include the locations for the other libraries (making sure they're compatible with the built-in version), or else install them directly in the environment via: -``` +``` py import pip pip.main(['install', '--quiet', 'packagename']) ``` @@ -105,7 +105,7 @@ Binary Ninja can also switch to a different installed version of Python using th Troubleshooting many Binary Ninja problems is helped by enabling debug logs and logging the output to a file. Just launch Binary Ninja with -``` +``` text /Applications/Binary\ Ninja.app/Contents/MacOS/binaryninja -d -l /tmp/bnlog.txt ``` diff --git a/docs/guide/troubleshooting.md b/docs/guide/troubleshooting.md index eddb8300..c30de2ea 100644 --- a/docs/guide/troubleshooting.md +++ b/docs/guide/troubleshooting.md @@ -10,13 +10,13 @@ ## Bug Reproduction Running Binary Ninja with debug logging will make your bug report more useful. -``` +``` bash ./binaryninja --debug --stderr-log ``` Alternatively, it might be easier to save debug logs to a file instead: -``` +``` bash ./binaryninja -d -l logfile.txt ``` @@ -69,7 +69,7 @@ If you're using Windows virtual machines within virtualbox, you may have trouble You may also manually create a `settings.json` file in your [user folder](../getting-started.md#user-folder) with the contents though using the [plugin manager](plugins.md#plugin-manager) may also have problems: -``` +``` js { "updates" : { @@ -87,7 +87,7 @@ If you're running Catlina MacOS with the Python 3 installed by XCode and wish to 1. Set the PYTHONHOME environment variable for your user to the following: `PYTHONHOME=/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7` 1. If you have an existing `settings.json` in `~/Library/Application Support/Binary Ninja/` merge the below, or create it with these contents if it does not exist: -``` +``` js { "downloadClient" : { @@ -104,7 +104,7 @@ If you're running Catlina MacOS with the Python 3 installed by XCode and wish to While OS X is generally the most trouble-free environment for Binary Ninja, very old versions may have problems with the RPATH for our binaries and libraries. There are two solutions. First, run Binary Ninja with: -``` +``` bash DYLD_LIBRARY_PATH="/Applications/Binary Ninja.app/Contents/MacOS" /Applications/Binary\ Ninja.app/Contents/MacOS/binaryninja ``` @@ -114,13 +114,13 @@ Or second, modify the binary itself using the [install_name_tool](https://blogs. One potential issue for installed Python 3.x versions on MacOS is that the bundled certificates do not align with the native certificate store. This results in an erorr while attempting to download updates using the python provider. One of the following may fix this: -``` +``` bash pip install --upgrade certifi ``` or: -``` +``` bash open /Applications/Python\ 3.6/Install\ Certificates.command ``` @@ -132,7 +132,7 @@ Given the diversity of Linux distributions, some work-arounds are required to ru Debian requires one package be manually installed to support the emoji icons used in the Tag system: -``` +``` bash apt install fonts-noto-color-emoji ``` @@ -140,7 +140,7 @@ apt install fonts-noto-color-emoji If you're having trouble getting Binary Ninja installed in a headless server install where you want to be able to X-Forward the GUI on a remote machine, the following should meet requirements (for at least 14.04 LTS): -``` +``` bash apt-get install libgl1-mesa-glx libfontconfig1 libxrender1 libegl1-mesa libxi6 libnspr4 libsm6 ``` @@ -152,7 +152,7 @@ apt-get install libgl1-mesa-glx libfontconfig1 libxrender1 libegl1-mesa libxi6 l To run Binary Ninja in a KDE based environment, set the `QT_PLUGIN_PATH` to the `QT` sub-folder: -``` +``` bash cd ~/binaryninja QT_PLUGIN_PATH=./qt ./binaryninja ``` @@ -161,7 +161,7 @@ QT_PLUGIN_PATH=./qt ./binaryninja Here's a customer-provided nix derivation file for the Binary Ninja demo. Note that you'll likely want to update the SHA256 field with the latest value available [here](https://binary.ninja/js/hashes.js). Adapt as necessary for other versions, or hop onto our slack (specifically the #unsupported-distros channel) to find out more: -``` +``` js { stdenv, autoPatchelfHook, makeWrapper, fetchurl, unzip, libGL, glib, fontconfig, xlibs, dbus, xkeyboard_config }: stdenv.mkDerivation rec { name = "binary-ninja-demo"; diff --git a/docs/guide/type.md b/docs/guide/type.md index 3965eb01..8bb34424 100644 --- a/docs/guide/type.md +++ b/docs/guide/type.md @@ -121,7 +121,7 @@ document.addEventListener("DOMContentLoaded", function(event) { Note that the last step is entirely optional. Now that we've created a basic structure, and if we happen to do some reverse engineering on these binaries, we learn that this is actually a linked list and that the structures should look like: -```C +``` C struct Page { int num; @@ -133,7 +133,7 @@ struct Page ``` and: -```C +``` C struct Tape { int id; @@ -174,7 +174,7 @@ The shortcuts for editing existing elements are: Structs support the attribute `__packed` to indicate that there is no padding. Additionally, function prototypes support the following keywords to indicate their calling convention or other features: -``` +``` text __cdecl __stdcall __fastcall @@ -192,7 +192,7 @@ Once you've created your structures, you can apply them to your disassembly. Sim #### Examples -```C +``` C enum _flags { F_X = 0x1, @@ -201,7 +201,7 @@ enum _flags }; ``` -```C +``` C struct Header __packed { char *name; @@ -224,7 +224,7 @@ Let's follow the most basic workflow: making a new type, inserting it into a Bin There are two main ways to create a type with the API. The first is to use [one of](https://api.binary.ninja/search.html?q=parse_type&check_keywords=yes&area=default#) our APIs that parse a type string and return a type object. For a simple, single type, [parse_type_string](https://api.binary.ninja/binaryninja.binaryview-module.html#binaryninja.binaryview.BinaryView.parse_type_string) will return a tuple of the [Type](https://api.binary.ninja/binaryninja.types.Type.html#binaryninja.types.Type) and the [QualifiedName](https://api.binary.ninja/binaryninja.types.QualifiedName.html#binaryninja.types.QualifiedName): -```py +``` py >>> bv.parse_type_string("int foo") (<type: int32_t>, 'foo') >>> @@ -232,7 +232,7 @@ There are two main ways to create a type with the API. The first is to use [one For more complicated types that are already in C syntax, you may want to take advantage of the [parse_types_*](https://api.binary.ninja/search.html?q=parse_types&check_keywords=yes&area=default) APIs. -```py +``` py >>> bv.platform.parse_types_from_source(''' enum colors {blue, green, brown}; @@ -254,7 +254,7 @@ NOTE: While they have similar names, be aware that the parse_types APIs live off Base [types](https://api.binary.ninja/binaryninja.types-module.html) can be easily composed to create simple type objects or added with [Structures](https://api.binary.ninja/binaryninja.types.Structure.html#binaryninja.types.Structure): -```py +``` py >>> myar = Type.array(Type.char(), 20) >>> print(repr(myar)) <type: char [20]> @@ -262,7 +262,7 @@ Base [types](https://api.binary.ninja/binaryninja.types-module.html) can be easi This is useful for creating structures that are not easily created in C syntax, such as sparse structures with only some members defined: -```py +``` py >>> s = types.Structure() >>> s <struct: size 0x0> @@ -276,7 +276,7 @@ This is useful for creating structures that are not easily created in C syntax, Next, we're going to take the optional step of inserting our type into the current BinaryView with the [define_user_type](https://api.binary.ninja/binaryninja.binaryview-module.html#binaryninja.binaryview.BinaryView.define_user_type) API: -```py +``` py >>> bv.define_user_type("myString", myar) ``` @@ -290,7 +290,7 @@ This makes the type available to the user to apply more easily and is appropriat Of course, having the type available doesn't actually apply it to anything in the binary. Let's examine our [sample binary](http://captf.com/2011/gits/taped), find a suitable string (like the one at `0x8049f34`) and create a data variable using our new type: -```py +``` py >>> bv.define_user_data_var(0x8049f34, bv.types["myString"]) ``` And now we can see that the string was indeed applied to our location: @@ -299,7 +299,7 @@ And now we can see that the string was indeed applied to our location: Of course, we could have just directly applied our type without inserting it into the types available in the binary. For example: -```py +``` py >>> bv.define_user_data_var(0x8049f34, Type.array(Type.char(), 20)) ``` @@ -311,13 +311,13 @@ NOTE: There also exists the [`define_data_var`](https://api.binary.ninja/binaryn To remove a type from the view: -```py +``` py >>> bv.undefine_user_type('person') ``` Or you can remove a type applied to memory: -```py +``` py >>> bv.undefine_user_data_var(0x8049f34) ``` @@ -326,7 +326,7 @@ Or you can remove a type applied to memory: Here's a snippet to take an existing function, and set the confidence of all the parameter types to 100%: -```py +``` py old = current_function.function_type new_parameters = [] for vars, params in zip(current_function.parameter_vars, old.parameters): @@ -355,7 +355,7 @@ You can also trigger the signature matcher to run from the menu `Tools > Run Ana Once the signature matcher runs, it will print a brief report to the console detailing how many functions it matched and will rename matched functions. For example: -```txt +``` text 1 functions matched total, 0 name-only matches, 0 thunks resolved, 33 functions skipped because they were too small ``` @@ -367,7 +367,7 @@ For headless users, you can generate signature libraries by using the sigkit API If you are accessing the sigkit API through the Binary Ninja GUI and you've installed the sigkit plugin through the plugin manager, you will need to import sigkit under a different name: -```python +``` python import Vector35_sigkit as sigkit ``` @@ -399,7 +399,7 @@ Some binaries helpfully have symbol information in them which makes reverse engi That's it! From an API perspective, there are some helper functions to make the process easier. For example, to rename a function: -```py +``` py >>> current_function.name 'main' >>> current_function.name = "newName" @@ -409,7 +409,7 @@ That's it! From an API perspective, there are some helper functions to make the Other objects or variables may need a [symbol](https://api.binary.ninja/binaryninja.types.Symbol.html) created and applied: -```py +``` py >>> mysym = Symbol(SymbolType.FunctionSymbol, here, "myVariableName") >>> mysym <SymbolType.FunctionSymbol: "myVariableName" @ 0x80498d0> |
