Table of Contents

Class ResourceDirectoryBuffer

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

Provides a mechanism for building a new resource directory in a PE file.

public class ResourceDirectoryBuffer : ISegment, IOffsetProvider, IWritable
Inheritance
ResourceDirectoryBuffer
Implements
Inherited Members

Constructors

ResourceDirectoryBuffer()

Creates a new resource directory buffer.

public ResourceDirectoryBuffer()

Properties

CanUpdateOffsets

Determines whether this structure can be relocated to another offset or virtual address.

public bool CanUpdateOffsets { get; }

Property Value

bool

DataEntryTable

Gets the segment containing the table with all data entries.

public ResourceTableBuffer<ResourceData> DataEntryTable { get; }

Property Value

ResourceTableBuffer<ResourceData>

DataTable

Gets the segment containing all raw data segments for each data entry.

public SegmentBuilder DataTable { get; }

Property Value

SegmentBuilder

DirectoryTable

Gets the segment containing the table with all directory entries.

public ResourceTableBuffer<ResourceDirectory> DirectoryTable { get; }

Property Value

ResourceTableBuffer<ResourceDirectory>

IsEmpty

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

public bool IsEmpty { get; }

Property Value

bool

NameTable

Gets the segment containing the table with the names for all named resource entries.

public ResourceTableBuffer<string> NameTable { get; }

Property Value

ResourceTableBuffer<string>

Offset

Gets the physical starting offset of the segment.

public ulong Offset { get; }

Property Value

ulong

Rva

Gets the virtual address relative to the beginning of the section that the segment is located in.

public uint Rva { get; }

Property Value

uint

Methods

AddDirectory(ResourceDirectory)

Adds a resource directory and all its sub entries to the buffer.

public void AddDirectory(ResourceDirectory directory)

Parameters

directory ResourceDirectory

The directory to add.

GetPhysicalSize()

Computes the number of bytes that the structure contains.

public uint GetPhysicalSize()

Returns

uint

The number of bytes.

GetVirtualSize()

Computes the number of bytes the segment will contain when it is mapped into memory.

public uint GetVirtualSize()

Returns

uint

The number of bytes.

UpdateOffsets(in RelocationParameters)

Assigns a new file and virtual offset to the segment and all its sub-components.

public void UpdateOffsets(in RelocationParameters parameters)

Parameters

parameters RelocationParameters

The parameters containing the new offset information for the segment.

Write(BinaryStreamWriter)

Serializes the structure to an output stream.

public void Write(BinaryStreamWriter writer)

Parameters

writer BinaryStreamWriter

The output stream to write the data to.