#[non_exhaustive]pub enum Error {
ModuleNotFound {
reason: &'static str,
os_error: u32,
},
ImageSizeUnknown {
base: usize,
os_error: u32,
},
Malformed(&'static str),
Unsupported(&'static str),
SymbolNotFound {
module: String,
symbol: String,
},
OriginalUnresolved {
module: String,
library: String,
symbol: String,
},
AuthenticatedSlot {
module: String,
symbol: String,
},
Protect {
slot: usize,
os_error: u32,
},
RestoreConflict {
slot: usize,
expected: usize,
found: usize,
},
}Expand description
Errors produced by the engine while acquiring, parsing, or patching a module.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ModuleNotFound
A requested module could not be located in the current process
(GetModuleHandleExW failed, or a null handle was supplied).
Fields
ImageSizeUnknown
The loader reported no valid mapped size for the module, so no bounded range exists to parse against.
Fields
Malformed(&'static str)
A structural defect was found while parsing the mapped image (PE or ELF). The parser bounds-checks every field against the validated mapped range before dereferencing, so a malformed image yields this error rather than
Unsupported(&'static str)
The image is a valid PE/ELF the engine intentionally does not handle at
runtime (e.g. a 32-bit PE32 image inside a 64-bit process, a legacy
absolute-VA delay-import descriptor, or an ELF machine that is not
EM_X86_64/EM_AARCH64). Reported rather than guessed.
SymbolNotFound
A Replacement marked required matched no import slot in the module.
Fields
OriginalUnresolved
A matched import’s canonical original entry point could not be resolved,
so passing through to it is impossible. This arises for a delay-load
import whose providing DLL cannot be loaded (or whose symbol is absent
from it): the delay IAT slot holds only the __delayLoadHelper2 stub
until first call, and the engine refuses to hand a stub out as the
original (calling it would resolve the import and overwrite the very slot
we patched, silently dropping the hook). Reported for a required
replacement; an optional one skips the slot instead.
Fields
AuthenticatedSlot
A matched import slot holds an authenticated (PAC-signed) pointer — an
it would require a replacement signed with the slot’s key, diversity, and
address-discrimination, which cannot be synthesized here; the engine refuses
the slot rather than write a pointer that fails its AUT* check (or is
dereferenced unsigned). arm64e support is a dedicated, device-tested effort;
plain arm64 and x86-64 slots are never authenticated and are unaffected.
Fields
Protect
Changing a slot page’s protection failed. Carries the slot address and the OS error. When this happens mid-install the engine rolls back every
Fields
RestoreConflict
During restore, a slot no longer held this guard’s replacement pointer, untouched and reports the conflict instead (compare-exchange restore,
Trait Implementations§
Source§impl Error for Error
impl Error for Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()