[][src]Struct object::pe::ImageDosHeader

#[repr(C)]pub struct ImageDosHeader {
    pub e_magic: U16<LE>,
    pub e_cblp: U16<LE>,
    pub e_cp: U16<LE>,
    pub e_crlc: U16<LE>,
    pub e_cparhdr: U16<LE>,
    pub e_minalloc: U16<LE>,
    pub e_maxalloc: U16<LE>,
    pub e_ss: U16<LE>,
    pub e_sp: U16<LE>,
    pub e_csum: U16<LE>,
    pub e_ip: U16<LE>,
    pub e_cs: U16<LE>,
    pub e_lfarlc: U16<LE>,
    pub e_ovno: U16<LE>,
    pub e_res: [U16<LE>; 4],
    pub e_oemid: U16<LE>,
    pub e_oeminfo: U16<LE>,
    pub e_res2: [U16<LE>; 10],
    pub e_lfanew: U32<LE>,
}

DOS .EXE header

Fields

e_magic: U16<LE>

Magic number

e_cblp: U16<LE>

Bytes on last page of file

e_cp: U16<LE>

Pages in file

e_crlc: U16<LE>

Relocations

e_cparhdr: U16<LE>

Size of header in paragraphs

e_minalloc: U16<LE>

Minimum extra paragraphs needed

e_maxalloc: U16<LE>

Maximum extra paragraphs needed

e_ss: U16<LE>

Initial (relative) SS value

e_sp: U16<LE>

Initial SP value

e_csum: U16<LE>

Checksum

e_ip: U16<LE>

Initial IP value

e_cs: U16<LE>

Initial (relative) CS value

e_lfarlc: U16<LE>

File address of relocation table

e_ovno: U16<LE>

Overlay number

e_res: [U16<LE>; 4]

Reserved words

e_oemid: U16<LE>

OEM identifier (for e_oeminfo)

e_oeminfo: U16<LE>

OEM information; e_oemid specific

e_res2: [U16<LE>; 10]

Reserved words

e_lfanew: U32<LE>

File address of new exe header

Implementations

impl ImageDosHeader[src]

pub fn parse<'data>(data: Bytes<'data>) -> Result<&'data Self>[src]

Read the DOS header.

Also checks that the e_magic field in the header is valid.

pub fn nt_headers<'data, Pe: ImageNtHeaders>(
    &self,
    data: Bytes<'data>
) -> Result<(&'data Pe, &'data [ImageDataDirectory], Bytes<'data>)>
[src]

Read the NT headers, including the data directories.

The given data must be for the entire file. Returns the data following the NT headers, which will contain the section headers.

Also checks that the signature and magic fields in the headers are valid.

Trait Implementations

impl Clone for ImageDosHeader[src]

impl Copy for ImageDosHeader[src]

impl Debug for ImageDosHeader[src]

impl Pod for ImageDosHeader[src]

Auto Trait Implementations

impl Send for ImageDosHeader

impl Sync for ImageDosHeader

impl Unpin for ImageDosHeader

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.