[][src]Struct symbolic_debuginfo::pe::PeObject

pub struct PeObject<'d> { /* fields omitted */ }

Portable Executable, an extension of COFF used on Windows.

This file format is used to carry program code. Debug information is usually moved to a separate container, PdbObject. The PE file contains a reference to the PDB and vice versa to verify that the files belong together.

While in rare instances, PE files might contain debug information, this case is not supported.

Methods

impl<'d> PeObject<'d>[src]

pub fn test(data: &[u8]) -> bool[src]

Tests whether the buffer could contain an PE object.

pub fn parse(data: &'d [u8]) -> Result<Self, PeError>[src]

Tries to parse a PE object from the given slice.

pub fn file_format(&self) -> FileFormat[src]

The container file format, which is always FileFormat::Pe.

pub fn code_id(&self) -> Option<CodeId>[src]

The code identifier of this object.

The code identifier consists of the time_date_stamp field id the COFF header, followed by the size_of_image field in the optional header. If the optional PE header is not present, this identifier is None.

pub fn debug_id(&self) -> DebugId[src]

The debug information identifier of this PE.

Since debug information is stored in an external [PdbObject], this identifier actually refers to the PDB. While strictly the filename of the PDB would also be necessary fully resolve it, in most instances the GUID and age contained in this identifier are sufficient.

pub fn debug_file_name(&self) -> Option<Cow<str>>[src]

The name of the referenced PDB file.

pub fn arch(&self) -> Arch[src]

The CPU architecture of this object, as specified in the COFF header.

pub fn kind(&self) -> ObjectKind[src]

The kind of this object, as specified in the PE header.

pub fn load_address(&self) -> u64[src]

The address at which the image prefers to be loaded into memory.

ELF files store all internal addresses as if it was loaded at that address. When the image is actually loaded, that spot might already be taken by other images and so it must be relocated to a new address. During load time, the loader rewrites all addresses in the program code to match the new load address so that there is no runtime overhead when executing the code.

Addresses used in symbols or debug_session have already been rebased relative to that load address, so that the caller only has to deal with addresses relative to the actual start of the image.

pub fn has_symbols(&self) -> bool[src]

Determines whether this object exposes a public symbol table.

Important traits for PeSymbolIterator<'d, 'o>
pub fn symbols(&self) -> PeSymbolIterator<'d, '_>[src]

Returns an iterator over symbols in the public symbol table.

pub fn symbol_map(&self) -> SymbolMap<'d>[src]

Returns an ordered map of symbols in the symbol table.

pub fn has_debug_info(&self) -> bool[src]

Determines whether this object contains debug information.

This is always false, as debug information is not supported for PE files.

pub fn debug_session(&self) -> Result<PeDebugSession<'d>, PeError>[src]

Constructs a no-op debugging session.

pub fn has_unwind_info(&self) -> bool[src]

Determines whether this object contains stack unwinding information.

pub fn data(&self) -> &'d [u8][src]

Returns the raw data of the PE file.

pub fn sections(&self) -> &[SectionTable][src]

A list of the sections in this PE binary, used to resolve virtual addresses.

pub fn exception_data(&self) -> Option<&ExceptionData>[src]

Returns exception data containing unwind information.

Trait Implementations

impl<'d> ObjectLike for PeObject<'d>[src]

type Error = PeError

Errors thrown when reading information from this object.

type Session = PeDebugSession<'d>

A session that allows optimized access to debugging information.

impl<'_> Debug for PeObject<'_>[src]

impl<'slf, 'd: 'slf> AsSelf<'slf> for PeObject<'d>[src]

type Ref = PeObject<'slf>

The Self type with 'slf lifetimes, returned by as_self.

Auto Trait Implementations

impl<'d> Unpin for PeObject<'d>

impl<'d> Send for PeObject<'d>

impl<'d> Sync for PeObject<'d>

impl<'d> RefUnwindSafe for PeObject<'d>

impl<'d> UnwindSafe for PeObject<'d>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]