Struct symbolic::debuginfo::pdb::pdb::PdbInternalSectionOffset [−]
An offset relative to a PE section in the original unoptimized binary.
For optimized Microsoft binaries, this offset points to a virtual address space before the
rearrangement of sections has been performed. This kind of offset is usually stored in PDB debug
information. It can be converted to an RVA in the transformed address space of the optimized
binary using to_rva
. Likewise, there is a conversion to SectionOffset
in the actual address
space.
For binaries and their PDBs that have not been optimized, both address spaces are equal and the offsets are interchangeable. The conversion operations are cheap no-ops in this case.
Fields
offset: u32
The memory offset relative from the start of the section’s memory.
section: u16
The index of the section in the PDB’s section headers list, incremented by 1
. A value of
0
indicates an invalid or missing reference.
Implementations
impl PdbInternalSectionOffset
impl PdbInternalSectionOffset
pub fn to_rva(self, translator: &AddressMap<'_>) -> Option<Rva>
Resolves an actual Relative Virtual Address in the executable’s address space.
pub fn to_internal_rva(
self,
translator: &AddressMap<'_>
) -> Option<PdbInternalRva>
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.
pub fn to_section_offset(
self,
translator: &AddressMap<'_>
) -> Option<SectionOffset>
self,
translator: &AddressMap<'_>
) -> Option<SectionOffset>
Resolves the section offset in the PE headers.
impl PdbInternalSectionOffset
impl PdbInternalSectionOffset
pub fn new(section: u16, offset: u32) -> PdbInternalSectionOffset
Creates a new section offset.
pub fn is_valid(self) -> bool
Returns whether this section offset points to a valid section or into the void.
pub fn checked_add(self, offset: u32) -> Option<PdbInternalSectionOffset>
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
.
pub fn saturating_add(self, offset: u32) -> PdbInternalSectionOffset
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
.
pub fn wrapping_add(self, offset: u32) -> PdbInternalSectionOffset
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
.
Trait Implementations
impl Add<u32> for PdbInternalSectionOffset
impl Add<u32> for PdbInternalSectionOffset
type Output = PdbInternalSectionOffset
The resulting type after applying the +
operator.
pub fn add(self, offset: u32) -> PdbInternalSectionOffset
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
.
impl AddAssign<u32> for PdbInternalSectionOffset
impl AddAssign<u32> for PdbInternalSectionOffset
pub 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
.
impl Clone for PdbInternalSectionOffset
impl Clone for PdbInternalSectionOffset
pub fn clone(&self) -> PdbInternalSectionOffset
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for PdbInternalSectionOffset
impl Copy for PdbInternalSectionOffset
impl Debug for PdbInternalSectionOffset
impl Debug for PdbInternalSectionOffset
impl Default for PdbInternalSectionOffset
impl Default for PdbInternalSectionOffset
pub fn default() -> PdbInternalSectionOffset
impl Eq for PdbInternalSectionOffset
impl Eq for PdbInternalSectionOffset
impl Hash for PdbInternalSectionOffset
impl Hash for PdbInternalSectionOffset
impl PartialEq<PdbInternalSectionOffset> for PdbInternalSectionOffset
impl PartialEq<PdbInternalSectionOffset> for PdbInternalSectionOffset
pub fn eq(&self, other: &PdbInternalSectionOffset) -> bool
pub fn ne(&self, other: &PdbInternalSectionOffset) -> bool
impl PartialOrd<PdbInternalSectionOffset> for PdbInternalSectionOffset
impl PartialOrd<PdbInternalSectionOffset> for PdbInternalSectionOffset
pub fn partial_cmp(&self, other: &PdbInternalSectionOffset) -> Option<Ordering>
Compares offsets if they reside in the same section.
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for PdbInternalSectionOffset
impl StructuralEq for PdbInternalSectionOffset
impl<'t> TryFromCtx<'t, Endian, [u8]> for PdbInternalSectionOffset
impl<'t> TryFromCtx<'t, Endian, [u8]> for PdbInternalSectionOffset
type Error = Error
pub fn try_from_ctx(
this: &'t [u8],
le: Endian
) -> Result<(PdbInternalSectionOffset, usize), Error>
this: &'t [u8],
le: Endian
) -> Result<(PdbInternalSectionOffset, usize), Error>
Auto Trait Implementations
impl RefUnwindSafe for PdbInternalSectionOffset
impl RefUnwindSafe for PdbInternalSectionOffset
impl Send for PdbInternalSectionOffset
impl Send for PdbInternalSectionOffset
impl Sync for PdbInternalSectionOffset
impl Sync for PdbInternalSectionOffset
impl Unpin for PdbInternalSectionOffset
impl Unpin for PdbInternalSectionOffset
impl UnwindSafe for PdbInternalSectionOffset
impl UnwindSafe for PdbInternalSectionOffset