pub struct BlockIoHookEngine { /* private fields */ }Expand description
Installs and removes Block IO read/write hooks for the target volume, and holds the cipher supplier used by the hooked paths.
The engine owns the saved original function pointers so uninstall can
restore the protocol vtables to their pristine state before chainloading.
Implementations§
Source§impl BlockIoHookEngine
impl BlockIoHookEngine
Sourcepub fn new(
geometry: HookGeometry,
cipher_supplier: Box<dyn VolumeCipherSupplier>,
) -> VckResult<Self>
pub fn new( geometry: HookGeometry, cipher_supplier: Box<dyn VolumeCipherSupplier>, ) -> VckResult<Self>
Creates an engine bound to the given geometry and the sample-selected cipher supplier.
Sourcepub fn install(&mut self) -> VckResult<()>
pub fn install(&mut self) -> VckResult<()>
Locates the target volume’s Block IO protocol(s), saves the original
ReadBlocks / WriteBlocks function pointers, and replaces the vtable
entries with our hooks.
Matching is done by GPT partition GUID (carried by the handover payload /
loader config). Both EFI_BLOCK_IO_PROTOCOL read and write are hooked.
Sourcepub fn uninstall(&mut self) -> VckResult<()>
pub fn uninstall(&mut self) -> VckResult<()>
Restores all hooked vtables to their original function pointers.
NOTE: in the normal boot flow the hooks intentionally remain installed across the chainload (the OS loader keeps reading/writing through them), so this is only used for error-path cleanup.