2022-11-04 21:05:03 -07:00
|
|
|
namespace BurnOutSharp.Models.PortableExecutable
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The following list describes the Microsoft PE executable format, with the
|
|
|
|
|
/// base of the image header at the top. The section from the MS-DOS 2.0
|
|
|
|
|
/// Compatible EXE Header through to the unused section just before the PE header
|
|
|
|
|
/// is the MS-DOS 2.0 Section, and is used for MS-DOS compatibility only.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <see href="https://learn.microsoft.com/en-us/windows/win32/debug/pe-format"/>
|
|
|
|
|
public class Executable
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// MS-DOS executable stub
|
|
|
|
|
/// </summary>
|
|
|
|
|
public MSDOS.Executable Stub { get; set; }
|
2022-11-04 23:25:02 -07:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// After the MS-DOS stub, at the file offset specified at offset 0x3c, is a 4-byte
|
|
|
|
|
/// signature that identifies the file as a PE format image file. This signature is "PE\0\0"
|
|
|
|
|
/// (the letters "P" and "E" followed by two null bytes).
|
|
|
|
|
/// </summary>
|
|
|
|
|
public byte[] Signature { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// COFF file header
|
|
|
|
|
/// </summary>
|
|
|
|
|
public COFFFileHeader COFFFileHeader { get; set; }
|
2022-11-04 23:41:31 -07:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Optional header
|
|
|
|
|
/// </summary>
|
2022-11-04 23:56:56 -07:00
|
|
|
public OptionalHeader OptionalHeader { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Section table
|
|
|
|
|
/// </summary>
|
|
|
|
|
public SectionHeader[] SectionTable { get; set; }
|
|
|
|
|
|
2022-11-05 00:17:26 -07:00
|
|
|
/// <summary>
|
|
|
|
|
/// COFF symbol table
|
|
|
|
|
/// </summary>
|
|
|
|
|
public COFFSymbolTableEntry[] COFFSymbolTable { get; set; }
|
|
|
|
|
|
2022-11-05 15:40:48 -07:00
|
|
|
/// <summary>
|
|
|
|
|
/// COFF string table
|
|
|
|
|
/// </summary>
|
|
|
|
|
public COFFStringTable COFFStringTable { get; set; }
|
|
|
|
|
|
2022-11-05 21:02:30 -07:00
|
|
|
/// <summary>
|
|
|
|
|
/// Attribute certificate table
|
|
|
|
|
/// </summary>
|
|
|
|
|
public AttributeCertificateTableEntry[] AttributeCertificateTable { get; set; }
|
|
|
|
|
|
2022-11-05 21:12:41 -07:00
|
|
|
/// <summary>
|
|
|
|
|
/// Delay-load directory table
|
|
|
|
|
/// </summary>
|
|
|
|
|
public DelayLoadDirectoryTableEntry[] DelayLoadDirectoryTable { get; set; }
|
|
|
|
|
|
2022-11-05 21:49:34 -07:00
|
|
|
// TODO: Left off at "The .pdata Section"
|
2022-11-05 21:54:36 -07:00
|
|
|
|
|
|
|
|
// TODO: Implement and/or document the following non-modeled parts:
|
|
|
|
|
// - Grouped Sections (Object Only)
|
|
|
|
|
// - Certificate Data
|
|
|
|
|
// - Delay Import Address Table
|
|
|
|
|
// - Delay Import Name Table
|
|
|
|
|
// - Delay Bound Import Address Table
|
|
|
|
|
// - Delay Unload Import Address Table
|
|
|
|
|
// - The .debug Section
|
|
|
|
|
// - IMAGE_DEBUG_TYPE_FPO
|
|
|
|
|
// - .debug$F (Object Only)
|
|
|
|
|
// - .debug$S (Object Only)
|
|
|
|
|
// - .debug$P (Object Only)
|
|
|
|
|
// - .debug$T (Object Only)
|
|
|
|
|
// - The .drectve Section (Object Only)
|
|
|
|
|
// - The .edata Section (Image Only)
|
|
|
|
|
// - Export Name Pointer Table
|
|
|
|
|
// - Export Ordinal Table
|
|
|
|
|
// - Export Name Table
|
|
|
|
|
// - The .idata Section
|
|
|
|
|
// - Import Lookup Table [has model, but bit-based]
|
|
|
|
|
// - Import Address Table
|
2022-11-04 21:05:03 -07:00
|
|
|
}
|
|
|
|
|
}
|