Struct lief::elf::section::Section

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

Structure wich represents an ELF Section

Implementations§

§

impl Section<'_>

pub fn get_type(&self) -> Type

Type of the section

pub fn flags(&self) -> Flags

Sections flags

pub fn alignment(&self) -> u64

Section alignment

pub fn information(&self) -> u64

Section information. This meaning of this value depends on the section’s type

pub fn entry_size(&self) -> u64

This function returns the size of an element in the case of a section that contains an array.

For instance, the .dynamic section contains an array of DynamicEntry. As the size of the raw C structure of this entry is 0x10 (sizeof(Elf64_Dyn)) in a ELF64, the entry_size is set to this value.

Index to another section

pub fn file_offset(&self) -> u64

Offset in the file where the content of this section is located

pub fn original_size(&self) -> u64

Original size of the section (regardless modifications)

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

Content of the section as a slice of bytes

Trait Implementations§

§

impl Debug for Section<'_>

§

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

Formats the value using the given formatter. Read more
§

impl Display for Section<'_>

§

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

Formats the value using the given formatter. Read more
§

impl Section for Section<'_>

§

fn name(&self) -> String

Name of the section
§

fn size(&self) -> u64

Size of the section in the file
§

fn offset(&self) -> u64

Offset of the section in the file
§

fn virtual_address(&self) -> u64

Address of the section in memory
§

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

Content of the section

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for Section<'a>

§

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

§

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

§

impl<'a> Unpin for Section<'a>

§

impl<'a> UnwindSafe for Section<'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.