pub struct Header<'a> {
pub dos_header: DosHeader,
pub dos_stub: DosStub<'a>,
pub rich_header: Option<RichHeader<'a>>,
pub signature: u32,
pub coff_header: CoffHeader,
pub optional_header: Option<OptionalHeader>,
}Expand description
The PE header.
§Position in a modern PE file
The PE header is located at the very beginning of the file and is followed by the section table and sections.
Fields§
§dos_header: DosHeader§dos_stub: DosStub<'a>DOS program for legacy loaders
rich_header: Option<RichHeader<'a>>§signature: u32PE Magic: PE\0\0, little endian
coff_header: CoffHeader§optional_header: Option<OptionalHeader>Implementations§
Source§impl<'a> Header<'a>
impl<'a> Header<'a>
Sourcepub fn parse(bytes: &'a [u8]) -> Result<Self>
pub fn parse(bytes: &'a [u8]) -> Result<Self>
Parses PE header from the given bytes; this will fail if the DosHeader or DosStub is malformed or missing in some way
Sourcepub fn parse_without_dos(bytes: &'a [u8]) -> Result<Self>
pub fn parse_without_dos(bytes: &'a [u8]) -> Result<Self>
Parses PE header from the given bytes, a default DosHeader and DosStub are generated, and any malformed header or stub is ignored
Trait Implementations§
impl<'a> Copy for Header<'a>
Source§impl<'a> PartialEq for Header<'a>
impl<'a> PartialEq for Header<'a>
impl<'a> StructuralPartialEq for Header<'a>
Auto Trait Implementations§
impl<'a> Freeze for Header<'a>
impl<'a> RefUnwindSafe for Header<'a>
impl<'a> Send for Header<'a>
impl<'a> Sync for Header<'a>
impl<'a> Unpin for Header<'a>
impl<'a> UnsafeUnpin for Header<'a>
impl<'a> UnwindSafe for Header<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more