Skip to main content

PeError

Enum PeError 

Source
pub enum PeError {
Show 14 variants TooSmall { got: usize, need: usize, }, NotMz, BadELfanew { offset: u32, file_len: usize, }, NotPe, Pe32PlusUnsupported, BadOptionalHeaderMagic { magic: u16, }, UnsupportedMachine { machine: u16, }, DirectoryOutOfRange { name: &'static str, rva: u32, size: u32, }, ManagedPe, UnknownImportDll { dll: String, }, UnknownImportFunction { dll: String, name: String, }, SectionOutOfRange { name: String, raw_off: u32, raw_size: u32, }, BadRelocBlock { rva: u32, reason: &'static str, }, Trap(Trap),
}
Expand description

PE-loader-specific error variants.

Variants§

§

TooSmall

File too small to contain a DOS header.

Fields

§got: usize
§need: usize
§

NotMz

“MZ” signature missing at offset 0.

§

BadELfanew

e_lfanew points outside the file.

Fields

§offset: u32
§file_len: usize
§

NotPe

“PE\0\0” signature missing at e_lfanew.

§

Pe32PlusUnsupported

Optional-header magic indicates PE32+ (64-bit).

§

BadOptionalHeaderMagic

Optional-header magic is neither PE32 nor PE32+.

Fields

§magic: u16
§

UnsupportedMachine

File-header machine field is not IMAGE_FILE_MACHINE_I386.

Fields

§machine: u16
§

DirectoryOutOfRange

A directory entry refers to bytes outside the image.

Fields

§name: &'static str
§rva: u32
§size: u32
§

ManagedPe

IMAGE_DIRECTORY_ENTRY_COMHEADER non-zero — managed PE.

§

UnknownImportDll

Referenced DLL is not registered with the Win32 stub registry.

Fields

§

UnknownImportFunction

Specific function in a known DLL is not registered.

Fields

§name: String
§

SectionOutOfRange

Section SizeOfRawData overflows the file or VirtualSize overflows the section table.

Fields

§name: String
§raw_off: u32
§raw_size: u32
§

BadRelocBlock

Base relocation block was malformed.

Fields

§rva: u32
§reason: &'static str
§

Trap(Trap)

Memory-map operation traps. Wrapped here so the loader’s public API exposes a single error type.

Trait Implementations§

Source§

impl Clone for PeError

Source§

fn clone(&self) -> PeError

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PeError

Source§

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

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

impl Display for PeError

Source§

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

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

impl From<PeError> for Error

Source§

fn from(e: PeError) -> Self

Converts to this type from the input type.
Source§

impl From<Trap> for PeError

Source§

fn from(t: Trap) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for PeError

Source§

fn eq(&self, other: &PeError) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for PeError

Source§

impl StructuralPartialEq for PeError

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.