Struct lief::elf::Header

pub struct Header<'a> { /* private fields */ }
Expand description

Class which represents the ELF’s header. This class mirrors the raw ELF Elfxx_Ehdr structure

Implementations§

§

impl Header<'_>

pub fn entrypoint(&self) -> u64

Executable entrypoint

pub fn file_type(&self) -> FileType

Define the object file type. (e.g. executable, library…)

pub fn object_file_version(&self) -> Version

Version of the object file format

pub fn identity_class(&self) -> Class

Return the object’s class. ELF64 or ELF32

pub fn identity_data(&self) -> ElfData

Specify the data encoding

pub fn identity_version(&self) -> Version

pub fn identity_os_abi(&self) -> OsAbi

Identifies the version of the ABI for which the object is prepared

pub fn machine_type(&self) -> u32

Target architecture

pub fn program_headers_offset(&self) -> u64

Offset of the programs table (also known as segments table)

pub fn section_headers_offset(&self) -> u64

Offset of the sections table

pub fn processor_flag(&self) -> u32

Processor-specific flags

pub fn header_size(&self) -> u32

Size of the current header (i.e. sizeof(Elfxx_Ehdr)) This size should be 64 for an ELF64 binary and 52 for an ELF32.

pub fn program_header_size(&self) -> u32

Return the size of a program header (i.e. sizeof(Elfxx_Phdr)) This size should be 56 for an ELF64 binary and 32 for an ELF32.

pub fn numberof_segments(&self) -> u32

Return the the number of segments

pub fn section_header_size(&self) -> u32

Return the size of a section header (i.e. sizeof(Elfxx_Shdr)) This size should be 64 for a ELF64 binary and 40 for an ELF32.

pub fn numberof_sections(&self) -> u32

Return the number of sections

This value could differ from the real number of sections present in the binary. It must be taken as an indication

pub fn section_name_table_idx(&self) -> u32

Return the section’s index which contains sections’ names

Trait Implementations§

§

impl Debug for Header<'_>

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for Header<'a>

§

impl<'a> !Send for Header<'a>

§

impl<'a> !Sync for Header<'a>

§

impl<'a> Unpin for Header<'a>

§

impl<'a> UnwindSafe for Header<'a>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.