Skip to content

Commit b57a673

Browse files
committed
fix readme
1 parent c4aec6c commit b57a673

File tree

3 files changed

+3
-42
lines changed

3 files changed

+3
-42
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ categories = ["api-bindings", "emulators", "no-std", "virtualization"]
1111
documentation = "https://github.com/unicorn-engine/unicorn/wiki"
1212
edition = "2024"
1313
license = "GPL-2.0"
14-
readme = "./bindings/rust/sys/README.md"
14+
readme = "./Readme.md"
1515
repository = "https://github.com/unicorn-engine/unicorn"
1616
description = "Rust bindings for the Unicorn emulator with utility functions"
1717

crates/unicorn/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ categories.workspace = true
77
documentation.workspace = true
88
edition.workspace = true
99
license.workspace = true
10-
readme = "README.md"
10+
readme.workspace = true
1111
repository.workspace = true
1212
description.workspace = true
1313

crates/unicorn/README.md

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1 @@
1-
# Unicorn-engine
2-
3-
Rust bindings for the [Unicorn](http://www.unicorn-engine.org/) emulator with utility functions.
4-
5-
Checkout Unicorn2 source code at [dev branch](https://github.com/unicorn-engine/unicorn/tree/dev).
6-
7-
```rust
8-
use unicorn_engine::{Arch, Mode, Prot, SECOND_SCALE, Unicorn, RegisterARM};
9-
10-
fn main() {
11-
let arm_code32: Vec<u8> = vec![0x17, 0x00, 0x40, 0xe2]; // sub r0, #23
12-
13-
let mut emu = Unicorn::new(Arch::ARM, Mode::LITTLE_ENDIAN).expect("failed to initialize Unicorn instance");
14-
emu.mem_map(0x1000, 0x4000, Prot::ALL).expect("failed to map code page");
15-
emu.mem_write(0x1000, &arm_code32).expect("failed to write instructions");
16-
17-
emu.reg_write(RegisterARM::R0, 123).expect("failed write R0");
18-
emu.reg_write(RegisterARM::R5, 1337).expect("failed write R5");
19-
20-
emu.emu_start(0x1000, (0x1000 + arm_code32.len()) as u64, 10 * SECOND_SCALE, 1000).expect("failed to start emulation");
21-
assert_eq!(emu.reg_read(RegisterARM::R0).unwrap(), 100);
22-
assert_eq!(emu.reg_read(RegisterARM::R5).unwrap(), 1337);
23-
}
24-
```
25-
26-
Further sample code can be found in [tests](./src/tests).
27-
28-
## Usage
29-
30-
Add this to your `Cargo.toml`:
31-
32-
```
33-
[dependencies]
34-
unicorn-engine = "2"
35-
```
36-
37-
## Acknowledgements
38-
39-
These bindings were once 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 contributors.
40-
1+
See [Readme](https://github.com/unicorn-engine/unicorn-engine-rs/blob/main/Readme.md).

0 commit comments

Comments
 (0)