pub struct SectionOffset {
    pub offset: u32,
    pub section: u16,
}
Expand description

An offset relative to a PE section.

This offset can be converted to an Rva to receive the address relative to the entire image. Note that this offset applies to the actual PE headers. The PDB debug information actually stores PdbInternalSectionOffsets.

Fields

offset: u32

The memory offset relative from the start of the section’s memory.

section: u16

The index of the section in the PE’s section headers list, incremented by 1. A value of 0 indicates an invalid or missing reference.

Implementations

Creates a new section offset.

Returns whether this section offset points to a valid section or into the void.

Checked addition of an offset. Returns None if overflow occurred.

This does not check whether the offset is still valid within the given section. If the offset is out of bounds, the conversion to Rva will return None.

Saturating addition of an offset, clipped at the numeric bounds.

This does not check whether the offset is still valid within the given section. If the offset is out of bounds, the conversion to Rva will return None.

Wrapping (modular) addition of an offset.

This does not check whether the offset is still valid within the given section. If the offset is out of bounds, the conversion to Rva will return None.

Resolves an actual Relative Virtual Address in the executable’s address space.

Resolves a PDB-internal Relative Virtual Address.

This address is not necessarily compatible with the executable’s address space and should therefore not be used for debugging purposes.

Resolves the PDB internal section offset.

Trait Implementations

Adds the given offset to this section offset.

This does not check whether the offset is still valid within the given section. If the offset is out of bounds, the conversion to Rva will return None.

The resulting type after applying the + operator.

Adds the given offset to this section offset.

This does not check whether the offset is still valid within the given section. If the offset is out of bounds, the conversion to Rva will return None.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Compares offsets if they reside in the same section.

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

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

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.