VmmRegValue

Struct VmmRegValue 

Source
pub struct VmmRegValue<'a> {
    pub name: String,
    pub path: String,
    pub raw_type: u32,
    pub raw_size: u32,
    /* private fields */
}
Expand description

Registry Value API.

The VmmRegValue info struct represents a registry value and also have additional access methods for parent key and the value itself.

Registry values may be addressed either by its full path or by hive address and hive path. Both addressing modes are shown in the examples below. Registry values are case sensitive.

§Created By

§Examples

// Retrieve a REG_SZ (string) reg value by its full path.
let regpath = "HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ProgramFilesDir";
let regvalue = vmm.reg_key(regpath)?
println!("{regvalue}");
if let Ok(VmmRegValueType::REG_SZ(s)) = regvalue.value() {
    println!("REG_SZ: {s}");
}
// Retrieve a REG_DWORD reg value using the hive path.
// (SOFTWARE hive example address: 0xffffba061a908000).
let regpath = "0xffffba061a908000\\ROOT\\Microsoft\\.NETFramework\\Enable64Bit";
let regvalue = vmm.reg_key(regpath)?
if let Ok(VmmRegValueType::REG_DWORD(dw)) = regvalue.value() {
    println!("REG_DWORD: 0x{:08x}", dw);
}

Fields§

§name: String

Value name.

§path: String

Path including key name.

§raw_type: u32

The raw type as specified by Windows REG_* constants.

§raw_size: u32

The raw data size in bytes.

Implementations§

Source§

impl VmmRegValue<'_>

Source

pub fn parent(&self) -> ResultEx<VmmRegKey<'_>>

Retrieve the parent registry key.

§Examples
let regkey_parent = regvalue.parent()?
println!("{regkey_parent");
Source

pub fn value(&self) -> ResultEx<VmmRegValueType>

Retrieve the registry value.

The registry value is returned as VmmRegValueType enum containing the relevant embedded value.

§Examples
// Retrieve a REG_SZ (string) reg value.
if let Ok(VmmRegValueType::REG_SZ(s)) = regvalue.value() {
    println!("REG_SZ: {s}");
}
// Retrieve a REG_DWORD reg value.
if let Ok(VmmRegValueType::REG_DWORD(dw)) = regvalue.value() {
    println!("REG_DWORD: 0x{:08x}", dw);
}
Source

pub fn raw_value(&self) -> ResultEx<Vec<u8>>

Retrieve the raw value bytes backing the actual value.

§Examples
let raw_value = vmmregvalue.raw_value()?;
println!("{:?}", raw_value.hex_dump());

Trait Implementations§

Source§

impl<'a> Clone for VmmRegValue<'a>

Source§

fn clone(&self) -> VmmRegValue<'a>

Returns a duplicate 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<'a> Debug for VmmRegValue<'a>

Source§

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

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

impl Display for VmmRegValue<'_>

Source§

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

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

impl PartialEq for VmmRegValue<'_>

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

§

impl<'a> Freeze for VmmRegValue<'a>

§

impl<'a> RefUnwindSafe for VmmRegValue<'a>

§

impl<'a> Send for VmmRegValue<'a>

§

impl<'a> Sync for VmmRegValue<'a>

§

impl<'a> Unpin for VmmRegValue<'a>

§

impl<'a> UnwindSafe for VmmRegValue<'a>

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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,

Source§

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

Source§

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

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.