summaryrefslogtreecommitdiff
path: root/rust/README.md
blob: 8fca9c0752a2e5eb314f6f8c855df09aca1ddc34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# BinaryNinja-rs

> :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.**

## Dependencies

Having BinaryNinja installed (and your license registered)
Clang

## 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/`

### To write a headless script

`Cargo.toml`:
```
[dependencies]
binaryninja = { git = "https://github.com/Vector35/binaryninja-api.git", branch = "dev", features = ["headless"] }

```

`src/main.rs`:
```
use binaryninja::version;

fn main() {
    println!("BinaryNinja Version: `{}`", version());
}
```

## Contributing

If you want to advance the binaryninjacore.h reference, simply change the commit ID in `build.rs`

## WIP : TODO

 - Logging needs to be redone
 - Update libc requirement on binaryninja::
 - Rename `section_by_name` to `get_section_by_name` and similar
many other todos are still scattered in the codebase

---

#### Attribution

This project makes use of:
  - [log] ([log license] - MIT)
  - [rayon] ([rayon license] - MIT)

[log]: https://github.com/rust-lang/log
[log license]: https://github.com/rust-lang/log/blob/master/LICENSE-MIT
[rayon]: https://github.com/rayon-rs/rayon
[rayon license]: https://github.com/rayon-rs/rayon/blob/master/LICENSE-MIT