pub struct HookChain<A: Architecture> { /* private fields */ }Expand description
hook chain for multiple hooks on one target
manages a chain of hooks on a single function. hooks are called in priority order (lower priority first). each hook receives a trampoline to call the next hook in the chain.
Implementations§
Source§impl<A: Architecture> HookChain<A>
impl<A: Architecture> HookChain<A>
Sourcepub fn new(target: usize) -> Result<Self>
pub fn new(target: usize) -> Result<Self>
create a new hook chain on target function
this analyzes the target but does not install any hooks yet.
Sourcepub fn add(&mut self, detour: usize, priority: i32) -> Result<usize>
pub fn add(&mut self, detour: usize, priority: i32) -> Result<usize>
add a hook to the chain
returns the trampoline address for calling the next hook in chain. lower priority values are called first.
Sourcepub fn remove(&mut self, detour: usize) -> Result<bool>
pub fn remove(&mut self, detour: usize) -> Result<bool>
remove a hook from the chain by detour address
returns true if the hook was found and removed.
Trait Implementations§
Auto Trait Implementations§
impl<A> Freeze for HookChain<A>
impl<A> RefUnwindSafe for HookChain<A>where
A: RefUnwindSafe,
impl<A> Send for HookChain<A>where
A: Send,
impl<A> Sync for HookChain<A>where
A: Sync,
impl<A> Unpin for HookChain<A>where
A: Unpin,
impl<A> UnwindSafe for HookChain<A>where
A: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more