Struct MemoryAccess
pub struct MemoryAccess<A: Arch> {
pub kind: AccessKind,
pub inputs: Inputs<A>,
pub size: Range<u64>,
pub calculation: AddressComputation,
pub alignment: usize,
}
Expand description
A memory access.
Fields§
§kind: AccessKind
The type of access that is performed.
inputs: Inputs<A>
The inputs for calculation
.
size: Range<u64>
The determined size range of the access. The lower bound is the largest number of bytes that could be observed as being acesssed. The upper bound is set to one below the smallest byte index for which we could observe that it was not accessed.
calculation: AddressComputation
A simple expression for the calculation of the address of the form i1 + i2 + .. + i_k * c + i_k+1 + i_k+1 .. i_n + c. That is, all inputs are summed, one input can be multiplied by a certain factor, which is then offset by a constant value c. This allows for the computation of most common addresses. It speeds up enumeration by ~20% on average up to ~40% in extreme cases. Obviously the speedup gets bigger if the amount of memory accesses increases or if the number of randomize_new() and adapt() calls is greater.
alignment: usize
An alignment of 1 means that every address is OK. An alignment of 2 means that only addresses of the form 2n are ok. An alignment of 4 means that addresses of the form 4n are OK. Etc. NOTE: Only powers of 2 are acceptable values. Any other value will produce unspecified behavior.
Implementations§
§impl<A: Arch> MemoryAccess<A>
impl<A: Arch> MemoryAccess<A>
pub fn compute_address(&self, state: &SystemState<A>) -> Addr
pub fn compute_address(&self, state: &SystemState<A>) -> Addr
Computes the address that this memory access will access, given the provided CPU state.
pub fn has_fixed_addr(&self) -> bool
pub fn has_fixed_addr(&self) -> bool
Returns true if the memory address is fixed or only dependent on immediate values in the instruction.
pub fn compute_fixed_addr(&self) -> Addr
pub fn compute_fixed_addr(&self) -> Addr
Computes the fixed address for this access.
Only returns a valid value if Self::has_fixed_addr
returns true.
Trait Implementations§
§impl<A: Clone + Arch> Clone for MemoryAccess<A>
impl<A: Clone + Arch> Clone for MemoryAccess<A>
§fn clone(&self) -> MemoryAccess<A>
fn clone(&self) -> MemoryAccess<A>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl<A: Arch> Debug for MemoryAccess<A>
impl<A: Arch> Debug for MemoryAccess<A>
§impl<'de, A: Arch> Deserialize<'de> for MemoryAccess<A>
impl<'de, A: Arch> Deserialize<'de> for MemoryAccess<A>
§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
§impl<A: Arch> Display for MemoryAccess<A>
impl<A: Arch> Display for MemoryAccess<A>
§impl<A: Hash + Arch> Hash for MemoryAccess<A>
impl<A: Hash + Arch> Hash for MemoryAccess<A>
§impl<A> JsonSchema for MemoryAccess<A>
impl<A> JsonSchema for MemoryAccess<A>
§fn schema_name() -> String
fn schema_name() -> String
§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref
keyword. Read more§impl<A: PartialEq + Arch> PartialEq for MemoryAccess<A>
impl<A: PartialEq + Arch> PartialEq for MemoryAccess<A>
§impl<A: Arch> Serialize for MemoryAccess<A>
impl<A: Arch> Serialize for MemoryAccess<A>
impl<A: Eq + Arch> Eq for MemoryAccess<A>
impl<A: Arch> StructuralPartialEq for MemoryAccess<A>
Auto Trait Implementations§
impl<A> Freeze for MemoryAccess<A>
impl<A> RefUnwindSafe for MemoryAccess<A>
impl<A> Send for MemoryAccess<A>
impl<A> Sync for MemoryAccess<A>
impl<A> Unpin for MemoryAccess<A>
impl<A> UnwindSafe for MemoryAccess<A>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more