Struct libscemu::emu::hook::Hook

source ·
pub struct Hook {
    pub hook_on_interrupt: Option<fn(emu: &mut Emu, ip_addr: u64, interrupt: u64) -> bool>,
    pub hook_on_exception: Option<fn(emu: &mut Emu, ip_addr: u64) -> bool>,
    pub hook_on_memory_read: Option<fn(emu: &mut Emu, ip_addr: u64, mem_addr: u64, sz: u32)>,
    pub hook_on_memory_write: Option<fn(emu: &mut Emu, ip_addr: u64, mem_addr: u64, sz: u32, value: u128) -> u128>,
    pub hook_on_pre_instruction: Option<fn(emu: &mut Emu, ip_addr: u64, ins: &Instruction, sz: usize)>,
    pub hook_on_post_instruction: Option<fn(emu: &mut Emu, ip_addr: u64, ins: &Instruction, sz: usize, emu_ok: bool)>,
    pub hook_on_winapi_call: Option<fn(emu: &mut Emu, ip_addr: u64, called_addr: u64) -> bool>,
}

Fields§

§hook_on_interrupt: Option<fn(emu: &mut Emu, ip_addr: u64, interrupt: u64) -> bool>§hook_on_exception: Option<fn(emu: &mut Emu, ip_addr: u64) -> bool>§hook_on_memory_read: Option<fn(emu: &mut Emu, ip_addr: u64, mem_addr: u64, sz: u32)>§hook_on_memory_write: Option<fn(emu: &mut Emu, ip_addr: u64, mem_addr: u64, sz: u32, value: u128) -> u128>§hook_on_pre_instruction: Option<fn(emu: &mut Emu, ip_addr: u64, ins: &Instruction, sz: usize)>§hook_on_post_instruction: Option<fn(emu: &mut Emu, ip_addr: u64, ins: &Instruction, sz: usize, emu_ok: bool)>§hook_on_winapi_call: Option<fn(emu: &mut Emu, ip_addr: u64, called_addr: u64) -> bool>

Implementations§

source§

impl Hook

source

pub fn new() -> Hook

source

pub fn on_interrupt( &mut self, hook: fn(emu: &mut Emu, ip_addr: u64, interrupt: u64) -> bool )

source

pub fn disable_interrupt(&mut self)

source

pub fn on_exception(&mut self, hook: fn(emu: &mut Emu, ip_addr: u64) -> bool)

source

pub fn disable_exception(&mut self)

source

pub fn on_memory_read( &mut self, hook: fn(emu: &mut Emu, ip_addr: u64, mem_addr: u64, sz: u32) )

source

pub fn disable_memory_read(&mut self)

source

pub fn on_memory_write( &mut self, hook: fn(emu: &mut Emu, ip_addr: u64, mem_addr: u64, sz: u32, value: u128) -> u128 )

source

pub fn disable_memory_write(&mut self)

source

pub fn on_pre_instruction( &mut self, hook: fn(emu: &mut Emu, ip_addr: u64, ins: &Instruction, sz: usize) )

source

pub fn disable_pre_instruction(&mut self)

source

pub fn on_post_instruction( &mut self, hook: fn(emu: &mut Emu, ip_addr: u64, ins: &Instruction, sz: usize, emu_ok: bool) )

source

pub fn disable_post_instruction(&mut self)

source

pub fn on_winapi_call( &mut self, hook: fn(emu: &mut Emu, ip_addr: u64, called_addr: u64) -> bool )

source

pub fn disable_winapi_call(&mut self)

Auto Trait Implementations§

§

impl Freeze for Hook

§

impl RefUnwindSafe for Hook

§

impl Send for Hook

§

impl Sync for Hook

§

impl Unpin for Hook

§

impl UnwindSafe for Hook

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>,

§

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>,

§

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.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V