Struct lief::macho::section::Section

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

Implementations§

§

impl Section<'_>

pub fn segment_name(&self) -> String

Name of the segment that owns this section

pub fn address(&self) -> u64

Virtual base address of this section

pub fn alignment(&self) -> u32

Section alignment as a power of 2

pub fn relocation_offset(&self) -> u32

Offset of the relocation table. This value should be 0 for executable and libraries as the relocations are managed by crate::macho::Relocation::Dyld or crate::macho::Relocation::Fixup

On the other hand, for object files (.o) this value should not be 0 (c.f. crate::macho::Relocation::Object)

pub fn numberof_relocations(&self) -> u32

Number of relocations associated with this section

pub fn raw_flags(&self) -> u32

pub fn flags(&self) -> Flags

Section’s flags masked with SECTION_FLAGS_MASK

pub fn section_type(&self) -> Type

Type of the section. This value can help to determine the purpose of the section

pub fn reserved1(&self) -> u32

According to the official loader.h file, this value is reserved for offset or index

pub fn reserved2(&self) -> u32

According to the official loader.h file, this value is reserved for count or sizeof

pub fn reserved3(&self) -> u32

This value is only present for 64 bits Mach-O files. In that case, the value is reserved.

pub fn segment(&self) -> Option<Segment<'_>>

Segment bound to this section

pub fn relocations(&self) -> Relocations<'_>

Iterator over the crate::macho::Relocation associated with thi section

Trait Implementations§

§

impl Debug 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, 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.