You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Examples for writing a plugin can be found [here](https://github.com/Vector35/binaryninja-api/tree/dev/plugins).
115
+
Examples for writing a plugin can be found [here](https://github.com/Vector35/binaryninja-api/tree/dev/rust/plugin_examples) and [here](https://github.com/Vector35/binaryninja-api/tree/dev/plugins).
116
+
117
+
#### Sending Logs
118
+
119
+
To send logs from your plugin to Binary Ninja, you can use the [tracing](https://docs.rs/tracing/latest/tracing/) crate.
120
+
At the beginning of your plugin's initialization routine, register the tracing subscriber with [`crate::tracing_init!`],
121
+
for more details see the documentation of that macro.
122
+
123
+
#### Plugin Compatibility
124
+
125
+
A built plugin can only be loaded into a compatible Binary Ninja version, this is determined by the ABI version of the
126
+
plugin. The ABI version is located at the top of the `binaryninjacore.h` header file, and as such plugins should pin
127
+
their binary ninja dependency to a specific tag or commit hash. See the cargo documentation [here](https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#choice-of-commit)
128
+
for more details.
116
129
117
130
### Write a Standalone Executable
118
131
119
132
If you have a headless supporting license, you are able to use Binary Ninja as a regular dynamically loaded library.
120
133
121
-
Standalone executables must initialize the core themselves. `binaryninja::headless::init()` to initialize the core, and
122
-
`binaryninja::headless::shutdown()` to shutdown the core. Prefer using `binaryninja::headless::Session` as it will
134
+
Standalone executables must initialize the core themselves. [`crate::headless::init()`] to initialize the core, and
135
+
[`crate::headless::shutdown()`] to shutdown the core. Prefer using [`crate::headless::Session`] as it will
123
136
shut down for you once it is dropped.
124
137
125
138
`main.rs`:
@@ -131,6 +144,12 @@ fn main() {
131
144
}
132
145
```
133
146
147
+
#### Capturing Logs
148
+
149
+
To capture logs from Binary Ninja, you can use the [tracing](https://docs.rs/tracing/latest/tracing/) crate. Before initializing
150
+
the core but after registering your tracing subscriber, register a [`crate::tracing::TracingLogListener`], for more details see
151
+
the documentation for that type.
152
+
134
153
## Offline Documentation
135
154
136
155
Offline documentation can be generated like any other rust crate, using `cargo doc`.
@@ -161,18 +180,6 @@ it will likely confuse someone else, and you should make an issue or ask for gui
For attribution, please refer to the [Rust Licenses section](https://docs.binary.ninja/about/open-source.html#rust-licenses) of the user documentation.
0 commit comments