Table of Contents

Struct DataDirectory

Namespace
AsmResolver.PE.File
Assembly
AsmResolver.PE.File.dll

Represents a data directory header, consisting of the starting address, and the size.

public readonly struct DataDirectory : IWritable
Implements
Inherited Members

Remarks

This structure does not contain the actual contents of the data directory.

Constructors

DataDirectory(uint, uint)

Creates a new data directory header.

public DataDirectory(uint virtualAddress, uint size)

Parameters

virtualAddress uint

The starting virtual address (RVA) of the directory.

size uint

The size in bytes of the directory.

Fields

DataDirectorySize

Indicates the size of a single data directory header.

public const uint DataDirectorySize = 8

Field Value

uint

Properties

IsPresentInPE

Gets a value indicating the data directory is present in the portable executable file.

public bool IsPresentInPE { get; }

Property Value

bool

Size

Gets the size of the directory.

public uint Size { get; }

Property Value

uint

VirtualAddress

Gets the relative virtual address (RVA) of the directory.

public uint VirtualAddress { get; }

Property Value

uint

Methods

CreateForSegment(ISegment?)

Creates a data directory descriptor for the provided segment.

public static DataDirectory CreateForSegment(ISegment? segment)

Parameters

segment ISegment

The segment to create a data directory descriptor for.

Returns

DataDirectory

The data directory.

Deconstruct(out uint, out uint)

Deconstructs the data directory into a 2-tuple.

public void Deconstruct(out uint virtualAddress, out uint size)

Parameters

virtualAddress uint

The virtual address.

size uint

The size.

FromReader(ref BinaryStreamReader)

Reads a single data directory at the current position of the provided input stream.

public static DataDirectory FromReader(ref BinaryStreamReader reader)

Parameters

reader BinaryStreamReader

The input stream to read from.

Returns

DataDirectory

The data directory that was read.

GetPhysicalSize()

Computes the number of bytes that the structure contains.

public uint GetPhysicalSize()

Returns

uint

The number of bytes.

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

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.