wim

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 27, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InjectWinPEPayload

func InjectWinPEPayload(bootWimPath, injectDir string, registryPatches ...RegistryPatch) error

func PatchDevcellWim

func PatchDevcellWim(wimPath string, imageNum int, registryPatches ...RegistryPatch) error

func PatchRegistry

func PatchRegistry(wim *wimlib.WIM, imageNum int, rp RegistryPatch) (cleanup func(), err error)

PatchRegistry extracts a registry hive from a WIM image, applies DWORD patches, and writes the modified hive back. The WIM is NOT overwritten — call wim.Overwrite() after all modifications are done. The returned cleanup function removes the temp directory holding the patched hive; call it AFTER wim.Overwrite() completes since wimlib needs the file to exist at overwrite time.

func VerifyRegistry

func VerifyRegistry(wim *wimlib.WIM, imageNum int, hivePath string, checks []DWordCheck) error

VerifyRegistry extracts a registry hive from a WIM image and verifies that every check's DWORD value matches the expectation. Returns the first non-optional mismatch as an error. Optional checks that fail (key/value missing) are silently skipped.

Types

type DWordCheck

type DWordCheck struct {
	KeyPath   string
	ValueName string
	Expected  uint32
	Optional  bool
}

DWordCheck describes a single registry DWORD expectation for VerifyRegistry.

func HyperVBootChecks

func HyperVBootChecks() []DWordCheck

HyperVBootChecks returns the registry value expectations corresponding to HyperVBootPatches. Use with VerifyRegistry to assert patches were applied correctly.

type RegistryPatch

type RegistryPatch struct {
	// HivePath is the path inside the WIM image
	// (e.g. `\Windows\System32\config\SYSTEM`).
	HivePath string
	// Patches are the DWORD values to overwrite.
	Patches []regedit.DWordPatch
}

RegistryPatch describes a set of DWORD modifications to apply to a registry hive inside a WIM image. The hive is extracted to a temp file, patched, and written back.

func HyperVBootPatches

func HyperVBootPatches() RegistryPatch

HyperVBootPatches returns the registry patches needed to make Hyper-V services start at boot in WinPE. Without these, hvservice has Start=3 (Manual) and never loads.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL