Struct ilhook::x86::Hooker [−][src]
pub struct Hooker { /* fields omitted */ }
The entry struct in ilhook. Please read the main doc to view usage.
Implementations
impl Hooker
[src]
pub fn new(
addr: usize,
hook_type: HookType,
thread_cb: CallbackOption,
flags: HookFlags
) -> Self
[src]
addr: usize,
hook_type: HookType,
thread_cb: CallbackOption,
flags: HookFlags
) -> Self
Create a new Hooker.
Arguments
addr
- The being-hooked address.hook_type
- The hook type and callback routine.thread_cb
- The callbacks before and after hooking.flags
- Hook flags
pub unsafe fn hook(self) -> Result<HookPoint, HookError>
[src]
Consumes self and execute hooking. Return the HookPoint.
Safety
Process may crash (instead of panic!) if:
- addr is not an accessible memory address, or is not long enough.
- addr points to an incorrect position. (At the middle of an instruction, or where after it other instructions may jump to)
- Wrong Retn-val if hook_type is
HookType::Retn
. i.e. Acdecl
function with non-zero retn-val, or astdcall
function with wrong retn-val. - Set
NOT_MODIFY_MEMORY_PROTECT
where it should not be set. - hook or unhook from 2 or more threads at the same time without
HookFlags::NOT_MODIFY_MEMORY_PROTECT
. Because of memory protection colliding. - Other unpredictable errors.
Auto Trait Implementations
impl !RefUnwindSafe for Hooker
impl !Send for Hooker
impl !Sync for Hooker
impl Unpin for Hooker
impl !UnwindSafe for Hooker
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,