pub struct MemoryAccessSize { /* private fields */ }

Implementations§

source§

impl MemoryAccessSize

source

pub fn bytes_size(&self) -> Option<u8>

return the number of bytes referenced by this memory access.

if the number of bytes cannot be confidently known by the instruction in isolation (as is the case for xsave/xrstor-style “operate on all processor state” instructions), this function will return None.

source

pub fn size_name(&self) -> &'static str

a human-friendly label for the number of bytes this memory access references.

there are some differences from size names that may be expected elsewhere; yaxpeax-x86 prefers to use consistent names for a width even if the way those bytes are used varies.

the sizes yaxpeax-x86 knows are as follows: | size (bytes) | name | |–––––––|————| | 1 | byte | | 2 | word | | 4 | dword | | 6 | far | | 8 | qword | | 10 | mword | | 16 | xmmword | | 32 | ymmword | | 64 | zmmword | | variable | ptr |

“mword” refers to an mmx-sized access - 80 bits, or 10 bytes. mword is also used for 64-bit far calls, because they reference a contiguous ten bytes; two bytes of segment selector and eight bytes of address.

“variable” accesses access a number of bytes dependent on the physical processor and its operating mode. this is particularly relevant for xsave/xrstor-style instructions.

Trait Implementations§

source§

impl Debug for MemoryAccessSize

source§

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

Formats the value using the given formatter. Read more
source§

impl Display for MemoryAccessSize

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> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
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.