Struct libafl_qemu::emu::CPU
source · #[repr(transparent)]pub struct CPU { /* private fields */ }
Implementations§
source§impl CPU
impl CPU
pub fn emulator(&self) -> Emulator
pub fn index(&self) -> usize
pub fn trigger_breakpoint(&self)
pub fn g2h<T>(&self, addr: GuestAddr) -> *mut T
pub fn h2g<T>(&self, addr: *const T) -> GuestAddr
sourcepub unsafe fn write_mem(&self, addr: GuestAddr, buf: &[u8])
pub unsafe fn write_mem(&self, addr: GuestAddr, buf: &[u8])
Write a value to a guest address.
Safety
This will write to a translated guest address (using g2h
).
It just adds guest_base
and writes to that location, without checking the bounds.
This may only be safely used for valid guest addresses!
sourcepub unsafe fn read_mem(&self, addr: GuestAddr, buf: &mut [u8])
pub unsafe fn read_mem(&self, addr: GuestAddr, buf: &mut [u8])
Read a value from a guest address.
Safety
This will read from a translated guest address (using g2h
).
It just adds guest_base
and writes to that location, without checking the bounds.
This may only be safely used for valid guest addresses!
pub fn num_regs(&self) -> i32
pub fn write_reg<R, T>(&self, reg: R, val: T) -> Result<(), String>where R: Into<i32>,
pub fn read_reg<R, T>(&self, reg: R) -> Result<T, String>where R: Into<i32>,
pub fn reset(&self)
pub fn save_state(&self) -> CPUArchState
pub fn restore_state(&self, saved: &CPUArchState)
pub fn raw_ptr(&self) -> CPUStatePtr
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for CPU
impl !Send for CPU
impl !Sync for CPU
impl Unpin for CPU
impl UnwindSafe for CPU
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<Tail, T> Prepend<T> for Tail
impl<Tail, T> Prepend<T> for Tail
§type PreprendResult = Tail
type PreprendResult = Tail
The Resulting [
TupleList
], of an Prepend::prepend()
call,
including the prepended entry.source§fn prepend(self, value: T) -> (T, <Tail as Prepend<T>>::PreprendResult)
fn prepend(self, value: T) -> (T, <Tail as Prepend<T>>::PreprendResult)
Prepend a value to this tuple, returning a new tuple with prepended value.