#[non_exhaustive]pub enum Error {
Show 15 variants
AlreadyHooked {
address: usize,
},
NotEnoughSpace {
address: usize,
},
UnrelocatableInstruction {
address: usize,
},
InvalidInstruction {
address: usize,
},
NoNearMemory {
address: usize,
},
NotExecutable {
address: usize,
},
SameAddress {
address: usize,
},
TargetModified {
address: usize,
},
ThreadNotRelocatable,
Assembly {
address: usize,
reason: String,
},
Os(OsError),
InvalidPattern {
pattern: String,
position: usize,
},
PatternNotFound {
pattern: String,
},
PatternNotUnique {
pattern: String,
matches: usize,
},
ModuleNotFound {
name: String,
},
}Expand description
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
AlreadyHooked
A detour or injection is already installed at this address; hooks aren’t chained.
NotEnoughSpace
The target is too small to patch and has no usable padding or hot-patch area.
UnrelocatableInstruction
A displaced instruction can’t be relocated to the trampoline, such as a relative branch that would be out of range.
InvalidInstruction
The target does not begin with a valid instruction.
NoNearMemory
No executable memory could be allocated within branch range of the target.
NotExecutable
The address is not executable memory.
SameAddress
The target and the detour are the same address.
TargetModified
A third party changed the code at the address since the hook was installed, so it can’t be toggled safely.
ThreadNotRelocatable
A thread suspended for patching is running code that can’t be relocated.
Assembly
The assembly supplied to an injection could not be encoded.
Fields
Os(OsError)
An operating system call failed, such as changing memory protection or suspending a thread.
InvalidPattern
A scan pattern can’t be parsed, or doesn’t spell out the
call that follow_call needs.
Fields
PatternNotFound
A pattern matched nowhere in the module’s code.
PatternNotUnique
A pattern matched more than once, so it can’t tell which place is meant.
ModuleNotFound
No loaded module has the name a scan was given.
Trait Implementations§
impl Eq for Error
Source§impl Error for Error
impl Error for Error
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()