Struct Instruction

Source
pub struct Instruction<'a> { /* private fields */ }
Expand description

Wrapper structure for a qemu_plugin_insn *

§Safety

This structure is safe to use as long as the pointer is valid. The pointer is always opaque, and therefore may not be dereferenced.

Implementations§

Source§

impl<'a> Instruction<'a>

Source

pub fn data(&self) -> Vec<u8>

Returns the data for this instruction. This method may only be called inside the callback in which the instruction is obtained, but the resulting data is owned.

Source

pub fn size(&self) -> usize

Returns the size of the data for this instruction

Source

pub fn vaddr(&self) -> u64

Returns the virtual address of this instruction

Source

pub fn haddr(&self) -> u64

Returns the hardware (physical) address of this instruction

Source

pub fn disas(&self) -> Result<String>

Returns the textual disassembly of this instruction

Source

pub fn symbol(&self) -> Result<Option<String>>

Returns the symbol associated with this instruction, if one exists and the binary contains a symbol table

Source

pub fn register_execute_callback<F>(&self, cb: F)
where F: FnMut(VCPUIndex) + Send + Sync + 'static,

Register a callback to be run on execution of this instruction

Source

pub fn register_execute_callback_flags<F>(&self, cb: F, flags: CallbackFlags)
where F: FnMut(VCPUIndex) + Send + Sync + 'static,

Register a callback to be run on execution of this instruction

Source

pub fn register_memory_access_callback<F>(&self, cb: F, rw: MemRW)
where F: FnMut(VCPUIndex, MemoryInfo<'_>, u64) + Send + Sync + 'static,

Register a callback to be run on memory access of this instruction

§Arguments
  • cb: The callback to be run
  • rw: The type of memory access to trigger the callback on
Source

pub fn register_memory_access_callback_flags<F>( &self, cb: F, rw: MemRW, flags: CallbackFlags, )
where F: FnMut(VCPUIndex, MemoryInfo<'_>, u64) + Send + Sync + 'static,

Register a callback to be run on memory access of this instruction

§Arguments
  • cb: The callback to be run
  • rw: The type of memory access to trigger the callback on

Auto Trait Implementations§

§

impl<'a> Freeze for Instruction<'a>

§

impl<'a> RefUnwindSafe for Instruction<'a>

§

impl<'a> Send for Instruction<'a>

§

impl<'a> Sync for Instruction<'a>

§

impl<'a> Unpin for Instruction<'a>

§

impl<'a> UnwindSafe for Instruction<'a>

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.