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.
NotMz
“MZ” signature missing at offset 0.
BadELfanew
e_lfanew points outside the file.
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+.
UnsupportedMachine
File-header machine field is not IMAGE_FILE_MACHINE_I386.
DirectoryOutOfRange
A directory entry refers to bytes outside the image.
ManagedPe
IMAGE_DIRECTORY_ENTRY_COMHEADER non-zero — managed PE.
UnknownImportDll
Referenced DLL is not registered with the Win32 stub registry.
UnknownImportFunction
Specific function in a known DLL is not registered.
SectionOutOfRange
Section SizeOfRawData overflows the file or
VirtualSize overflows the section table.
BadRelocBlock
Base relocation block was malformed.
Trap(Trap)
Memory-map operation traps. Wrapped here so the loader’s public API exposes a single error type.