[][src]Struct zydis::ffi::Decoder

#[repr(C)]pub struct Decoder { /* fields omitted */ }

Implementations

impl Decoder[src]

pub fn new(
    machine_mode: MachineMode,
    address_width: AddressWidth
) -> Result<Self>
[src]

Creates a new Decoder with the given machine_mode and address_width.

pub fn enable_mode(&mut self, mode: DecoderMode, value: bool) -> Result<()>[src]

Enables or disables (depending on the value) the given decoder mode:

pub fn decode(&self, buffer: &[u8]) -> Result<Option<DecodedInstruction>>[src]

Decodes a single binary instruction to a DecodedInstruction.

Examples

use zydis::{AddressWidth, Decoder, MachineMode, Mnemonic};
static INT3: &'static [u8] = &[0xCC];
let decoder = Decoder::new(MachineMode::LONG_64, AddressWidth::_64).unwrap();

let instruction = decoder.decode(INT3).unwrap().unwrap();
assert_eq!(instruction.mnemonic, Mnemonic::INT3);

pub fn instruction_iterator<'a, 'b>(
    &'a self,
    buffer: &'b [u8],
    ip: u64
) -> InstructionIterator<'a, 'b>
[src]

Returns an iterator over all the instructions in the buffer.

The iterator ignores all errors and stops producing values in the case of an error.

Trait Implementations

impl Clone for Decoder[src]

impl Debug for Decoder[src]

Auto Trait Implementations

impl RefUnwindSafe for Decoder

impl Send for Decoder

impl Sync for Decoder

impl Unpin for Decoder

impl UnwindSafe for Decoder

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.