[−][src]Struct capstone::Capstone
An instance of the capstone disassembler
Methods
impl Capstone
[src]
pub fn new() -> CapstoneBuilder
[src]
Create a new instance of the decompiler using the builder pattern interface.
This is the recommended interface to Capstone
.
use capstone::prelude::*; let cs = Capstone::new().x86().mode(arch::x86::ArchMode::Mode32).build();
pub fn new_raw<T: Iterator<Item = ExtraMode>>(
arch: Arch,
mode: Mode,
extra_mode: T,
endian: Option<Endian>
) -> CsResult<Capstone>
[src]
arch: Arch,
mode: Mode,
extra_mode: T,
endian: Option<Endian>
) -> CsResult<Capstone>
Create a new instance of the decompiler using the "raw" interface.
The user must ensure that only sensible Arch
/Mode
combinations are used.
use capstone::{Arch, Capstone, NO_EXTRA_MODE, Mode}; let cs = Capstone::new_raw(Arch::X86, Mode::Mode64, NO_EXTRA_MODE, None); assert!(cs.is_ok());
pub fn disasm_all<'a>(
&'a self,
code: &[u8],
addr: u64
) -> CsResult<Instructions<'a>>
[src]
&'a self,
code: &[u8],
addr: u64
) -> CsResult<Instructions<'a>>
Disassemble all instructions in buffer
pub fn disasm_count<'a>(
&'a self,
code: &[u8],
addr: u64,
count: usize
) -> CsResult<Instructions<'a>>
[src]
&'a self,
code: &[u8],
addr: u64,
count: usize
) -> CsResult<Instructions<'a>>
Disassemble count
instructions in code
pub fn set_extra_mode<T: Iterator<Item = ExtraMode>>(
&mut self,
extra_mode: T
) -> CsResult<()>
[src]
&mut self,
extra_mode: T
) -> CsResult<()>
Set extra modes in addition to normal mode
pub fn set_syntax(&mut self, syntax: Syntax) -> CsResult<()>
[src]
Set the assembly syntax (has no effect on some platforms)
pub fn set_endian(&mut self, endian: Endian) -> CsResult<()>
[src]
Set the endianness (has no effect on some platforms).
pub fn set_mode(&mut self, mode: 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.
pub 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.
pub fn set_skipdata(&mut self, enable_skipdata: bool) -> CsResult<()>
[src]
Controls whether capstone will skip over invalid or data instructions.
Pass true
to enable skipdata or false
to disable skipdata.
pub fn reg_name(&self, reg_id: RegId) -> Option<String>
[src]
Converts a register id reg_id
to a String
containing the register name.
pub fn insn_name(&self, insn_id: InsnId) -> Option<String>
[src]
Converts an instruction id insn_id
to a String
containing the instruction name.
Note: This function ignores the current syntax and uses the default syntax.
pub fn group_name(&self, group_id: InsnGroupId) -> Option<String>
[src]
Converts a group id group_id
to a String
containing the group name.
pub fn insn_detail<'s, 'i: 's>(
&'s self,
insn: &'i Insn
) -> CsResult<InsnDetail<'i>>
[src]
&'s self,
insn: &'i Insn
) -> CsResult<InsnDetail<'i>>
Returns Detail
structure for a given instruction
Requires:
- Instruction was created with detail enabled
- Skipdata is disabled
- Capstone was not compiled in diet mode
pub fn lib_version() -> (u32, u32)
[src]
Returns a tuple (major, minor) indicating the version of the capstone C library.
pub fn supports_arch(arch: Arch) -> bool
[src]
Returns whether the capstone library supports a given architecture.
pub fn is_diet() -> bool
[src]
Returns whether the capstone library was compiled in diet mode.
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,