pub struct EntryHeader {
pub length: u32,
pub load_address: u32,
pub entry_address: Option<u32>,
}
Expand description
EntryHeader
represents the header of a specific entry within a binary image.
It includes metadata about the entry, such as its length, load address, and entry point.
This structure is used to describe a segment or block of data that is loaded into memory at a specified address and contains an entry point that the system can use to jump to the start of execution.
Fields:
length
: The length of the entry in bytes. This defines how much memory the entry occupies.load_address
: The memory address at which the entry is loaded into the system’s memory space.entry_address
: The address to which control is transferred when the entry is executed. By default, it’s set to0xFFFF_FFFF
(None), which indicates an invalid entry address.
Fields§
§length: u32
The length of the entry in bytes.
load_address: u32
The load address in memory where the entry will be loaded.
entry_address: Option<u32>
The entry address, the address to which the system will jump to start execution.
Defaults to 0xFFFF_FFFF
(None), indicating an invalid address.
Trait Implementations§
Source§impl BinarySize for EntryHeader
impl BinarySize for EntryHeader
Source§fn binary_size() -> usize
fn binary_size() -> usize
Returns the binary size of the EntryHeader
struct in bytes.
§Returns
0x20
: The size of theEntryHeader
struct in bytes.
Source§impl Debug for EntryHeader
impl Debug for EntryHeader
Source§impl Default for EntryHeader
impl Default for EntryHeader
Source§fn default() -> EntryHeader
fn default() -> EntryHeader
Returns the default values for the EntryHeader
struct.
The default values are:
length
:0
(indicating no data or length of the entry).load_address
:0
(indicating the entry is not loaded anywhere).entry_address
:0xFFFF_FFFF
(None) (invalid entry address, typically indicating no valid entry).
§Returns
EntryHeader
: A struct with default values.
Source§impl FromStream for EntryHeader
impl FromStream for EntryHeader
Source§fn read_from<R>(&mut self, reader: &mut R) -> Result<(), Error>
fn read_from<R>(&mut self, reader: &mut R) -> Result<(), Error>
Reads an EntryHeader
from the provided reader (e.g., a file or memory buffer).
§Arguments
reader
: A mutable reference to an object that implementsRead
andSeek
(e.g., a file or buffer).
§Returns
Ok(())
: If the deserialization is successful.Err(Error)
: If there is an error reading from the stream, such as an unexpected end of data.