#[repr(C)]pub struct Decoder { /* private fields */ }
Implementations
Creates a new Decoder
with the given machine_mode
and
address_width
.
Enables or disables (depending on the value
) the given decoder mode
:
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>ⓘNotable traits for InstructionIterator<'_, '_>impl Iterator for InstructionIterator<'_, '_> type Item = (DecodedInstruction, u64);
pub fn instruction_iterator<'a, 'b>(
&'a self,
buffer: &'b [u8],
ip: u64
) -> InstructionIterator<'a, 'b>ⓘNotable traits for InstructionIterator<'_, '_>impl Iterator for InstructionIterator<'_, '_> type Item = (DecodedInstruction, u64);
Notable traits for InstructionIterator<'_, '_>
impl Iterator for InstructionIterator<'_, '_> type Item = (DecodedInstruction, u64);
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 UnwindSafe for Decoder
Blanket Implementations
Mutably borrows from an owned value. Read more