Ready for rust bindings release
This commit is contained in:
@ -1,17 +1,17 @@
|
||||
# unicorn-rs
|
||||
# Unicorn-engine
|
||||
|
||||
Rust bindings for the [Unicorn](http://www.unicorn-engine.org/) emulator with utility functions.
|
||||
|
||||
An extended version for fuzzing with AFL++ support can be found in https://github.com/aflplusplus/unicornafl.
|
||||
Checkout Unicorn2 source code at [dev branch](https://github.com/unicorn-engine/unicorn/tree/dev).
|
||||
|
||||
```rust
|
||||
use unicorn::RegisterARM;
|
||||
use unicorn::unicorn_const::{Arch, Mode, Permission, SECOND_SCALE};
|
||||
use unicorn_engine::RegisterARM;
|
||||
use unicorn_engine::unicorn_const::{Arch, Mode, Permission, SECOND_SCALE};
|
||||
|
||||
fn main() {
|
||||
let arm_code32: Vec<u8> = vec![0x17, 0x00, 0x40, 0xe2]; // sub r0, #23
|
||||
|
||||
let mut unicorn = unicorn::Unicorn::new(Arch::ARM, Mode::LITTLE_ENDIAN).expect("failed to initialize Unicorn instance");
|
||||
let mut unicorn = unicorn-engine::Unicorn::new(Arch::ARM, Mode::LITTLE_ENDIAN).expect("failed to initialize Unicorn instance");
|
||||
let mut emu = unicorn.borrow();
|
||||
emu.mem_map(0x1000, 0x4000, Permission::ALL).expect("failed to map code page");
|
||||
emu.mem_write(0x1000, &arm_code32).expect("failed to write instructions");
|
||||
@ -26,20 +26,18 @@ fn main() {
|
||||
```
|
||||
Further sample code can be found in ```tests/unicorn.rs```.
|
||||
|
||||
## Installation
|
||||
## Usage
|
||||
|
||||
This project has been tested on Linux, OS X and Windows.
|
||||
|
||||
To use unicorn-rs, simply add it as a dependency to the Cargo.toml of your program.
|
||||
Add this to your `Cargo.toml`:
|
||||
|
||||
```
|
||||
[dependencies]
|
||||
unicorn = { path = "/path/to/bindings/rust", version="1.0.0" }
|
||||
unicorn-engine = "2.0.0-rc3"
|
||||
```
|
||||
|
||||
## Acknowledgements
|
||||
|
||||
These bindings are based on Sébastien Duquette's (@ekse) [unicorn-rs](https://github.com/unicorn-rs/unicorn-rs).
|
||||
We picked up the project, as it is no longer maintained.
|
||||
Thanks to all contributers.
|
||||
Thanks to all contributors.
|
||||
|
||||
|
Reference in New Issue
Block a user