pub struct Header {}
Expand description
A definition of a header in a 16 bit dos executable
Fields§
§signature: u16
§extra_bytes: u16
§pages: u16
§reloc_items: u16
§header_size: u16
§min_alloc: u16
§max_alloc: u16
§init_ss: u16
§init_sp: u16
§checksum: u16
§init_ip: u16
§init_cs: u16
§reloc_table: u16
§overlay: u16
Implementations§
Source§impl Header
impl Header
Sourcepub fn from_words(words: [u16; 14]) -> Result<Header, HeaderError>
pub fn from_words(words: [u16; 14]) -> Result<Header, HeaderError>
Read a header from 14 16-bit words
Sourcepub fn exe_data_start(&self) -> usize
pub fn exe_data_start(&self) -> usize
Get the start of the exe data
Sourcepub fn extra_data_start(&self) -> usize
pub fn extra_data_start(&self) -> usize
Get the start of the extra data
Sourcepub fn relocation_table_start(&self) -> usize
pub fn relocation_table_start(&self) -> usize
Get the start of the relocation table
Sourcepub fn relocation_table_end(&self) -> usize
pub fn relocation_table_end(&self) -> usize
Get the end of the relocation table
Sourcepub fn extra_data<'a>(&self, bytes: &'a [u8]) -> &'a [u8] ⓘ
pub fn extra_data<'a>(&self, bytes: &'a [u8]) -> &'a [u8] ⓘ
Get the extra data as a slice
Sourcepub fn header_data<'a>(&self, bytes: &'a [u8]) -> &'a [u8] ⓘ
pub fn header_data<'a>(&self, bytes: &'a [u8]) -> &'a [u8] ⓘ
Get the header data
Sourcepub fn relocation_table_data<'a>(&self, bytes: &'a [u8]) -> &'a [u8] ⓘ
pub fn relocation_table_data<'a>(&self, bytes: &'a [u8]) -> &'a [u8] ⓘ
Get the relocation table data
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Header
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin for Header
impl UnwindSafe for Header
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