Skip to content

Commit

Permalink
final readme edit
Browse files Browse the repository at this point in the history
  • Loading branch information
ohchase committed Mar 11, 2024
1 parent 48f00ed commit 5dc98cd
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ Refer to `examples/hook_getpid.rs` for the full example, supporting android and
A good chunk of the code is for the actual pointer replacement to hook the function!

```rust

/// our own get pid function
unsafe fn getpid() -> u32 {
999
}

/// Finding target function differs on 32 bit and 64 bit.
/// On 64 bit we want to check the addended relocations table only, opposed to the addendless relocations table.
/// Additionally, we will fall back to the plt given it is an addended relocation table.
Expand Down Expand Up @@ -141,3 +147,12 @@ fn main() -> Result<()> {
Ok(())
}
```

```terminal
application pid is 127765
successfully identified executable
successfully initialied dynamic library for instrumentation
successfully identified libc getpid offset: 0x7E460
page start for function is 0x000061019c41b000
new pid is: 999
```

0 comments on commit 5dc98cd

Please sign in to comment.