Struct capstone_sys::cs_insn

source ·
#[repr(C)]
pub struct cs_insn { pub id: c_uint, pub address: u64, pub size: u16, pub bytes: [u8; 24], pub mnemonic: [c_char; 32], pub op_str: [c_char; 160], pub detail: *mut cs_detail, }
Expand description

Detail information of disassembled instruction

Fields§

§id: c_uint

Instruction ID (basically a numeric ID for the instruction mnemonic) Find the instruction id in the ‘[ARCH]_insn’ enum in the header file of corresponding architecture, such as ‘arm_insn’ in arm.h for ARM, ‘x86_insn’ in x86.h for X86, etc… This information is available even when CS_OPT_DETAIL = CS_OPT_OFF NOTE: in Skipdata mode, “data” instruction has 0 for this id field.

§address: u64

Address (EIP) of this instruction This information is available even when CS_OPT_DETAIL = CS_OPT_OFF

§size: u16

Size of this instruction This information is available even when CS_OPT_DETAIL = CS_OPT_OFF

§bytes: [u8; 24]

Machine bytes of this instruction, with number of bytes indicated by @size above This information is available even when CS_OPT_DETAIL = CS_OPT_OFF

§mnemonic: [c_char; 32]

Ascii text of instruction mnemonic This information is available even when CS_OPT_DETAIL = CS_OPT_OFF

§op_str: [c_char; 160]

Ascii text of instruction operands This information is available even when CS_OPT_DETAIL = CS_OPT_OFF

§detail: *mut cs_detail

Pointer to cs_detail. NOTE: detail pointer is only valid when both requirements below are met: (1) CS_OP_DETAIL = CS_OPT_ON (2) Engine is not in Skipdata mode (CS_OP_SKIPDATA option set to CS_OPT_ON)

NOTE 2: when in Skipdata mode, or when detail mode is OFF, even if this pointer is not NULL, its content is still irrelevant.

Trait Implementations§

source§

impl Debug for cs_insn

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.