Struct Detour

Source
pub struct Detour {
    pub entry_point: usize,
    /* private fields */
}
Expand description

Struct that contains its entry point and original bytes. The purpose of this struct is that when it goes out of scope, it automatically removes the modified bytes in order to do a clean remove of the DLL.

Fields§

§entry_point: usize

Pointer where the detour will be injected.

Implementations§

Source§

impl Detour

Source

pub fn new( entry_point: usize, size: usize, new_function: usize, function_end: Option<&'static mut usize>, ) -> Detour

Source

pub fn new_from_aob( scan: MemoryPattern, region: &MemoryRegion, new_function: usize, function_end: Option<&'static mut usize>, size_injection: usize, offset: Option<isize>, ) -> Result<Detour>

Creates a Detour from scan_aob. This function can fail in the case when the scan_aob can’t find it’s target.

Trait Implementations§

Source§

impl Debug for Detour

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for Detour

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Inject for Detour

Source§

fn inject(&mut self)

Source§

fn remove_injection(&mut self)

Auto Trait Implementations§

§

impl Freeze for Detour

§

impl RefUnwindSafe for Detour

§

impl Send for Detour

§

impl Sync for Detour

§

impl Unpin for Detour

§

impl !UnwindSafe for Detour

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.