HookTracker

Struct HookTracker 

Source
pub struct HookTracker { /* private fields */ }
Expand description

tracks hooks across the process

Implementations§

Source§

impl HookTracker

Source

pub fn new() -> Self

create new hook tracker

Source

pub fn register(&mut self, info: HookInfo)

register a detected hook

Source

pub fn register_all(&mut self, hooks: impl IntoIterator<Item = HookInfo>)

register multiple hooks

Source

pub fn mark_removed(&mut self, address: usize)

mark hook as removed

Source

pub fn mark_restored(&mut self, address: usize)

mark hook as restored

Source

pub fn get(&self, address: usize) -> Option<&TrackedHook>

get hook info by address

Source

pub fn get_by_module(&self, module_name: &str) -> Vec<&TrackedHook>

get all hooks for a module

Source

pub fn active_hooks(&self) -> Vec<&TrackedHook>

get all active hooks

Source

pub fn removed_hooks(&self) -> Vec<&TrackedHook>

get all removed hooks

Source

pub fn get_by_type(&self, hook_type: HookType) -> Vec<&TrackedHook>

get hooks by type

Source

pub fn count(&self) -> usize

total number of tracked hooks

Source

pub fn active_count(&self) -> usize

number of active hooks

Source

pub fn removed_count(&self) -> usize

number of removed hooks

Source

pub fn is_tracked(&self, address: usize) -> bool

check if an address is tracked

Source

pub fn unregister(&mut self, address: usize) -> Option<TrackedHook>

unregister a hook (remove from tracking)

Source

pub fn clear(&mut self)

clear all tracked hooks

Source

pub fn modules(&self) -> Vec<&str>

get modules with tracked hooks

Source

pub fn stats(&self) -> HookStats

get statistics

Trait Implementations§

Source§

impl Default for HookTracker

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.