Struct lief::coff::Section

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

Implementations§

§

impl Section<'_>

pub fn sizeof_raw_data(&self) -> u32

Return the size of the data in the section.

pub fn virtual_size(&self) -> u32

Return the size of the data when mapped in memory (should be 0)

pub fn pointerto_raw_data(&self) -> u32

Offset to the section’s content

pub fn pointerto_relocation(&self) -> u32

Offset to the relocation table

pub fn pointerto_line_numbers(&self) -> u32

The file pointer to the beginning of line-number entries for the section.

This is set to zero if there are no COFF line numbers. This value should be zero for an image because COFF debugging information is deprecated and modern debug information relies on the PDB files.

pub fn numberof_relocations(&self) -> u16

Number of relocations.

If the number of relocations is greater than 0xFFFF (maximum value for 16-bits integer), then the number of relocations is stored in the virtual address attribute.

pub fn numberof_line_numbers(&self) -> u16

Number of line number entries (if any).

pub fn characteristics(&self) -> Characteristics

Characteristics of the section: it provides information about the permissions of the section when mapped. It can also provide information about the purpose of the section (contain code, BSS-like, …)

pub fn is_discardable(&self) -> bool

True if the section can be discarded as needed.

This is typically the case for debug-related sections

pub fn has_extended_relocations(&self) -> bool

Whether there is a large number of relocations whose number need to be stored in the virtual address attribute

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

Iterator over the relocations associated with this section

pub fn symbols(&self) -> Symbols<'_>

Iterator over the symbols associated with this section

pub fn comdat_info(&self) -> Option<ComdatInfo<'_>>

Return comdat infomration (only if the section has the crate::pe::section::Characteristics::LNK_COMDAT characteristic)

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.