Class ExportedSymbol
- Namespace
- AsmResolver.PE.Exports
- Assembly
- AsmResolver.PE.dll
Represents a single symbol that is exported by a dynamically linked library.
public class ExportedSymbol : IOwnedCollectionElement<ExportDirectory>, ISymbol
- Inheritance
-
ExportedSymbol
- Implements
- Inherited Members
Constructors
ExportedSymbol(ISegmentReference)
Creates a new symbol that is exported by ordinal.
public ExportedSymbol(ISegmentReference address)
Parameters
address
ISegmentReferenceThe reference to the segment representing the symbol.
ExportedSymbol(ISegmentReference, string?)
Creates a new symbol that is exported by name.
public ExportedSymbol(ISegmentReference address, string? name)
Parameters
address
ISegmentReferenceThe reference to the segment representing the symbol.
name
stringThe name of the symbol.
ExportedSymbol(ISegmentReference, string?, string?)
Creates a new forwarder symbol that is exported by name.
public ExportedSymbol(ISegmentReference address, string? name, string? forwarderName)
Parameters
address
ISegmentReferenceThe reference to the segment representing the symbol.
name
stringThe name of the symbol.
forwarderName
stringThe name of the forwarded symbol.
Properties
Address
Gets or sets the reference to the segment representing the symbol.
public ISegmentReference Address { get; set; }
Property Value
Remarks
For exported functions, this reference points to the first instruction that is executed. For exported fields, this reference points to the first byte of data that this field consists of. For forwarded symbols, this reference points to the name of the symbol the forwarder is referencing.
ForwarderName
When the symbol is a forwarder symbol, gets or sets the full name of the symbol that this export is forwarded to.
public string? ForwarderName { get; set; }
Property Value
Remarks
For exports by name, this name should be in the format ModuleName.ExportName
.
For exports by ordinal, this name should be in the format ModuleName.#1
.
Failure in doing so will make the Windows PE loader not able to resolve the forwarder symbol.
IsByName
Gets a value indicating whether the symbol is exported by name.
public bool IsByName { get; }
Property Value
IsByOrdinal
Gets a value indicating whether the symbol is exported by ordinal number.
public bool IsByOrdinal { get; }
Property Value
IsForwarder
Gets a value indicating whether the symbol is forwarded to another external symbol.
public bool IsForwarder { get; }
Property Value
Name
Gets or sets the name of the exported symbol.
public string? Name { get; set; }
Property Value
Ordinal
Gets the ordinal of the exported symbol.
public uint Ordinal { get; }
Property Value
ParentDirectory
Gets the export directory this symbol was added to (if available).
public ExportDirectory? ParentDirectory { get; }
Property Value
Methods
FormatNameAsForwarderSymbol()
Obtains a name that can be used as a ForwarderName in another export.
public string FormatNameAsForwarderSymbol()
Returns
- string
The name.
GetReference()
Gets a reference the object.
public ISegmentReference GetReference()
Returns
- ISegmentReference
The object.
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.