TestingRegistry

Struct TestingRegistry 

Source
pub struct TestingRegistry {
    pub cell: BTreeMap<String, MountedCell>,
    pub cached: RefCell<BTreeMap<RegHiveKey, String>>,
    pub counter: RefCell<isize>,
}
Expand description

Basic Registry for testing. Includes the user profile “S-1-5-21-1366093794-4292800403-1155380978-513”

Fields§

§cell: BTreeMap<String, MountedCell>§cached: RefCell<BTreeMap<RegHiveKey, String>>§counter: RefCell<isize>

Implementations§

Source§

impl TestingRegistry

Source

pub fn empty() -> Self

Source

pub fn new() -> Self

Source

pub fn increase_counter(&self) -> isize

Source

pub fn add_value(&mut self, path: &str, value: &str, data: RegValue)

Source

pub fn contains(&self, path: &str) -> bool

Source

pub fn get_value(&self, path: &str, value: &str) -> Option<RegValue>

Source

pub fn get_values(&self, path: &str) -> Option<Vec<String>>

Source

pub fn get_keys(&self, path: &str) -> Option<Vec<String>>

Trait Implementations§

Source§

impl Clone for TestingRegistry

Source§

fn clone(&self) -> TestingRegistry

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 Debug for TestingRegistry

Source§

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

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

impl Default for TestingRegistry

Source§

fn default() -> Self

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

impl RegistryReader for TestingRegistry

Source§

fn from_file( &self, _file: Box<dyn VirtualFile>, ) -> ForensicResult<Box<dyn RegistryReader>>

Mounts a registry reader in a hive file
Source§

fn from_fs( &self, _fs: Box<dyn VirtualFileSystem>, ) -> ForensicResult<Box<dyn RegistryReader>>

The Windows registry consists of numerous hives and we need access to all of them.
Source§

fn open_key( &self, hkey: RegHiveKey, key_name: &str, ) -> ForensicResult<RegHiveKey>

Opens a registry key. If the registry reader is a file based one it needs to do the same thing that the Window Kernel does: store a Map with the association of keys with the path they point to.
Source§

fn read_value( &self, hkey: RegHiveKey, value_name: &str, ) -> ForensicResult<RegValue>

Source§

fn enumerate_values(&self, hkey: RegHiveKey) -> ForensicResult<Vec<String>>

Source§

fn enumerate_keys(&self, hkey: RegHiveKey) -> ForensicResult<Vec<String>>

Source§

fn key_at(&self, hkey: RegHiveKey, pos: u32) -> ForensicResult<String>

Source§

fn value_at(&self, hkey: RegHiveKey, pos: u32) -> ForensicResult<String>

Source§

fn key_info(&self, hkey: RegHiveKey) -> ForensicResult<RegistryKeyInfo>

Retrieves information about the key. Emulates RegQueryInfoKey
Source§

fn close_key(&self, hkey: RegHiveKey)

Closes a handle to the specified registry key.
Source§

fn get_system_root(&self) -> ForensicResult<String>

Get the same value as the env var “%SystemRoot%”“. It’s usually “C:\Windows”
Source§

fn list_users(&self) -> ForensicResult<Vec<String>>

Source§

fn windows_build(&self) -> ForensicResult<u32>

Get the current build of Windows: See “RTM build” in https://en.wikipedia.org/wiki/Comparison_of_Microsoft_Windows_versions

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