Struct capstone::capstone::Capstone
[−]
[src]
pub struct Capstone { /* fields omitted */ }
An instance of the capstone disassembler
Methods
impl Capstone
[src]
fn new(arch: CsArch, mode: CsMode) -> CsResult<Capstone>
Creates a new instance of the disassembler.
use capstone::Capstone; use capstone::constants::*; let cs = Capstone::new(CsArch::ARCH_X86, CsMode::MODE_64); assert!(cs.is_ok());
fn disasm(&self, code: &[u8], addr: u64, count: isize) -> CsResult<Instructions>
Disassembles a &[u8]
full of instructions.
Pass count = 0
to disassemble all instructions in the buffer.
fn set_detail(&mut self, enable_detail: bool) -> CsResult<()>
Controls whether to capstone will generate extra details about disassembled instructions.
Pass true
to enable detail or false
to disable detail.
fn reg_name(&self, reg_id: u64) -> Option<String>
Converts a register id reg_id
to a String
containing the register name.
fn insn_name(&self, insn_id: u64) -> Option<String>
Converts an instruction id insn_id
to a String
containing the instruction name.
fn group_name(&self, group_id: u64) -> Option<String>
Converts a group id group_id
to a String
containing the group name.
fn insn_belongs_to_group(&self, insn: &Insn, group_id: u64) -> CsResult<bool>
Returns whether the instruction insn
belongs to the group with id group_id
.
fn insn_group_ids(&self, insn: &Insn) -> CsResult<&[u8]>
Returns groups ids to which an instruction belongs.
fn insn_groups(&self, insn: &Insn) -> CsResult<Vec<CsGroupType>>
Returns groups to which an instruction belongs.
fn lib_version() -> (u32, u32)
Returns a tuple (major, minor) indicating the version of the capstone C library.
fn supports_arch(arch: CsArch) -> bool
Returns whether the capstone library supports a given architecture.
fn is_diet() -> bool
Returns whether the capstone library was compiled in diet mode.