Class ImportDirectoryBufferBase
- Namespace
- AsmResolver.PE.Imports.Builder
- Assembly
- AsmResolver.PE.dll
Provides a base for the import lookup and address directory buffers.
public abstract class ImportDirectoryBufferBase : SegmentBase, ISegment, IOffsetProvider, IWritable, IImportAddressProvider
- Inheritance
-
ImportDirectoryBufferBase
- Implements
- Derived
- Inherited Members
Constructors
ImportDirectoryBufferBase(HintNameTableBuffer, bool)
Initializes the new import directory buffer with a hint-name table.
protected ImportDirectoryBufferBase(HintNameTableBuffer hintNameTable, bool is32Bit)
Parameters
hintNameTable
HintNameTableBufferThe hint-name table that is used to reference names of modules or members.
is32Bit
boolIndicates the import directory should use 32-bit addresses or 64-bit addresses.
Properties
Count
Gets the number of modules that were added to the import directory.
public int Count { get; }
Property Value
HintNameTable
Gets the hint-name table that is used to reference names of modules or members.
public HintNameTableBuffer HintNameTable { get; }
Property Value
Is32Bit
Gets a value indicating the import directory should use 32-bit addresses or 64-bit addresses.
public bool Is32Bit { get; }
Property Value
Modules
Gets an ordered list of modules that were added to the buffer.
protected IList<ImportedModule> Modules { get; }
Property Value
Methods
AddModule(ImportedModule)
Creates a thunk table for a module and its imported members, and adds it to the buffer.
public virtual void AddModule(ImportedModule module)
Parameters
module
ImportedModuleThe module to add.
CreateThunkTable()
Creates a new thunk table buffer.
protected virtual ThunkTableBuffer CreateThunkTable()
Returns
- ThunkTableBuffer
The buffer.
GetModuleThunkTable(ImportedModule)
Obtains the thunk table of a module.
public ThunkTableBuffer GetModuleThunkTable(ImportedModule module)
Parameters
module
ImportedModuleThe module to get the associated thunk table for.
Returns
- ThunkTableBuffer
The thunk table.
GetPhysicalSize()
Computes the number of bytes that the structure contains.
public override uint GetPhysicalSize()
Returns
- uint
The number of bytes.
GetThunkRva(string, string)
Obtains the RVA of a thunk.
public uint GetThunkRva(string moduleName, string memberName)
Parameters
Returns
- uint
The RVA
Exceptions
- ArgumentException
Occurs when the member could not be found.
Write(BinaryStreamWriter)
Serializes the structure to an output stream.
public override void Write(BinaryStreamWriter writer)
Parameters
writer
BinaryStreamWriterThe output stream to write the data to.