Struct capstone_rust::capstone::Details
[−]
[src]
pub struct Details { pub regs_read: Vec<u32>, pub regs_write: Vec<u32>, pub groups: Vec<u32>, pub arch: DetailsArch, }
Details of an instruction.
If CS_OPT_DETAIL is on, Instr.detail
will be filled with this struct, that you can use to get
some details of an instruction (e.g. registers read, modified, ...).
Examples
use capstone_rust::capstone as cs; let code = vec![0x01, 0xc3]; // add ebx, eax let dec = cs::Capstone::new(cs::cs_arch::CS_ARCH_X86, cs::cs_mode::CS_MODE_32).unwrap(); dec.option(cs::cs_opt_type::CS_OPT_DETAIL, cs::cs_opt_value::CS_OPT_ON).unwrap(); let buf = dec.disasm(code.as_slice(), 0, 0).unwrap(); let detail = buf.get(0).unwrap().detail.unwrap(); // `buf` contains only one 'add'. assert_eq!(dec.reg_name(detail.regs_write[0]), Some("eflags"));
Fields
regs_read: Vec<u32>
List of implicit registers read by this insn.
regs_write: Vec<u32>
List of implicit registers modified by this insn.
groups: Vec<u32>
List of group this instruction belong to.
arch: DetailsArch
Architecture-specific details.