Files
SabreTools.Models/LinearExecutable/Executable.cs

162 lines
4.7 KiB
C#
Raw Normal View History

2023-09-04 00:12:49 -04:00
namespace SabreTools.Models.LinearExecutable
2023-09-04 00:11:04 -04:00
{
/// <summary>
/// The `LINEAR` executable-file header contains information that the loader requires for
/// segmented executable files. This information includes the linker version number, data
/// specified by linker, data specified by resource compiler, tables of segment data, tables
/// of resource data, and so on. The following illustrations shows the LE file header:
/// </summary>
/// <see href="https://faydoc.tripod.com/formats/exe-LE.htm"/>
/// <see href="http://www.edm2.com/index.php/LX_-_Linear_eXecutable_Module_Format_Description"/>
public sealed class Executable
{
/// <summary>
/// MS-DOS executable stub
/// </summary>
2023-09-04 21:14:41 -04:00
#if NET48
2023-09-04 00:11:04 -04:00
public MSDOS.Executable Stub { get; set; }
2023-09-04 21:14:41 -04:00
#else
public MSDOS.Executable? Stub { get; set; }
#endif
2023-09-04 00:11:04 -04:00
/// <summary>
/// Information block
/// </summary>
2023-09-04 21:14:41 -04:00
#if NET48
2023-09-04 00:11:04 -04:00
public InformationBlock InformationBlock { get; set; }
2023-09-04 21:14:41 -04:00
#else
public InformationBlock? InformationBlock { get; set; }
#endif
2023-09-04 00:11:04 -04:00
/// <summary>
/// Object table
/// </summary>
2023-09-04 21:14:41 -04:00
#if NET48
2023-09-04 00:11:04 -04:00
public ObjectTableEntry[] ObjectTable { get; set; }
2023-09-04 21:14:41 -04:00
#else
2023-09-10 20:27:14 -04:00
public ObjectTableEntry?[]? ObjectTable { get; set; }
2023-09-04 21:14:41 -04:00
#endif
2023-09-04 00:11:04 -04:00
/// <summary>
/// Object page map
/// </summary>
2023-09-04 21:14:41 -04:00
#if NET48
2023-09-04 00:11:04 -04:00
public ObjectPageMapEntry[] ObjectPageMap { get; set; }
2023-09-04 21:14:41 -04:00
#else
2023-09-10 20:27:14 -04:00
public ObjectPageMapEntry?[]? ObjectPageMap { get; set; }
2023-09-04 21:14:41 -04:00
#endif
2023-09-04 00:11:04 -04:00
// TODO: Object iterate data map table (Undefined)
/// <summary>
/// Resource table
/// </summary>
2023-09-04 21:14:41 -04:00
#if NET48
2023-09-04 00:11:04 -04:00
public ResourceTableEntry[] ResourceTable { get; set; }
2023-09-04 21:14:41 -04:00
#else
2023-09-10 20:27:14 -04:00
public ResourceTableEntry?[]? ResourceTable { get; set; }
2023-09-04 21:14:41 -04:00
#endif
2023-09-04 00:11:04 -04:00
/// <summary>
/// Resident Name table
/// </summary>
2023-09-04 21:14:41 -04:00
#if NET48
2023-09-04 00:11:04 -04:00
public ResidentNamesTableEntry[] ResidentNamesTable { get; set; }
2023-09-04 21:14:41 -04:00
#else
2023-09-10 20:27:14 -04:00
public ResidentNamesTableEntry?[]? ResidentNamesTable { get; set; }
2023-09-04 21:14:41 -04:00
#endif
2023-09-04 00:11:04 -04:00
/// <summary>
/// Entry table
/// </summary>
2023-09-04 21:14:41 -04:00
#if NET48
2023-09-04 00:11:04 -04:00
public EntryTableBundle[] EntryTable { get; set; }
2023-09-04 21:14:41 -04:00
#else
2023-09-10 20:27:14 -04:00
public EntryTableBundle?[]? EntryTable { get; set; }
2023-09-04 21:14:41 -04:00
#endif
2023-09-04 00:11:04 -04:00
/// <summary>
/// Module format directives table (optional)
/// </summary>
2023-09-04 21:14:41 -04:00
#if NET48
2023-09-04 00:11:04 -04:00
public ModuleFormatDirectivesTableEntry[] ModuleFormatDirectivesTable { get; set; }
2023-09-04 21:14:41 -04:00
#else
2023-09-10 20:27:14 -04:00
public ModuleFormatDirectivesTableEntry?[]? ModuleFormatDirectivesTable { get; set; }
2023-09-04 21:14:41 -04:00
#endif
2023-09-04 00:11:04 -04:00
/// <summary>
/// Verify record directive table (optional)
/// </summary>
2023-09-04 21:14:41 -04:00
#if NET48
2023-09-04 00:11:04 -04:00
public VerifyRecordDirectiveTableEntry[] VerifyRecordDirectiveTable { get; set; }
2023-09-04 21:14:41 -04:00
#else
2023-09-10 20:27:14 -04:00
public VerifyRecordDirectiveTableEntry?[]? VerifyRecordDirectiveTable { get; set; }
2023-09-04 21:14:41 -04:00
#endif
2023-09-04 00:11:04 -04:00
/// <summary>
/// Fix-up page table
/// </summary>
2023-09-04 21:14:41 -04:00
#if NET48
2023-09-04 00:11:04 -04:00
public FixupPageTableEntry[] FixupPageTable { get; set; }
2023-09-04 21:14:41 -04:00
#else
2023-09-10 20:27:14 -04:00
public FixupPageTableEntry?[]? FixupPageTable { get; set; }
2023-09-04 21:14:41 -04:00
#endif
2023-09-04 00:11:04 -04:00
/// <summary>
/// Fix-up record table
/// </summary>
2023-09-04 21:14:41 -04:00
#if NET48
2023-09-04 00:11:04 -04:00
public FixupRecordTableEntry[] FixupRecordTable { get; set; }
2023-09-04 21:14:41 -04:00
#else
2023-09-10 20:27:14 -04:00
public FixupRecordTableEntry?[]? FixupRecordTable { get; set; }
2023-09-04 21:14:41 -04:00
#endif
2023-09-04 00:11:04 -04:00
/// <summary>
/// Import module name table
/// </summary>
2023-09-04 21:14:41 -04:00
#if NET48
2023-09-04 00:11:04 -04:00
public ImportModuleNameTableEntry[] ImportModuleNameTable { get; set; }
2023-09-04 21:14:41 -04:00
#else
2023-09-10 20:27:14 -04:00
public ImportModuleNameTableEntry?[]? ImportModuleNameTable { get; set; }
2023-09-04 21:14:41 -04:00
#endif
2023-09-04 00:11:04 -04:00
/// <summary>
/// Import procedure name table
/// </summary>
2023-09-04 21:14:41 -04:00
#if NET48
2023-09-04 00:11:04 -04:00
public ImportModuleProcedureNameTableEntry[] ImportModuleProcedureNameTable { get; set; }
2023-09-04 21:14:41 -04:00
#else
2023-09-10 20:27:14 -04:00
public ImportModuleProcedureNameTableEntry?[]? ImportModuleProcedureNameTable { get; set; }
2023-09-04 21:14:41 -04:00
#endif
2023-09-04 00:11:04 -04:00
/// <summary>
/// Per-Page checksum table
/// </summary>
2023-09-04 21:14:41 -04:00
#if NET48
2023-09-04 00:11:04 -04:00
public PerPageChecksumTableEntry[] PerPageChecksumTable { get; set; }
2023-09-04 21:14:41 -04:00
#else
2023-09-10 20:27:14 -04:00
public PerPageChecksumTableEntry?[]? PerPageChecksumTable { get; set; }
2023-09-04 21:14:41 -04:00
#endif
2023-09-04 00:11:04 -04:00
/// <summary>
/// Non-Resident Name table
/// </summary>
2023-09-04 21:14:41 -04:00
#if NET48
2023-09-04 00:11:04 -04:00
public NonResidentNamesTableEntry[] NonResidentNamesTable { get; set; }
2023-09-04 21:14:41 -04:00
#else
2023-09-10 20:27:14 -04:00
public NonResidentNamesTableEntry?[]? NonResidentNamesTable { get; set; }
2023-09-04 21:14:41 -04:00
#endif
2023-09-04 00:11:04 -04:00
// TODO: Non-resident directives data (Undefined)
/// <summary>
/// Debug information
/// </summary>
2023-09-04 21:14:41 -04:00
#if NET48
2023-09-04 00:11:04 -04:00
public DebugInformation DebugInformation { get; set; }
2023-09-04 21:14:41 -04:00
#else
public DebugInformation? DebugInformation { get; set; }
#endif
2023-09-04 00:11:04 -04:00
}
}