regf
A Rust library for parsing, manipulating, and writing Windows Registry hive files (regf format).
Features
- Parse binary registry hive files (
.dat,NTUSER.DAT, etc.) - Navigate and read registry keys and values
- Create new registry hives from scratch
- Export hives to
.regtext format - Import
.regfiles to binary hive format
Installation
[]
= "0.1"
Quick Start
Reading a Registry Hive
use RegistryHive;
let hive = from_file?;
let root = hive.root_key?;
// Navigate to a key
let key = hive.open_key?;
// Read values
for value in key.values?
// Iterate subkeys
for subkey in key.subkeys?
Creating a New Hive
use ;
let mut builder = new;
let root = builder.root_offset;
// Add keys
let software = builder.add_key?;
let app = builder.add_key?;
// Add values
builder.add_value?;
// Write to file
builder.write_to_file?;
Export to .reg Format
use ;
let hive = from_file?;
let options = RegExportOptions ;
let exporter = new;
exporter.export_to_file?;
Import from .reg Format
use ;
// Quick conversion
reg_file_to_hive_file?;
// Or with options
let importer = from_file?;
importer.build_hive_to_file?;
Supported Data Types
| Type | Description |
|---|---|
REG_SZ |
String |
REG_EXPAND_SZ |
Expandable string |
REG_BINARY |
Binary data |
REG_DWORD |
32-bit integer |
REG_QWORD |
64-bit integer |
REG_MULTI_SZ |
Multi-string |
License
MIT