Skip to main content

Crate regf

Crate regf 

Source
Expand description

§regf - Windows Registry Hive File Parser

This crate provides functionality for parsing, manipulating, and writing Windows Registry hive files (regf format).

§Features

  • Parse regf/dat registry hive files
  • Read and modify registry keys and values
  • Write registry data back to disk
  • Export to .reg text format
  • Import from .reg text format

§Example

use regf::RegistryHive;

// Load a registry hive
let hive = RegistryHive::from_file("NTUSER.DAT").unwrap();

// Get the root key
let root = hive.root_key().unwrap();

// Iterate through subkeys
for subkey in root.subkeys().unwrap() {
    println!("Key: {}", subkey.name());
}

§Import .reg files

use regf::{reg_to_hive, reg_file_to_hive_file};

// Convert .reg to hive bytes
let hive_bytes = reg_to_hive("input.reg").unwrap();

// Or convert directly to file
reg_file_to_hive_file("input.reg", "output.dat").unwrap();

§Export to .reg format

use regf::{RegistryHive, reg_export::{RegExporter, RegExportOptions}};

let hive = RegistryHive::from_file("input.dat").unwrap();
let exporter = RegExporter::new(&hive, RegExportOptions::default());
exporter.export_to_file("output.reg").unwrap();

Re-exports§

pub use error::Error;
pub use error::Result;
pub use hive::RegistryHive;
pub use transaction_log::TransactionLog;
pub use reg_import::RegImporter;
pub use reg_import::RegImportOptions;
pub use reg_import::reg_to_hive;
pub use reg_import::reg_file_to_hive_file;
pub use writer::HiveBuilder;
pub use writer::KeyTreeNode;
pub use writer::KeyTreeValue;
pub use structures::*;

Modules§

error
Error types for the regf crate.
hive
High-level registry hive API.
parser
Low-level parser for registry hive files.
reg_export
Export registry hives to .reg text format.
reg_import
Import .reg text files to binary registry hives.
structures
Binary structures for the Windows Registry file format.
transaction_log
Transaction log file support.
writer
Registry hive writer.