// dnlib: See LICENSE.txt for more info
using System;
using System.Diagnostics;
using dnlib.IO;
namespace dnlib.PE {
///
/// A IMAGE_DEBUG_DIRECTORY
///
[DebuggerDisplay("{type}: TS:{timeDateStamp,h} V:{majorVersion,d}.{minorVersion,d} SZ:{sizeOfData} RVA:{addressOfRawData,h} FO:{pointerToRawData,h}")]
public sealed class ImageDebugDirectory : FileSection {
readonly uint characteristics;
readonly uint timeDateStamp;
readonly ushort majorVersion;
readonly ushort minorVersion;
readonly ImageDebugType type;
readonly uint sizeOfData;
readonly uint addressOfRawData;
readonly uint pointerToRawData;
///
/// Gets the characteristics (reserved)
///
public uint Characteristics => characteristics;
///
/// Gets the timestamp
///
public uint TimeDateStamp => timeDateStamp;
///
/// Gets the major version
///
public ushort MajorVersion => majorVersion;
///
/// Gets the minor version
///
public ushort MinorVersion => minorVersion;
///
/// Gets the type
///
public ImageDebugType Type => type;
///
/// Gets the size of data
///
public uint SizeOfData => sizeOfData;
///
/// RVA of the data
///
public RVA AddressOfRawData => (RVA)addressOfRawData;
///
/// File offset of the data
///
public FileOffset PointerToRawData => (FileOffset)pointerToRawData;
///
/// Constructor
///
/// PE file reader pointing to the start of this section
/// Verify section
/// Thrown if verification fails
public ImageDebugDirectory(ref DataReader reader, bool verify) {
SetStartOffset(ref reader);
characteristics = reader.ReadUInt32();
timeDateStamp = reader.ReadUInt32();
majorVersion = reader.ReadUInt16();
minorVersion = reader.ReadUInt16();
type = (ImageDebugType)reader.ReadUInt32();
sizeOfData = reader.ReadUInt32();
addressOfRawData = reader.ReadUInt32();
pointerToRawData = reader.ReadUInt32();
SetEndoffset(ref reader);
}
}
}