Struct lief::elf::segment::Segment

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

Structure which reprents an ELF segment

Implementations§

§

impl<'a> Segment<'a>

pub fn content(&self) -> &[u8]

Content of the segment as a slice of bytes

pub fn p_type(&self) -> Type

The segment’s type (LOAD, DYNAMIC, …)

pub fn flags(&self) -> u32

The flag permissions associated with this segment

pub fn file_offset(&self) -> u64

The file offset of the data associated with this segment

pub fn virtual_address(&self) -> u64

The virtual address of the segment.

pub fn physical_address(&self) -> u64

The physical address of the segment. This value is not really relevant on systems like Linux or Android. On the other hand, Qualcomm trustlets might use this value.

Usually this value matches Segment::virtual_address

pub fn physical_size(&self) -> u64

The file size of the data associated with this segment

pub fn virtual_size(&self) -> u64

The in-memory size of this segment. Usually, if the .bss segment is wrapped by this segment then, virtual_size is larger than physical_size

pub fn alignment(&self) -> u64

The offset alignment of the segment

Trait Implementations§

§

impl Debug for Segment<'_>

§

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

Formats the value using the given formatter. Read more
§

impl Display for Segment<'_>

§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for Segment<'a>

§

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

§

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

§

impl<'a> Unpin for Segment<'a>

§

impl<'a> UnwindSafe for Segment<'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> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
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.