Struct unicorn::CpuSPARC [] [src]

pub struct CpuSPARC {
    // some fields omitted
}

A SPARC emulator instance.

Methods

impl CpuSPARC
[src]

fn new(mode: Mode) -> Result<CpuSPARCError>

Create a SPARC emulator instance for the specified hardware mode.

Trait Implementations

impl Cpu for CpuSPARC
[src]

type Reg = RegisterSPARC

fn emu(&self) -> &Unicorn

fn mut_emu(&mut self) -> &mut Unicorn

fn reg_read(&self, reg: Self::Reg) -> Result<u64Error>

Read an unsigned value from a register.

fn reg_read_i32(&self, reg: Self::Reg) -> Result<i32Error>

Read a signed 32-bit value from a register.

fn reg_write(&mut self, reg: Self::Reg, value: u64) -> Result<()Error>

Write an unsigned value register.

fn reg_write_i32(&self, reg: Self::Reg, value: i32) -> Result<()Error>

Write a signed 32-bit value to a register.

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

fn mem_unmap(&self, address: u64, size: size_t) -> Result<()Error>

Unmap a memory region. Read more

fn mem_write(&self, address: u64, bytes: &[u8]) -> Result<()Error>

Write a range of bytes to memory at the specified address.

fn mem_read(&self, address: u64, size: usize) -> Result<Vec<u8>, Error>

Read a range of bytes from memory at the specified address.

fn mem_protect(&self, address: u64, size: usize, perms: Protection) -> Result<()Error>

Set the memory permissions for an existing memory region. Read more

fn mem_regions(&self) -> Result<Vec<MemRegion>, Error>

Returns a vector with the memory regions that are mapped in the emulator.

fn emu_start(&self, begin: u64, until: u64, timeout: u64, count: usize) -> Result<()Error>

Emulate machine code for a specified duration. Read more

fn emu_stop(&self) -> Result<()Error>

Stop the emulation. Read more

fn add_code_hook<F>(&mut self, hook_type: CodeHookType, begin: u64, end: u64, callback: F) -> Result<uc_hookError> where F: Fn(&Unicorn, u64, u32) -> () + 'static

Add a code hook.

fn add_intr_hook<F>(&mut self, callback: F) -> Result<uc_hookError> where F: Fn(&Unicorn, u32) + 'static

Add an interrupt hook.

fn add_mem_hook<F>(&mut self, hook_type: MemHookType, begin: u64, end: u64, callback: F) -> Result<uc_hookError> where F: Fn(&Unicorn, MemType, u64, usize, i64) -> bool + 'static

Add a memory hook.

fn add_insn_in_hook<F>(&mut self, callback: F) -> Result<uc_hookError> where F: Fn(&Unicorn, u32, usize) -> u32 + 'static

Add an "in" instruction hook.

fn add_insn_out_hook<F>(&mut self, callback: F) -> Result<uc_hookError> where F: Fn(&Unicorn, u32, usize, u32) + 'static

Add an "out" instruction hook.

fn add_insn_sys_hook<F>(&mut self, insn_type: InsnSysX86, begin: u64, end: u64, callback: F) -> Result<uc_hookError> where F: Fn(&Unicorn) + 'static

Add a "syscall" or "sysenter" instruction hook.

fn remove_hook(&mut self, hook: uc_hook) -> Result<()Error>

Remove a hook. Read more

fn errno(&self) -> Error

Return the last error code when an API function failed. Read more

fn query(&self, query: Query) -> Result<usizeError>

Query the internal status of the engine. Read more