mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-05-06 20:43:44 +00:00
Add PE data directories
This commit is contained in:
29
BurnOutSharp.Models/PortableExecutable/DataDirectory.cs
Normal file
29
BurnOutSharp.Models/PortableExecutable/DataDirectory.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace BurnOutSharp.Models.PortableExecutable
|
||||
{
|
||||
/// <summary>
|
||||
/// Each data directory gives the address and size of a table or string that Windows uses.
|
||||
/// These data directory entries are all loaded into memory so that the system can use them
|
||||
/// at run time.
|
||||
///
|
||||
/// Also, do not assume that the RVAs in this table point to the beginning of a section or
|
||||
/// that the sections that contain specific tables have specific names.
|
||||
/// </summary>
|
||||
/// <see href="https://learn.microsoft.com/en-us/windows/win32/debug/pe-format"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public class DataDirectory
|
||||
{
|
||||
/// <summary>
|
||||
/// The first field, VirtualAddress, is actually the RVA of the table. The RVA
|
||||
/// is the address of the table relative to the base address of the image when
|
||||
/// the table is loaded.
|
||||
/// </summary>
|
||||
public uint VirtualAddress;
|
||||
|
||||
/// <summary>
|
||||
/// The second field gives the size in bytes.
|
||||
/// </summary>
|
||||
public uint Size;
|
||||
}
|
||||
}
|
||||
@@ -271,5 +271,90 @@
|
||||
public uint NumberOfRvaAndSizes;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Data Directories (Image Only)
|
||||
|
||||
/// <summary>
|
||||
/// The export table address and size.
|
||||
/// </summary>
|
||||
public DataDirectory ExportTable;
|
||||
|
||||
/// <summary>
|
||||
/// The import table address and size.
|
||||
/// </summary>
|
||||
public DataDirectory ImportTable;
|
||||
|
||||
/// <summary>
|
||||
/// The resource table address and size.
|
||||
/// </summary>
|
||||
public DataDirectory ResourceTable;
|
||||
|
||||
/// <summary>
|
||||
/// The exception table address and size.
|
||||
/// </summary>
|
||||
public DataDirectory ExceptionTable;
|
||||
|
||||
/// <summary>
|
||||
/// The attribute certificate table address and size.
|
||||
/// </summary>
|
||||
public DataDirectory CertificateTable;
|
||||
|
||||
/// <summary>
|
||||
/// The base relocation table address and size.
|
||||
/// </summary>
|
||||
public DataDirectory BaseRelocationTable;
|
||||
|
||||
/// <summary>
|
||||
/// The debug data starting address and size.
|
||||
/// </summary>
|
||||
public DataDirectory Debug;
|
||||
|
||||
/// <summary>
|
||||
/// Reserved, must be 0
|
||||
/// </summary>
|
||||
public ulong Architecture;
|
||||
|
||||
/// <summary>
|
||||
/// The RVA of the value to be stored in the global pointer register.
|
||||
/// The size member of this structure must be set to zero.
|
||||
/// </summary>
|
||||
public DataDirectory GlobalPtr;
|
||||
|
||||
/// <summary>
|
||||
/// The thread local storage (TLS) table address and size.
|
||||
/// </summary>
|
||||
public DataDirectory TLSTable;
|
||||
|
||||
/// <summary>
|
||||
/// The load configuration table address and size.
|
||||
/// </summary>
|
||||
public DataDirectory LoadConfigTable;
|
||||
|
||||
/// <summary>
|
||||
/// The bound import table address and size.
|
||||
/// </summary>
|
||||
public DataDirectory BoundImport;
|
||||
|
||||
/// <summary>
|
||||
/// The import address table address and size
|
||||
/// </summary>
|
||||
public DataDirectory IAT;
|
||||
|
||||
/// <summary>
|
||||
/// The delay import descriptor address and size.
|
||||
/// </summary>
|
||||
public DataDirectory DelayImportDescriptor;
|
||||
|
||||
/// <summary>
|
||||
/// The CLR runtime header address and size.
|
||||
/// </summary>
|
||||
public DataDirectory CLRRuntimeHeader;
|
||||
|
||||
/// <summary>
|
||||
/// Reserved, must be zero
|
||||
/// </summary>
|
||||
public ulong Reserved;
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user