pub struct HotPatchHook<A: Architecture> { /* private fields */ }Expand description
hot-patch style hook
uses the mov edi, edi / padding space present in Windows hot-patchable functions. only modifies 2 bytes at the function entry point atomically.
Implementations§
Source§impl<A: Architecture> HotPatchHook<A>
impl<A: Architecture> HotPatchHook<A>
Sourcepub fn is_patchable(target: usize) -> bool
pub fn is_patchable(target: usize) -> bool
check if the target function is hot-patchable
looks for:
- 5 bytes of padding (CC or 90) at target-5
- 2-byte NOP (8B FF = mov edi,edi or 66 90) at target
Trait Implementations§
Source§impl<A: Architecture> Hook for HotPatchHook<A>
impl<A: Architecture> Hook for HotPatchHook<A>
Auto Trait Implementations§
impl<A> Freeze for HotPatchHook<A>
impl<A> RefUnwindSafe for HotPatchHook<A>where
A: RefUnwindSafe,
impl<A> Send for HotPatchHook<A>where
A: Send,
impl<A> Sync for HotPatchHook<A>where
A: Sync,
impl<A> Unpin for HotPatchHook<A>where
A: Unpin,
impl<A> UnwindSafe for HotPatchHook<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