Struct pdb::SectionOffset
source · [−]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 PdbInternalSectionOffset
s.
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
sourceimpl SectionOffset
impl SectionOffset
sourcepub fn is_valid(self) -> bool
pub fn is_valid(self) -> bool
Returns whether this section offset points to a valid section or into the void.
sourcepub fn checked_add(self, offset: u32) -> Option<Self>
pub fn checked_add(self, offset: u32) -> Option<Self>
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
.
sourcepub fn saturating_add(self, offset: u32) -> Self
pub fn saturating_add(self, offset: u32) -> Self
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
.
sourcepub fn wrapping_add(self, offset: u32) -> Self
pub fn wrapping_add(self, offset: u32) -> Self
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
.
sourceimpl SectionOffset
impl SectionOffset
sourcepub fn to_rva(self, translator: &AddressMap<'_>) -> Option<Rva>
pub fn to_rva(self, translator: &AddressMap<'_>) -> Option<Rva>
Resolves an actual Relative Virtual Address in the executable’s address space.
sourcepub fn to_internal_rva(
self,
translator: &AddressMap<'_>
) -> Option<PdbInternalRva>
pub fn to_internal_rva(
self,
translator: &AddressMap<'_>
) -> Option<PdbInternalRva>
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.
sourcepub fn to_internal_offset(
self,
translator: &AddressMap<'_>
) -> Option<PdbInternalSectionOffset>
pub fn to_internal_offset(
self,
translator: &AddressMap<'_>
) -> Option<PdbInternalSectionOffset>
Resolves the PDB internal section offset.
Trait Implementations
sourceimpl Add<u32> for SectionOffset
impl Add<u32> for SectionOffset
sourcefn add(self, offset: u32) -> Self
fn add(self, offset: u32) -> Self
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
.
type Output = SectionOffset
type Output = SectionOffset
The resulting type after applying the +
operator.
sourceimpl AddAssign<u32> for SectionOffset
impl AddAssign<u32> for SectionOffset
sourcefn add_assign(&mut self, offset: u32)
fn add_assign(&mut self, offset: u32)
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
.
sourceimpl Clone for SectionOffset
impl Clone for SectionOffset
sourcefn clone(&self) -> SectionOffset
fn clone(&self) -> SectionOffset
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for SectionOffset
impl Debug for SectionOffset
sourceimpl Default for SectionOffset
impl Default for SectionOffset
sourcefn default() -> SectionOffset
fn default() -> SectionOffset
Returns the “default value” for a type. Read more
sourceimpl Hash for SectionOffset
impl Hash for SectionOffset
sourceimpl PartialEq<SectionOffset> for SectionOffset
impl PartialEq<SectionOffset> for SectionOffset
sourcefn eq(&self, other: &SectionOffset) -> bool
fn eq(&self, other: &SectionOffset) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &SectionOffset) -> bool
fn ne(&self, other: &SectionOffset) -> bool
This method tests for !=
.
sourceimpl PartialOrd<SectionOffset> for SectionOffset
impl PartialOrd<SectionOffset> for SectionOffset
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
Compares offsets if they reside in the same section.
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Copy for SectionOffset
impl Eq for SectionOffset
impl StructuralEq for SectionOffset
impl StructuralPartialEq for SectionOffset
Auto Trait Implementations
impl RefUnwindSafe for SectionOffset
impl Send for SectionOffset
impl Sync for SectionOffset
impl Unpin for SectionOffset
impl UnwindSafe for SectionOffset
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more