pub struct HookBuilder<A: Architecture, S> { /* private fields */ }Expand description
type-state hook builder
ensures hook creation follows the correct sequence:
Uninitialized -> TargetSet -> DetourSet -> TrampolineAllocated -> TrampolineBuilt -> Ready
Implementations§
Source§impl<A: Architecture> HookBuilder<A, Uninitialized>
impl<A: Architecture> HookBuilder<A, Uninitialized>
Source§impl<A: Architecture> HookBuilder<A, TargetSet>
impl<A: Architecture> HookBuilder<A, TargetSet>
Sourcepub fn get_target(&self) -> usize
pub fn get_target(&self) -> usize
get the target address
Source§impl<A: Architecture> HookBuilder<A, DetourSet>
impl<A: Architecture> HookBuilder<A, DetourSet>
Sourcepub fn get_target(&self) -> usize
pub fn get_target(&self) -> usize
get the target address
Sourcepub fn get_detour(&self) -> usize
pub fn get_detour(&self) -> usize
get the detour address
Sourcepub fn allocate_trampoline(self) -> Result<HookBuilder<A, TrampolineAllocated>>
pub fn allocate_trampoline(self) -> Result<HookBuilder<A, TrampolineAllocated>>
analyze target and allocate trampoline
Source§impl<A: Architecture> HookBuilder<A, TrampolineAllocated>
impl<A: Architecture> HookBuilder<A, TrampolineAllocated>
Sourcepub fn get_target(&self) -> usize
pub fn get_target(&self) -> usize
get the target address
Sourcepub fn prologue_size(&self) -> usize
pub fn prologue_size(&self) -> usize
get prologue size
Sourcepub fn build_trampoline(self) -> Result<HookBuilder<A, TrampolineBuilt>>
pub fn build_trampoline(self) -> Result<HookBuilder<A, TrampolineBuilt>>
build the trampoline
Source§impl<A: Architecture> HookBuilder<A, TrampolineBuilt>
impl<A: Architecture> HookBuilder<A, TrampolineBuilt>
Sourcepub fn get_target(&self) -> usize
pub fn get_target(&self) -> usize
get the target address
Sourcepub fn trampoline(&self) -> usize
pub fn trampoline(&self) -> usize
get the trampoline address
Sourcepub fn prepare(self) -> Result<HookBuilder<A, Ready>>
pub fn prepare(self) -> Result<HookBuilder<A, Ready>>
generate hook stub and prepare for installation
Source§impl<A: Architecture> HookBuilder<A, Ready>
impl<A: Architecture> HookBuilder<A, Ready>
Sourcepub fn get_target(&self) -> usize
pub fn get_target(&self) -> usize
get the target address
Sourcepub fn trampoline(&self) -> usize
pub fn trampoline(&self) -> usize
get the trampoline address
Trait Implementations§
Source§impl<A: Architecture> Default for HookBuilder<A, Uninitialized>
impl<A: Architecture> Default for HookBuilder<A, Uninitialized>
Auto Trait Implementations§
impl<A, S> Freeze for HookBuilder<A, S>
impl<A, S> RefUnwindSafe for HookBuilder<A, S>where
A: RefUnwindSafe,
S: RefUnwindSafe,
impl<A, S> Send for HookBuilder<A, S>
impl<A, S> Sync for HookBuilder<A, S>
impl<A, S> Unpin for HookBuilder<A, S>
impl<A, S> UnwindSafe for HookBuilder<A, S>where
A: UnwindSafe,
S: 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