Skip to main content

Crate plthook

Crate plthook 

Source
Expand description

plthook is a pure-Rust import-table rebinding engine.

It enumerates imports in loaded Windows PE, Linux ELF, macOS Mach-O, and iOS/iPadOS Mach-O modules. Installing a replacement resolves every target first, changes page protection only as needed, swaps slots atomically, and restores a slot only when the guard still owns it.

The binary-format parsers are bounds-checked and host-independent; the live backends provide module discovery, page protection, and original-symbol lookup.

Structs§

HookGuard
RAII owner of a set of installed hooks. Dropping it restores the original slot values (best-effort, compare-exchange); HookGuard::uninstall does the same but surfaces any conflict.
ImportSlot
A single writable import slot discovered in a module.
InstalledHook
One installed hook: enough to restore it and to hand the caller the original.
Module
A validated, currently-loaded ELF object.
Replacement
A requested slot replacement.

Enums§

Error
Errors produced by the engine while acquiring, parsing, or patching a module.
ImportKind
How an import reaches its slot: a normal load-time binding or a delay-load
Symbol
An imported symbol, identified either by name or by ordinal.

Functions§

install
Install a set of Replacements into module’s import table, transactionally.

Type Aliases§

Result
Crate-local result alias.