pub struct ImageSectionHeader {
    pub name: [u8; 8],
    pub virtual_size: u32,
    pub virtual_address: u32,
    pub size_of_raw_data: u32,
    pub pointer_to_raw_data: u32,
    pub pointer_to_relocations: u32,
    pub pointer_to_line_numbers: u32,
    pub number_of_relocations: u16,
    pub number_of_line_numbers: u16,
    pub characteristics: SectionCharacteristics,
}
Expand description

A PE IMAGE_SECTION_HEADER, as described in the Microsoft documentation.

Fields§

§name: [u8; 8]

An 8-byte, null-padded UTF-8 string. There is no terminating null character if the string is exactly eight characters long. For longer names, this member contains a forward slash (/) followed by an ASCII representation of a decimal number that is an offset into the string table. Executable images do not use a string table and do not support section names longer than eight characters.

§virtual_size: u32

The total size of the section when loaded into memory, in bytes. If this value is greater than the size_of_raw_data member, the section is filled with zeroes. This field is valid only for executable images and should be set to 0 for object files.

In object files, this field would be replaced with the physical file address. Such headers are never embedded in PDBs.

§virtual_address: u32

The address of the first byte of the section when loaded into memory, relative to the image base. For object files, this is the address of the first byte before relocation is applied.

§size_of_raw_data: u32

The size of the initialized data on disk, in bytes. This value must be a multiple of the FileAlignment member of the IMAGE_OPTIONAL_HEADER structure. If this value is less than the virtual_size member, the remainder of the section is filled with zeroes. If the section contains only uninitialized data, the member is zero.

§pointer_to_raw_data: u32

A file pointer to the first page within the COFF file. This value must be a multiple of the FileAlignment member of the IMAGE_OPTIONAL_HEADER structure. If a section contains only uninitialized data, set this member is zero.

§pointer_to_relocations: u32

A file pointer to the beginning of the relocation entries for the section. If there are no relocations, this value is zero.

§pointer_to_line_numbers: u32

A file pointer to the beginning of the line-number entries for the section. If there are no COFF line numbers, this value is zero.

§number_of_relocations: u16

The number of relocation entries for the section. This value is zero for executable images.

If the value is 0xffff, the actual relocation count is stored in the virtual_address field of the first relocation. It is an error if this flag is set and there are fewer than 0xffff relocations in the section.

§number_of_line_numbers: u16

The number of line-number entries for the section.

§characteristics: SectionCharacteristics

The characteristics of the image.

Implementations§

source§

impl ImageSectionHeader

source

pub fn name(&self) -> &str

Returns the name of the section.

Trait Implementations§

source§

impl Clone for ImageSectionHeader

source§

fn clone(&self) -> ImageSectionHeader

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ImageSectionHeader

source§

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

Formats the value using the given formatter. Read more
source§

impl Default for ImageSectionHeader

source§

fn default() -> ImageSectionHeader

Returns the “default value” for a type. Read more
source§

impl PartialEq<ImageSectionHeader> for ImageSectionHeader

source§

fn eq(&self, other: &ImageSectionHeader) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for ImageSectionHeader

source§

impl Eq for ImageSectionHeader

source§

impl StructuralEq for ImageSectionHeader

source§

impl StructuralPartialEq for ImageSectionHeader

Auto Trait Implementations§

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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.