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
impl TestingRegistry
pub fn empty() -> Self
pub fn new() -> Self
pub fn increase_counter(&self) -> isize
pub fn add_value(&mut self, path: &str, value: &str, data: RegValue)
pub fn contains(&self, path: &str) -> bool
pub fn get_value(&self, path: &str, value: &str) -> Option<RegValue>
pub fn get_values(&self, path: &str) -> Option<Vec<String>>
pub fn get_keys(&self, path: &str) -> Option<Vec<String>>
Trait Implementations§
Source§impl Clone for TestingRegistry
impl Clone for TestingRegistry
Source§fn clone(&self) -> TestingRegistry
fn clone(&self) -> TestingRegistry
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 TestingRegistry
impl Debug for TestingRegistry
Source§impl Default for TestingRegistry
impl Default for TestingRegistry
Source§impl RegistryReader for TestingRegistry
impl RegistryReader for TestingRegistry
Source§fn from_file(
&self,
_file: Box<dyn VirtualFile>,
) -> ForensicResult<Box<dyn RegistryReader>>
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>>
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>
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.
fn read_value( &self, hkey: RegHiveKey, value_name: &str, ) -> ForensicResult<RegValue>
fn enumerate_values(&self, hkey: RegHiveKey) -> ForensicResult<Vec<String>>
fn enumerate_keys(&self, hkey: RegHiveKey) -> ForensicResult<Vec<String>>
fn key_at(&self, hkey: RegHiveKey, pos: u32) -> ForensicResult<String>
fn value_at(&self, hkey: RegHiveKey, pos: u32) -> ForensicResult<String>
Source§fn key_info(&self, hkey: RegHiveKey) -> ForensicResult<RegistryKeyInfo>
fn key_info(&self, hkey: RegHiveKey) -> ForensicResult<RegistryKeyInfo>
Retrieves information about the key. Emulates RegQueryInfoKey
Source§fn close_key(&self, hkey: RegHiveKey)
fn close_key(&self, hkey: RegHiveKey)
Closes a handle to the specified registry key.
Source§fn get_system_root(&self) -> ForensicResult<String>
fn get_system_root(&self) -> ForensicResult<String>
Get the same value as the env var “%SystemRoot%”“. It’s usually “C:\Windows”
fn list_users(&self) -> ForensicResult<Vec<String>>
Source§fn windows_build(&self) -> ForensicResult<u32>
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§
impl !Freeze for TestingRegistry
impl !RefUnwindSafe for TestingRegistry
impl Send for TestingRegistry
impl !Sync for TestingRegistry
impl Unpin for TestingRegistry
impl UnwindSafe for TestingRegistry
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