Struct goblin::elf::header::header64::Header
[−]
#[repr(C)]pub struct Header { pub e_ident: [u8; 16], pub e_type: u16, pub e_machine: u16, pub e_version: u32, pub e_entry: u64, pub e_phoff: u64, pub e_shoff: u64, pub e_flags: u32, pub e_ehsize: u16, pub e_phentsize: u16, pub e_phnum: u16, pub e_shentsize: u16, pub e_shnum: u16, pub e_shstrndx: u16, }
Fields
e_ident: [u8; 16]
Magic number and other info
e_type: u16
Object file type
e_machine: u16
Architecture
e_version: u32
Object file version
e_entry: u64
Entry point virtual address
e_phoff: u64
Program header table file offset
e_shoff: u64
Section header table file offset
e_flags: u32
Processor-specific flags
e_ehsize: u16
ELF header size in bytes
e_phentsize: u16
Program header table entry size
e_phnum: u16
Program header table entry count
e_shentsize: u16
Section header table entry size
e_shnum: u16
Section header table entry count
e_shstrndx: u16
Section header string table index
Methods
impl Header
[src]
fn from_fd(bytes: &mut File) -> Result<Header>
Load a header from a file. You must ensure the seek is at the correct position.
fn parse(bytes: &[u8]) -> Result<Header>
Parses an ELF header from the given bytes
impl Header
[src]
fn from_bytes(bytes: &[u8; 64]) -> &Header
Returns the corresponding ELF header from the given byte array.
Trait Implementations
impl From<ElfHeader> for Header
[src]
impl<'a> TryFromCtx<'a, Endian> for Header
[src]
type Error = Error
type Size = usize
fn try_from_ctx(
bytes: &'a [u8],
_: Endian
) -> Result<(Self, Self::Size), Self::Error>
bytes: &'a [u8],
_: Endian
) -> Result<(Self, Self::Size), Self::Error>
impl TryIntoCtx<Endian> for Header
[src]
type Error = Error
type Size = usize
fn try_into_ctx(
self,
bytes: &mut [u8],
_endianness: Endian
) -> Result<Self::Size, Self::Error>
self,
bytes: &mut [u8],
_endianness: Endian
) -> Result<Self::Size, Self::Error>
a Pwrite impl for Header: note we use the endianness value in the header, and not a parameter
impl Clone for Header
[src]
fn clone(&self) -> Header
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Copy for Header
[src]
impl Default for Header
[src]
impl PartialEq for Header
[src]
fn eq(&self, __arg_0: &Header) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Header) -> bool
This method tests for !=
.
impl Plain for Header
[src]
fn from_bytes(bytes: &[u8]) -> Result<&Self, Error>
fn slice_from_bytes(bytes: &[u8]) -> Result<&[Self], Error>
fn slice_from_bytes_len(bytes: &[u8], len: usize) -> Result<&[Self], Error>
fn from_mut_bytes(bytes: &mut [u8]) -> Result<&mut Self, Error>
fn slice_from_mut_bytes(bytes: &mut [u8]) -> Result<&mut [Self], Error>
fn slice_from_mut_bytes_len(
bytes: &mut [u8],
len: usize
) -> Result<&mut [Self], Error>
bytes: &mut [u8],
len: usize
) -> Result<&mut [Self], Error>