WraithError

Enum WraithError 

Source
pub enum WraithError {
Show 52 variants UnsupportedWindowsVersion { major: u32, minor: u32, build: u32, }, UnsupportedArchitecture, InvalidPebAccess, InvalidTebAccess, CorruptedStructure { name: &'static str, reason: &'static str, }, NullPointer { context: &'static str, }, ModuleNotFound { name: String, }, AddressNotInModule { address: u64, }, ThreadNotFound { tid: u32, }, UnlinkFailed { module: String, reason: String, }, RelinkFailed { module: String, reason: String, }, ListCorrupted { list_type: ModuleListType, }, InvalidPeFormat { reason: String, }, AllocationFailed { size: usize, protection: u32, }, MappingFailed { section: String, reason: String, }, RelocationFailed { rva: u32, reason: String, }, ImportResolutionFailed { dll: String, function: String, }, ForwardedExport { forwarder: String, }, TlsCallbackFailed { index: usize, }, EntryPointFailed { status: i32, }, SyscallEnumerationFailed { reason: String, }, SyscallNotFound { name: String, }, SyscallFailed { name: String, status: i32, }, NtdllNotFound, HookDetectionFailed { function: String, reason: String, }, UnhookFailed { function: String, reason: String, }, IntegrityCheckFailed { function: String, }, CleanCopyUnavailable, HookInstallFailed { target: u64, reason: String, }, HookRestoreFailed { target: u64, reason: String, }, InstructionDecodeFailed { address: u64, reason: String, }, TrampolineAllocationFailed { near: u64, size: usize, }, HookConflict { target: u64, existing_type: String, }, InsufficientHookSpace { target: u64, available: usize, required: usize, }, ReadFailed { address: u64, size: usize, }, WriteFailed { address: u64, size: usize, }, ProtectionChangeFailed { address: u64, size: usize, }, PatternParseFailed { reason: String, }, ProcessOpenFailed { pid: u32, reason: String, }, ProcessNotFound { pid: u32, }, RemoteThreadFailed { reason: String, }, InjectionFailed { method: String, reason: String, }, RemoteModuleEnumFailed { reason: String, }, HandleDuplicateFailed { reason: String, }, SectionMappingFailed { reason: String, }, ApcQueueFailed { reason: String, }, ThreadContextFailed { reason: String, }, ThreadSuspendResumeFailed { reason: String, }, GadgetNotFound { gadget_type: &'static str, }, SpoofTrampolineFailed { reason: String, }, StackSynthesisFailed { reason: String, }, Win32Error { code: u32, context: &'static str, },
}
Expand description

all errors that can occur in wraith-rs

Variants§

§

UnsupportedWindowsVersion

windows version not supported by this library

Fields

§major: u32
§minor: u32
§build: u32
§

UnsupportedArchitecture

architecture not supported (e.g., ARM)

§

InvalidPebAccess

failed to access PEB

§

InvalidTebAccess

failed to access TEB

§

CorruptedStructure

structure data appears corrupted

Fields

§name: &'static str
§reason: &'static str
§

NullPointer

null pointer where non-null expected

Fields

§context: &'static str
§

ModuleNotFound

module with given name not found

Fields

§name: String
§

AddressNotInModule

address does not belong to any loaded module

Fields

§address: u64
§

ThreadNotFound

thread with given ID not found

Fields

§tid: u32
§

UnlinkFailed

failed to unlink module from PEB lists

Fields

§module: String
§reason: String
§

RelinkFailed

failed to restore module links

Fields

§module: String
§reason: String
§

ListCorrupted

PEB module list appears corrupted

Fields

§list_type: ModuleListType
§

InvalidPeFormat

PE file format invalid or unsupported

Fields

§reason: String
§

AllocationFailed

memory allocation failed

Fields

§size: usize
§protection: u32
§

MappingFailed

failed to map PE section

Fields

§section: String
§reason: String
§

RelocationFailed

failed to process relocation entry

Fields

§rva: u32
§reason: String
§

ImportResolutionFailed

failed to resolve import

Fields

§function: String
§

ForwardedExport

export is forwarded to another module

Fields

§forwarder: String
§

TlsCallbackFailed

TLS callback execution failed

Fields

§index: usize
§

EntryPointFailed

DllMain returned FALSE

Fields

§status: i32
§

SyscallEnumerationFailed

failed to enumerate syscalls from ntdll

Fields

§reason: String
§

SyscallNotFound

syscall with given name/hash not found

Fields

§name: String
§

SyscallFailed

syscall returned error status

Fields

§name: String
§status: i32
§

NtdllNotFound

ntdll.dll not found in loaded modules

§

HookDetectionFailed

failed to detect hooks in function

Fields

§function: String
§reason: String
§

UnhookFailed

failed to remove hook

Fields

§function: String
§reason: String
§

IntegrityCheckFailed

function integrity check failed

Fields

§function: String
§

CleanCopyUnavailable

clean copy of module not available

§

HookInstallFailed

failed to install inline hook

Fields

§target: u64
§reason: String
§

HookRestoreFailed

failed to restore hook

Fields

§target: u64
§reason: String
§

InstructionDecodeFailed

instruction decoding failed

Fields

§address: u64
§reason: String
§

TrampolineAllocationFailed

trampoline allocation failed

Fields

§near: u64
§size: usize
§

HookConflict

hook conflict detected (target already hooked)

Fields

§target: u64
§existing_type: String
§

InsufficientHookSpace

insufficient space for hook at target

Fields

§target: u64
§available: usize
§required: usize
§

ReadFailed

memory read operation failed

Fields

§address: u64
§size: usize
§

WriteFailed

memory write operation failed

Fields

§address: u64
§size: usize
§

ProtectionChangeFailed

failed to change memory protection

Fields

§address: u64
§size: usize
§

PatternParseFailed

failed to parse pattern string

Fields

§reason: String
§

ProcessOpenFailed

failed to open remote process

Fields

§pid: u32
§reason: String
§

ProcessNotFound

process with given ID not found

Fields

§pid: u32
§

RemoteThreadFailed

failed to create remote thread

Fields

§reason: String
§

InjectionFailed

failed to inject into remote process

Fields

§method: String
§reason: String
§

RemoteModuleEnumFailed

failed to enumerate remote modules

Fields

§reason: String
§

HandleDuplicateFailed

failed to duplicate handle

Fields

§reason: String
§

SectionMappingFailed

section mapping failed

Fields

§reason: String
§

ApcQueueFailed

APC queue operation failed

Fields

§reason: String
§

ThreadContextFailed

thread context operation failed

Fields

§reason: String
§

ThreadSuspendResumeFailed

thread suspend/resume failed

Fields

§reason: String
§

GadgetNotFound

no suitable gadget found for spoofing

Fields

§gadget_type: &'static str
§

SpoofTrampolineFailed

failed to build spoof trampoline

Fields

§reason: String
§

StackSynthesisFailed

stack frame synthesis failed

Fields

§reason: String
§

Win32Error

underlying Win32 API returned error

Fields

§code: u32
§context: &'static str

Implementations§

Source§

impl WraithError

Source

pub fn from_last_error(context: &'static str) -> Self

create Win32Error from GetLastError

Trait Implementations§

Source§

impl Debug for WraithError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for WraithError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for WraithError

Available on crate feature std only.
1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.