Table of Contents

Class ResourceTableBuffer<TEntry>

Namespace
AsmResolver.PE.Win32Resources.Builder
Assembly
AsmResolver.PE.dll

Provides a base for all table buffer structures in the resource directory of a PE file.

public abstract class ResourceTableBuffer<TEntry> : SegmentBase, ISegment, IOffsetProvider, IWritable where TEntry : notnull

Type Parameters

TEntry

The type of entries to store in the table.

Inheritance
ResourceTableBuffer<TEntry>
Implements
Derived
Inherited Members

Constructors

ResourceTableBuffer(ISegment)

Initializes the table buffer.

protected ResourceTableBuffer(ISegment parentBuffer)

Parameters

parentBuffer ISegment

The resource directory segment that contains the table.

Properties

Entries

Gets an ordered collection of entries that are put into the table.

protected IList<TEntry> Entries { get; }

Property Value

IList<TEntry>

IsEmpty

Gets a value indicating whether there is any data added to the buffer.

public bool IsEmpty { get; }

Property Value

bool

RelativeOffset

Gets the offset to this segment relative to the start of the resource directory.

public uint RelativeOffset { get; }

Property Value

uint

Remarks

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

Methods

AddEntry(TEntry)

Adds a single entry to the table.

public void AddEntry(TEntry entry)

Parameters

entry TEntry

The entry to add.

GetEntryOffset(TEntry)

Determines the offset of an entry stored in the table, relative to the start of the resource directory.

public uint GetEntryOffset(TEntry entry)

Parameters

entry TEntry

The item to get the offset for.

Returns

uint

The offset.

Remarks

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

GetEntrySize(TEntry)

Determines the size of a single item in the table.

public abstract uint GetEntrySize(TEntry entry)

Parameters

entry TEntry

The item to measure.

Returns

uint

The size in bytes.

GetPhysicalSize()

Computes the number of bytes that the structure contains.

public override uint GetPhysicalSize()

Returns

uint

The number of bytes.