Struct X86

Source
pub struct X86;
Expand description

Length disassembler for the x86 instruction set architecture.

Implementations§

Source§

impl X86

Source

pub fn ld(self, bytes: &[u8]) -> u32

Returns the length of the first opcode in the given byte slice.

When length disassembling fails, eg. the byte slice does not contain a complete and valid instruction, the return value is 0.

Source

pub fn peek(self, bytes: &[u8]) -> Option<&OpCode>

Returns the first opcode in the byte slice if successful.

Source

pub fn peek_mut(self, bytes: &mut [u8]) -> Option<&mut OpCode>

Returns the first opcode mutably in the byte slice if successful.

Source

pub fn iter<'a>(self, bytes: &'a [u8], va: u32) -> Iter<'a, X86>

Returns an iterator over the opcodes contained in the byte slice.

Given a virtual address to keep track of the instruction pointer.

Source

pub fn iter_mut<'a>(self, bytes: &'a mut [u8], va: u32) -> IterMut<'a, X86>

Returns an iterator over the opcodes contained in the byte slice.

Given a virtual address to keep track of the instruction pointer.

Trait Implementations§

Source§

impl Isa for X86

Source§

type Va = u32

Virtual address type.
Source§

fn ld(bytes: &[u8]) -> u32

Returns the length of the first opcode in the given byte slice. Read more
Source§

fn peek(bytes: &[u8]) -> Option<&OpCode>

Returns the first opcode in the byte slice if successful.
Source§

fn peek_mut(bytes: &mut [u8]) -> Option<&mut OpCode>

Returns the first opcode mutably in the byte slice if successful.
Source§

fn iter<'a>(bytes: &'a [u8], va: Self::Va) -> Iter<'a, Self>

Returns an iterator over the opcodes contained in the byte slice. Read more
Source§

fn iter_mut<'a>(bytes: &'a mut [u8], va: Self::Va) -> IterMut<'a, Self>

Returns an iterator over the opcodes contained in the byte slice. Read more

Auto Trait Implementations§

§

impl Freeze for X86

§

impl RefUnwindSafe for X86

§

impl Send for X86

§

impl Sync for X86

§

impl Unpin for X86

§

impl UnwindSafe for X86

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>,

Source§

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>,

Source§

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.