Table of Contents

Class ThunkTableBuffer

Namespace
AsmResolver.PE.Imports.Builder
Assembly
AsmResolver.PE.dll

Provides a mechanism for building up a thunk table for an import directory.

public class ThunkTableBuffer : SegmentBase, ISegment, IOffsetProvider, IWritable
Inheritance
ThunkTableBuffer
Implements
Inherited Members

Constructors

ThunkTableBuffer(HintNameTableBuffer, bool, bool)

Creates a new thunk table buffer, that uses the provided hint-name table to reference names.

public ThunkTableBuffer(HintNameTableBuffer hintNameTable, bool is32Bit, bool isIat)

Parameters

hintNameTable HintNameTableBuffer

The hint-name table containing the names of each imported member

is32Bit bool

Indicates whether the thunk-table should use 32-bit addresses or 64-bit addresses.

isIat bool

Indicates the buffer contains the import address table or lookup table.

Properties

Is32Bit

Gets a value indicating whether the thunk-table should use 32-bit addresses or 64-bit addresses.

public bool Is32Bit { get; }

Property Value

bool

ThunkSize

Gets the size of a single entry in the thunk table.

public uint ThunkSize { get; }

Property Value

uint

Methods

AddMember(ImportedSymbol)

Creates a thunk for the specified member, and adds it to the table.

public void AddMember(ImportedSymbol entry)

Parameters

entry ImportedSymbol

The member to add.

GetMemberThunkRva(ImportedSymbol)

Obtains the relative virtual address of the thunk associated to an imported member in the thunk table.

public uint GetMemberThunkRva(ImportedSymbol member)

Parameters

member ImportedSymbol

The member to get the thunk entry RVA for.

Returns

uint

The virtual address

Remarks

This method should only be used after the thunk table has been relocated to the right location in the PE file.

GetPhysicalSize()

Computes the number of bytes that the structure contains.

public override uint GetPhysicalSize()

Returns

uint

The number of bytes.

Write(BinaryStreamWriter)

Serializes the structure to an output stream.

public override void Write(BinaryStreamWriter writer)

Parameters

writer BinaryStreamWriter

The output stream to write the data to.