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
uintThe starting virtual address (RVA) of the directory.
size
uintThe size in bytes of the directory.
Fields
DataDirectorySize
Indicates the size of a single data directory header.
public const uint DataDirectorySize = 8
Field Value
Properties
IsPresentInPE
Gets a value indicating the data directory is present in the portable executable file.
public bool IsPresentInPE { get; }
Property Value
Size
Gets the size of the directory.
public uint Size { get; }
Property Value
VirtualAddress
Gets the relative virtual address (RVA) of the directory.
public uint VirtualAddress { get; }
Property Value
Methods
CreateForSegment(ISegment?)
Creates a data directory descriptor for the provided segment.
public static DataDirectory CreateForSegment(ISegment? segment)
Parameters
segment
ISegmentThe 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
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
BinaryStreamReaderThe 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
BinaryStreamWriterThe output stream to write the data to.