Struct iced_x86::UsedMemory

source ·
pub struct UsedMemory { /* private fields */ }
Expand description

A memory location used by an instruction

Implementations§

source§

impl UsedMemory

source

pub const fn new( segment: Register, base: Register, index: Register, scale: u32, displacement: u64, memory_size: MemorySize, access: OpAccess ) -> Self

Creates a new instance

Arguments
  • segment: Effective segment register or Register::None if the segment register is ignored
  • base: Base register
  • index: Index register
  • scale: 1, 2, 4 or 8
  • displacement: Displacement
  • memory_size: Memory size
  • access: Access
source

pub fn new2( segment: Register, base: Register, index: Register, scale: u32, displacement: u64, memory_size: MemorySize, access: OpAccess, address_size: CodeSize, vsib_size: u32 ) -> Self

Creates a new instance

Arguments
  • segment: Effective segment register or Register::None if the segment register is ignored
  • base: Base register
  • index: Index register
  • scale: 1, 2, 4 or 8
  • displacement: Displacement
  • memory_size: Memory size
  • access: Access
  • address_size: Address size
  • vsib_size: VSIB size (0, 4 or 8)
source

pub const fn segment(&self) -> Register

Effective segment register or Register::None if the segment register is ignored

source

pub const fn base(&self) -> Register

Base register or Register::None if none

source

pub const fn index(&self) -> Register

Index register or Register::None if none

source

pub const fn scale(&self) -> u32

Index scale (1, 2, 4 or 8)

source

pub const fn displacement(&self) -> u64

Displacement

source

pub const fn memory_size(&self) -> MemorySize

Size of location

source

pub const fn access(&self) -> OpAccess

Memory access

source

pub const fn address_size(&self) -> CodeSize

Address size

source

pub const fn vsib_size(&self) -> u32

VSIB size (0, 4 or 8)

source

pub fn virtual_address<F>( &self, element_index: usize, get_register_value: F ) -> Option<u64>
where F: FnMut(Register, usize, usize) -> Option<u64>,

Gets the virtual address of a used memory location, or None if register resolution fails.

Arguments
  • get_register_value: Function that returns the value of a register or the base address of a segment register, or None on failure.
Call-back function args
  • Arg 1: register: Register. If it’s a segment register, the call-back should return the segment’s base address, not the segment’s register value.
  • Arg 2: element_index: Only used if it’s a vsib memory operand. This is the element index of the vector index register.
  • Arg 3: element_size: Only used if it’s a vsib memory operand. Size in bytes of elements in vector index register (4 or 8).

Trait Implementations§

source§

impl Clone for UsedMemory

source§

fn clone(&self) -> UsedMemory

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for UsedMemory

source§

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

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

impl Default for UsedMemory

source§

fn default() -> UsedMemory

Returns the “default value” for a type. Read more
source§

impl Hash for UsedMemory

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for UsedMemory

source§

fn eq(&self, other: &UsedMemory) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for UsedMemory

source§

impl Eq for UsedMemory

source§

impl StructuralEq for UsedMemory

source§

impl StructuralPartialEq for UsedMemory

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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.