pub struct AddressContext {
pub va: Va,
pub root: Pa,
}
Expand description
A complete address context within a system for virtual to physical address translation.
In virtual machine introspection (VMI) and memory analysis, it’s often
necessary to work with addresses from different processes or memory spaces.
The AddressContext
struct encapsulates both a virtual address and the
corresponding translation root, providing all the information needed to
accurately translate the virtual address to a physical address.
The AddressContext
is commonly used as an input to memory access or
translation functions in VMI tools, ensuring that the correct translation
context is applied for each memory operation.
§Example
let user_space_address = AddressContext {
va: Va(0x7ffe0000),
root: Pa(0x1000000), // CR3 value for a specific process
};
let kernel_space_address = AddressContext {
va: Va(0xfffff80000000000),
root: Pa(0x2000000), // CR3 value for kernel space
};
// These contexts can then be used in memory operations
// vmi.read(user_space_address, &mut buffer)?;
// vmi.translate_address(kernel_space_address)?;
Fields§
§va: Va
The virtual address.
root: Pa
The translation root, typically the base of the page table hierarchy (e.g., CR3 in x86).
Implementations§
Trait Implementations§
Source§impl Add<u64> for AddressContext
impl Add<u64> for AddressContext
Source§impl Add for AddressContext
impl Add for AddressContext
Source§type Output = AddressContext
type Output = AddressContext
The resulting type after applying the
+
operator.Source§impl AddAssign<u64> for AddressContext
impl AddAssign<u64> for AddressContext
Source§fn add_assign(&mut self, rhs: u64)
fn add_assign(&mut self, rhs: u64)
Performs the
+=
operation. Read moreSource§impl AddAssign for AddressContext
impl AddAssign for AddressContext
Source§fn add_assign(&mut self, rhs: AddressContext)
fn add_assign(&mut self, rhs: AddressContext)
Performs the
+=
operation. Read moreSource§impl BitAnd<u64> for AddressContext
impl BitAnd<u64> for AddressContext
Source§impl BitAndAssign<u64> for AddressContext
impl BitAndAssign<u64> for AddressContext
Source§fn bitand_assign(&mut self, rhs: u64)
fn bitand_assign(&mut self, rhs: u64)
Performs the
&=
operation. Read moreSource§impl BitOr<u64> for AddressContext
impl BitOr<u64> for AddressContext
Source§impl BitOrAssign<u64> for AddressContext
impl BitOrAssign<u64> for AddressContext
Source§fn bitor_assign(&mut self, rhs: u64)
fn bitor_assign(&mut self, rhs: u64)
Performs the
|=
operation. Read moreSource§impl Clone for AddressContext
impl Clone for AddressContext
Source§fn clone(&self) -> AddressContext
fn clone(&self) -> AddressContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for AddressContext
impl Debug for AddressContext
Source§impl<'de> Deserialize<'de> for AddressContext
impl<'de> Deserialize<'de> for AddressContext
Source§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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for AddressContext
impl Display for AddressContext
Source§impl Div<u64> for AddressContext
impl Div<u64> for AddressContext
Source§impl Div for AddressContext
impl Div for AddressContext
Source§type Output = AddressContext
type Output = AddressContext
The resulting type after applying the
/
operator.Source§impl DivAssign<u64> for AddressContext
impl DivAssign<u64> for AddressContext
Source§fn div_assign(&mut self, rhs: u64)
fn div_assign(&mut self, rhs: u64)
Performs the
/=
operation. Read moreSource§impl DivAssign for AddressContext
impl DivAssign for AddressContext
Source§fn div_assign(&mut self, rhs: AddressContext)
fn div_assign(&mut self, rhs: AddressContext)
Performs the
/=
operation. Read moreSource§impl From<AddressContext> for AccessContext
impl From<AddressContext> for AccessContext
Source§fn from(value: AddressContext) -> Self
fn from(value: AddressContext) -> Self
Converts to this type from the input type.
Source§impl Hash for AddressContext
impl Hash for AddressContext
Source§impl Mul<u64> for AddressContext
impl Mul<u64> for AddressContext
Source§impl Mul for AddressContext
impl Mul for AddressContext
Source§type Output = AddressContext
type Output = AddressContext
The resulting type after applying the
*
operator.Source§impl MulAssign<u64> for AddressContext
impl MulAssign<u64> for AddressContext
Source§fn mul_assign(&mut self, rhs: u64)
fn mul_assign(&mut self, rhs: u64)
Performs the
*=
operation. Read moreSource§impl MulAssign for AddressContext
impl MulAssign for AddressContext
Source§fn mul_assign(&mut self, rhs: AddressContext)
fn mul_assign(&mut self, rhs: AddressContext)
Performs the
*=
operation. Read moreSource§impl Ord for AddressContext
impl Ord for AddressContext
Source§fn cmp(&self, other: &AddressContext) -> Ordering
fn cmp(&self, other: &AddressContext) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for AddressContext
impl PartialEq for AddressContext
Source§impl PartialOrd for AddressContext
impl PartialOrd for AddressContext
Source§impl Serialize for AddressContext
impl Serialize for AddressContext
Source§impl Sub<u64> for AddressContext
impl Sub<u64> for AddressContext
Source§impl Sub for AddressContext
impl Sub for AddressContext
Source§type Output = AddressContext
type Output = AddressContext
The resulting type after applying the
-
operator.Source§impl SubAssign<u64> for AddressContext
impl SubAssign<u64> for AddressContext
Source§fn sub_assign(&mut self, rhs: u64)
fn sub_assign(&mut self, rhs: u64)
Performs the
-=
operation. Read moreSource§impl SubAssign for AddressContext
impl SubAssign for AddressContext
Source§fn sub_assign(&mut self, rhs: AddressContext)
fn sub_assign(&mut self, rhs: AddressContext)
Performs the
-=
operation. Read moreimpl Copy for AddressContext
impl Eq for AddressContext
impl StructuralPartialEq for AddressContext
Auto Trait Implementations§
impl Freeze for AddressContext
impl RefUnwindSafe for AddressContext
impl Send for AddressContext
impl Sync for AddressContext
impl Unpin for AddressContext
impl UnwindSafe for AddressContext
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.