summaryrefslogtreecommitdiff
path: root/rust/README.md
diff options
context:
space:
mode:
authorKyleMiles <krm504@nyu.edu>2021-06-28 22:13:43 -0400
committerKyleMiles <krm504@nyu.edu>2021-06-29 00:26:33 -0400
commit2c344cf7a77031021e346fd8649de2b7715b5c45 (patch)
treefc9b48db5748231aed4e05128d38ab649717a102 /rust/README.md
parent58e515b3bfa3a96e4934b8a625bb6e51399057ec (diff)
Resolves #2521; Rust API Linking Errors
Diffstat (limited to 'rust/README.md')
-rw-r--r--rust/README.md55
1 files changed, 2 insertions, 53 deletions
diff --git a/rust/README.md b/rust/README.md
index 60be28b2..39b5e9b0 100644
--- a/rust/README.md
+++ b/rust/README.md
@@ -4,7 +4,7 @@
> :warning: **These bindings are in a very early beta, only have partial support for the core APIs and are still actively under development. Compatibility _will_ break and conventions _will_ change! They are being used for core Binary Ninja features however, so we expect much of what is already there to be reliable enough to build on, just don't be surprised if your plugins/scripts need to hit a moving target.**
-> :warning: This project requires Rust Nightly to build with those fancy linker arguments
+> :warning: This project requires **Rust Nightly** to build with those fancy linker arguments
## Dependencies
@@ -16,58 +16,7 @@ Rust **Nightly**
## How to use
-### To write a plugin:
-
-`Cargo.toml`:
-```
-[lib]
-crate-type = ["cdylib"]
-
-[dependencies]
-binaryninja = {git = "https://github.com/Vector35/binaryninja-api.git", branch = "dev"}
-```
-
-`src/main.rs`:
-See the `./examples/`. Plugin registration commands are in `binaryninja::command::*`
-
-
-### To write a headless script:
-
-`Cargo.toml`:
-```
-[dependencies]
-binaryninja = { git = "https://github.com/Vector35/binaryninja-api.git", branch = "dev"}
-```
-
-`src/main.rs`:
-```
-use binaryninja::version;
-use binaryninja::architecture::Architecture;
-use binaryninja::binaryview::{BinaryViewBase, BinaryViewExt};
-
-fn main() {
- println!("BinaryNinja Version: `{}`", version());
-
- println!("Loading plugins..."); // This loads all the core architecture, platform, etc plugins
- binaryninja::headless::init();
-
- println!("Loading binary...");
- let bv = binaryninja::open_view("/bin/cat").expect("Couldn't open `/bin/cat`");
-
- println!("Filename: `{}`", bv.metadata().filename());
- println!("File size: `{:#x}`", bv.len());
- println!("Function count: {}", bv.functions().len());
-
- for func in &bv.functions() {
- println!(" `{}`:", func.symbol().full_name());
- }
-
- // Important! You need to call shutdown or your script will hang forever
- binaryninja::headless::shutdown();
-}
-```
-
-All headless scripts should call both `binaryninja::headless::init()` and `binaryninja::headless::shutdown()`.
+See [`examples/template`](examples/template).
---