[][src]Struct mz16::header::Header

pub struct Header {
    pub signature: u16,
    pub extra_bytes: u16,
    pub pages: u16,
    pub reloc_items: u16,
    pub header_size: u16,
    pub min_alloc: u16,
    pub max_alloc: u16,
    pub init_ss: u16,
    pub init_sp: u16,
    pub checksum: u16,
    pub init_ip: u16,
    pub init_cs: u16,
    pub reloc_table: u16,
    pub overlay: u16,
}

A definition of a header in a 16 bit dos executable

Fields

signature: u16extra_bytes: u16pages: u16reloc_items: u16header_size: u16min_alloc: u16max_alloc: u16init_ss: u16init_sp: u16checksum: u16init_ip: u16init_cs: u16reloc_table: u16overlay: u16

Methods

impl Header[src]

pub fn from_words(words: [u16; 14]) -> Result<Header, HeaderError>[src]

Read a header from 14 16-bit words

pub fn new(bytes: &[u8]) -> Result<Header, HeaderError>[src]

Read a header from bytes

pub fn exe_data_start(&self) -> usize[src]

Get the start of the exe data

pub fn extra_data_start(&self) -> usize[src]

Get the start of the extra data

pub fn relocation_table_start(&self) -> usize[src]

Get the start of the relocation table

pub fn relocation_table_end(&self) -> usize[src]

Get the end of the relocation table

pub fn exe_data<'a>(&self, bytes: &'a [u8]) -> &'a [u8][src]

Get the exe data as a slice

pub fn extra_data<'a>(&self, bytes: &'a [u8]) -> &'a [u8][src]

Get the extra data as a slice

pub fn header_data<'a>(&self, bytes: &'a [u8]) -> &'a [u8][src]

Get the header data

pub fn relocation_table_data<'a>(&self, bytes: &'a [u8]) -> &'a [u8][src]

Get the relocation table data

Trait Implementations

impl Debug for Header[src]

Auto Trait Implementations

impl Send for Header

impl Sync for Header

Blanket Implementations

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

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

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.

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

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

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