Struct capstone::Capstone
[−]
[src]
pub struct Capstone { /* fields omitted */ }
An instance of the capstone disassembler
Methods
impl Capstone
[src]
fn new(arch: Arch, mode: Mode) -> CsResult<Capstone>
[src]
Create a new instance of the decompiler.
use capstone::{Arch, Capstone, Mode}; let cs = Capstone::new(Arch::X86, Mode::Mode64); assert!(cs.is_ok());
fn disasm_all(&self, code: &[u8], addr: u64) -> CsResult<Instructions>
[src]
Disassemble all instructions in buffer
fn disasm_count(
&self,
code: &[u8],
addr: u64,
count: usize
) -> CsResult<Instructions>
[src]
&self,
code: &[u8],
addr: u64,
count: usize
) -> CsResult<Instructions>
Disassemble count
instructions in code
fn set_mode(&mut self, modes: &[Mode]) -> CsResult<()>
[src]
Sets the engine's disassembly mode. Be careful, various combinations of modes aren't supported See the capstone-sys documentation for more information.
fn att(&self)
[src]
Set the X86 assembly to AT&T style (has no effect on other platforms)
fn intel(&self)
[src]
Set the X86 assembly to Intel style (default)
fn set_detail(&mut self, enable_detail: bool) -> CsResult<()>
[src]
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>
[src]
Converts a register id reg_id
to a String
containing the register name.
fn insn_name(&self, insn_id: u64) -> Option<String>
[src]
Converts an instruction id insn_id
to a String
containing the instruction name.
fn group_name(&self, group_id: u64) -> Option<String>
[src]
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>
[src]
Returns whether the instruction insn
belongs to the group with id group_id
.
fn insn_groups<'i>(&self, insn: &'i Insn) -> CsResult<&'i [u8]>
[src]
Returns groups ids to which an instruction belongs.
fn register_id_is_read(&self, insn: &Insn, reg_id: u64) -> CsResult<bool>
[src]
Checks if an instruction implicitly reads a register with id reg_id
.
fn read_registers<'i>(&self, insn: &'i Insn) -> CsResult<&'i [u8]>
[src]
Returns list of ids of registers that are implicitly read by instruction insn
.
fn register_is_written(&self, insn: &Insn, reg_id: u64) -> CsResult<bool>
[src]
Checks if an instruction implicitly writes to a register with id reg_id
.
fn write_registers<'i>(&self, insn: &'i Insn) -> CsResult<&'i [u8]>
[src]
Returns a list of ids of registers that are implicitly written to by the instruction insn
.
fn lib_version() -> (u32, u32)
[src]
Returns a tuple (major, minor) indicating the version of the capstone C library.
fn supports_arch(arch: Arch) -> bool
[src]
Returns whether the capstone library supports a given architecture.
fn is_diet() -> bool
[src]
Returns whether the capstone library was compiled in diet mode.