pub struct CpuX86 { /* private fields */ }
Expand description
An X86 emulator instance.
Implementations§
Trait Implementations§
Source§impl Cpu for CpuX86
impl Cpu for CpuX86
type Reg = RegisterX86
fn emu(&self) -> &Unicorn
fn mut_emu(&mut self) -> &mut Unicorn
Source§fn reg_read(&self, reg: Self::Reg) -> Result<u64, Error>
fn reg_read(&self, reg: Self::Reg) -> Result<u64, Error>
Read an unsigned value from a register.
Source§fn reg_read_i32(&self, reg: Self::Reg) -> Result<i32, Error>
fn reg_read_i32(&self, reg: Self::Reg) -> Result<i32, Error>
Read a signed 32-bit value from a register.
Source§unsafe fn reg_write_generic<T: Sized>(
&self,
reg: Self::Reg,
value: T,
) -> Result<(), Error>
unsafe fn reg_write_generic<T: Sized>( &self, reg: Self::Reg, value: T, ) -> Result<(), Error>
Write a generic type to a register.
Source§fn reg_write(&self, reg: Self::Reg, value: u64) -> Result<(), Error>
fn reg_write(&self, reg: Self::Reg, value: u64) -> Result<(), Error>
Write an unsigned value register.
Source§fn reg_write_i32(&self, reg: Self::Reg, value: i32) -> Result<(), Error>
fn reg_write_i32(&self, reg: Self::Reg, value: i32) -> Result<(), Error>
Write a signed 32-bit value to a register.
Source§fn mem_map(
&self,
address: u64,
size: size_t,
perms: Protection,
) -> Result<(), Error>
fn mem_map( &self, address: u64, size: size_t, perms: Protection, ) -> Result<(), Error>
Map a memory region in the emulator at the specified address. Read more
Source§unsafe fn mem_map_ptr<T>(
&self,
address: u64,
size: size_t,
perms: Protection,
ptr: *mut T,
) -> Result<(), Error>
unsafe fn mem_map_ptr<T>( &self, address: u64, size: size_t, perms: Protection, ptr: *mut T, ) -> Result<(), Error>
Map an existing memory region in the emulator at the specified address. Read more
Source§fn mem_unmap(&self, address: u64, size: size_t) -> Result<(), Error>
fn mem_unmap(&self, address: u64, size: size_t) -> Result<(), Error>
Unmap a memory region. Read more
Source§fn mem_write(&self, address: u64, bytes: &[u8]) -> Result<(), Error>
fn mem_write(&self, address: u64, bytes: &[u8]) -> Result<(), Error>
Write a range of bytes to memory at the specified address.
Source§fn mem_read(&self, address: u64, bytes: &mut [u8]) -> Result<(), Error>
fn mem_read(&self, address: u64, bytes: &mut [u8]) -> Result<(), Error>
Read a range of bytes from memory at the specified address.
Source§fn mem_read_as_vec(&self, address: u64, size: usize) -> Result<Vec<u8>, Error>
fn mem_read_as_vec(&self, address: u64, size: usize) -> Result<Vec<u8>, Error>
Read a range of bytes from memory at the specified address; return the bytes read as a
Vec
.Source§fn mem_protect(
&self,
address: u64,
size: usize,
perms: Protection,
) -> Result<(), Error>
fn mem_protect( &self, address: u64, size: usize, perms: Protection, ) -> Result<(), Error>
Set the memory permissions for an existing memory region. Read more
Source§fn mem_regions(&self) -> Result<Vec<MemRegion>, Error>
fn mem_regions(&self) -> Result<Vec<MemRegion>, Error>
Returns a vector with the memory regions that are mapped in the emulator.
Source§fn emu_start(
&self,
begin: u64,
until: u64,
timeout: u64,
count: usize,
) -> Result<(), Error>
fn emu_start( &self, begin: u64, until: u64, timeout: u64, count: usize, ) -> Result<(), Error>
Emulate machine code for a specified duration. Read more
Source§fn add_code_hook<F>(
&mut self,
hook_type: CodeHookType,
begin: u64,
end: u64,
callback: F,
) -> Result<uc_hook, Error>
fn add_code_hook<F>( &mut self, hook_type: CodeHookType, begin: u64, end: u64, callback: F, ) -> Result<uc_hook, Error>
Add a code hook.
Source§fn add_mem_hook<F>(
&mut self,
hook_type: MemHookType,
begin: u64,
end: u64,
callback: F,
) -> Result<uc_hook, Error>
fn add_mem_hook<F>( &mut self, hook_type: MemHookType, begin: u64, end: u64, callback: F, ) -> Result<uc_hook, Error>
Add a memory hook.
Source§fn add_insn_in_hook<F>(&mut self, callback: F) -> Result<uc_hook, Error>
fn add_insn_in_hook<F>(&mut self, callback: F) -> Result<uc_hook, Error>
Add an “in” instruction hook.
Source§fn add_insn_out_hook<F>(&mut self, callback: F) -> Result<uc_hook, Error>
fn add_insn_out_hook<F>(&mut self, callback: F) -> Result<uc_hook, Error>
Add an “out” instruction hook.
Source§fn add_insn_sys_hook<F>(
&mut self,
insn_type: InsnSysX86,
begin: u64,
end: u64,
callback: F,
) -> Result<uc_hook, Error>
fn add_insn_sys_hook<F>( &mut self, insn_type: InsnSysX86, begin: u64, end: u64, callback: F, ) -> Result<uc_hook, Error>
Add a “syscall” or “sysenter” instruction hook.
Source§fn query(&self, query: Query) -> Result<usize, Error>
fn query(&self, query: Query) -> Result<usize, Error>
Query the internal status of the engine. Read more
fn context_restore(&self, context: &Context) -> Result<(), Error>
Auto Trait Implementations§
impl Freeze for CpuX86
impl !RefUnwindSafe for CpuX86
impl !Send for CpuX86
impl !Sync for CpuX86
impl Unpin for CpuX86
impl !UnwindSafe for CpuX86
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