bhook 0.1.2

Lightweight hook crate with no_std support that works on x86, x86_64, arm and aarch64
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use bhook::{BACKUP_LEN, hook_fn};
#[test]
fn hook_test() {
    assert_eq!(original(), 0);
    unsafe {
        hook::hook_address(original as *mut u8);
    }
    assert_eq!(original(), 255);
}
#[inline(never)]
fn original() -> u8 {
    0
}
hook_fn! {
    fn hook() -> u8 = {
        255
    }
}