pub struct Section<'a> { /* private fields */ }
Expand description
This structure defines a regular PE section.
Note that it implements the trait generic::Section
which provides additional
functions.
Implementations§
§impl Section<'_>
impl Section<'_>
pub fn sizeof_raw_data(&self) -> u32
pub fn sizeof_raw_data(&self) -> u32
Return the size of the data in the section.
pub fn virtual_size(&self) -> u32
pub fn virtual_size(&self) -> u32
Return the size of the data when mapped in memory
If this value is greater than Section::sizeof_raw_data
, the section is zero-padded.
pub fn pointerto_raw_data(&self) -> u32
pub fn pointerto_raw_data(&self) -> u32
The offset of the section data in the PE file
pub fn pointerto_relocation(&self) -> u32
pub fn pointerto_relocation(&self) -> u32
The file pointer to the beginning of the COFF relocation entries for the section. This is set to zero for executable images or if there are no relocations.
For modern PE binaries, this value is usually set to 0 as the relocations are managed by
crate::pe::Relocation
.
pub fn pointerto_line_numbers(&self) -> u32
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) -> u32
pub fn numberof_relocations(&self) -> u32
No longer used in recent PE binaries produced by Visual Studio
pub fn numberof_line_numbers(&self) -> u32
pub fn numberof_line_numbers(&self) -> u32
No longer used in recent PE binaries produced by Visual Studio
pub fn characteristics(&self) -> Characteristics
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, …)