[−][src]Struct zydis::ffi::Decoder
Implementations
impl Decoder
[src]
pub fn new(
machine_mode: MachineMode,
address_width: AddressWidth
) -> Result<Self>
[src]
machine_mode: MachineMode,
address_width: AddressWidth
) -> Result<Self>
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]
&'a self,
buffer: &'b [u8],
ip: u64
) -> InstructionIterator<'a, 'b>
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
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> 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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,