Struct libcapstone_sys::Capstone
[−]
[src]
pub struct Capstone { /* fields omitted */ }
An instance of Capstone
represents an instance of the capstone engine.
Methods
impl Capstone
[src]
pub fn new(arch: cs_arch, mode: cs_mode) -> CsResult<Capstone>
[src]
new
returns a new instance of the capstone engine with the given
arch
itecture and mode
used.
pub fn disasm(
&self,
code: &[u8],
address: u64,
count: usize
) -> CsResult<Instructions>
[src]
&self,
code: &[u8],
address: u64,
count: usize
) -> CsResult<Instructions>
disasm
disassembles the given code
at the given address
.
It disassembles count
instructions. If count
is 0, then as many
instructions as possible are disassembled.
pub fn disasm_all(&self, code: &[u8], address: u64) -> CsResult<Instructions>
[src]
disasm_all
disassembles as many instructions as possible in the given code
at the given address
.
pub fn error(&self) -> Option<String>
[src]
error
returns the current error as a String.
This may return None
, if there is no error, or the conversion to a String failed.
pub fn group_name(&self, group_id: u32) -> Option<String>
[src]
Returns the name of the given group.
pub fn insn_group(&self, insn: &cs_insn, group_id: u32) -> bool
[src]
Returns whether the given instruction belongs to the given group.
pub fn insn_name(&self, insn_id: u32) -> Option<String>
[src]
Returns the name of the given instruction.
pub fn option(&self, type_: cs_opt_type, value: usize) -> CsResult<()>
[src]
option
sets the given option type_
to the given value
.
pub fn reg_name(&self, reg_id: u32) -> Option<String>
[src]
Returns the name of the given register.
pub fn reg_read(&self, insn: &cs_insn, reg_id: u32) -> bool
[src]
Returns whether the given register is read by the given instruction.
pub fn reg_write(&self, insn: &cs_insn, reg_id: u32) -> bool
[src]
Returns whether the given register is written by the given instruction.