pub struct CoffHeader {
pub machine: u16,
pub number_of_sections: u16,
pub time_date_stamp: u32,
pub pointer_to_symbol_table: u32,
pub number_of_symbols: u32,
pub size_of_optional_header: u16,
pub characteristics: u16,
}Expand description
COFF file header structure
Contains basic information for the COFF (Common Object File Format) format, defining key information such as target machine type, number of sections, and timestamp.
Fields§
§machine: u16Target machine type, such as x86, x64, ARM, etc.
number_of_sections: u16Number of sections in the file
time_date_stamp: u32Timestamp indicating when the file was created or linked
pointer_to_symbol_table: u32File offset of the symbol table, or 0 if none exists
number_of_symbols: u32Number of symbols in the symbol table
size_of_optional_header: u16Size of the optional header in bytes
characteristics: u16File characteristics flags describing various attributes of the file
Implementations§
Source§impl CoffHeader
impl CoffHeader
Sourcepub fn new(machine: u16, number_of_sections: u16) -> Self
pub fn new(machine: u16, number_of_sections: u16) -> Self
Create a new COFF header with core fields
Sourcepub fn with_timestamp(self, time_date_stamp: u32) -> Self
pub fn with_timestamp(self, time_date_stamp: u32) -> Self
Set timestamp
Sourcepub fn with_symbol_table(
self,
pointer_to_symbol_table: u32,
number_of_symbols: u32,
) -> Self
pub fn with_symbol_table( self, pointer_to_symbol_table: u32, number_of_symbols: u32, ) -> Self
Set symbol table information
Sourcepub fn with_optional_header_size(self, size_of_optional_header: u16) -> Self
pub fn with_optional_header_size(self, size_of_optional_header: u16) -> Self
Set optional header size
Sourcepub fn with_characteristics(self, characteristics: u16) -> Self
pub fn with_characteristics(self, characteristics: u16) -> Self
Set file characteristics
pub fn read<R: Read>(reader: R) -> Result<Self, GaiaError>
pub fn get_architecture(&self) -> Architecture
Trait Implementations§
Source§impl Clone for CoffHeader
impl Clone for CoffHeader
Source§fn clone(&self) -> CoffHeader
fn clone(&self) -> CoffHeader
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CoffHeader
impl Debug for CoffHeader
Source§impl<'de> Deserialize<'de> for CoffHeader
impl<'de> Deserialize<'de> for CoffHeader
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for CoffHeader
impl Serialize for CoffHeader
impl Copy for CoffHeader
Auto Trait Implementations§
impl Freeze for CoffHeader
impl RefUnwindSafe for CoffHeader
impl Send for CoffHeader
impl Sync for CoffHeader
impl Unpin for CoffHeader
impl UnsafeUnpin for CoffHeader
impl UnwindSafe for CoffHeader
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