Struct object::pe::ImageDosHeader

source ·
#[repr(C)]
pub struct ImageDosHeader {
Show 19 fields 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>,
}
Expand description

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§

source§

impl ImageDosHeader

source

pub fn parse<'data, R: ReadRef<'data>>(data: R) -> Result<&'data Self>

Read the DOS header.

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

source

pub fn nt_headers_offset(&self) -> u32

Return the file offset of the nt_headers.

Trait Implementations§

source§

impl Clone for ImageDosHeader

source§

fn clone(&self) -> ImageDosHeader

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for ImageDosHeader

source§

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

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

impl Copy for ImageDosHeader

source§

impl Pod for ImageDosHeader

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere T: Clone,

§

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, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.