namespace SabreTools.Models.NewExecutable { /// /// The NE header is a relatively large structure with multiple characteristics. /// Because of the age of the format some items are unclear in meaning. /// /// /// public sealed class ExecutableHeader { /// /// Signature word. /// "N" is low-order byte. /// "E" is high-order byte. /// #if NET48 public string Magic; #else public string? Magic; #endif /// /// Version number of the linker. /// public byte LinkerVersion { get; set; } /// /// Revision number of the linker. /// public byte LinkerRevision { get; set; } /// /// Entry Table file offset, relative to the beginning of the segmented EXE header. /// public ushort EntryTableOffset { get; set; } /// /// Number of bytes in the entry table. /// public ushort EntryTableSize { get; set; } /// /// 32-bit CRC of entire contents of file. /// /// These words are taken as 00 during the calculation. public uint CrcChecksum { get; set; } /// /// Flag word /// public HeaderFlag FlagWord { get; set; } /// /// Segment number of automatic data segment. /// This value is set to zero if SINGLEDATA and /// MULTIPLEDATA flag bits are clear, NOAUTODATA is /// indicated in the flags word. /// /// /// A Segment number is an index into the module's segment /// table. The first entry in the segment table is segment /// number 1. /// public ushort AutomaticDataSegmentNumber { get; set; } /// /// Initial size, in bytes, of dynamic heap added to the /// data segment. This value is zero if no initial local /// heap is allocated. /// public ushort InitialHeapAlloc { get; set; } /// /// Initial size, in bytes, of stack added to the data /// segment. This value is zero to indicate no initial /// stack allocation, or when SS is not equal to DS. /// public ushort InitialStackAlloc { get; set; } /// /// Segment number:offset of CS:IP. /// public uint InitialCSIPSetting { get; set; } /// /// Segment number:offset of SS:SP. /// /// /// If SS equals the automatic data segment and SP equals /// zero, the stack pointer is set to the top of the /// automatic data segment just below the additional heap /// area. /// public uint InitialSSSPSetting { get; set; } /// /// Number of entries in the Segment Table. /// public ushort FileSegmentCount { get; set; } /// /// Number of entries in the Module Reference Table. /// public ushort ModuleReferenceTableSize { get; set; } /// /// Number of bytes in the Non-Resident Name Table. /// public ushort NonResidentNameTableSize { get; set; } /// /// Segment Table file offset, relative to the beginning /// of the segmented EXE header. /// public ushort SegmentTableOffset { get; set; } /// /// Resource Table file offset, relative to the beginning /// of the segmented EXE header. /// public ushort ResourceTableOffset { get; set; } /// /// Resident Name Table file offset, relative to the /// beginning of the segmented EXE header. /// public ushort ResidentNameTableOffset { get; set; } /// /// Module Reference Table file offset, relative to the /// beginning of the segmented EXE header. /// public ushort ModuleReferenceTableOffset { get; set; } /// /// Imported Names Table file offset, relative to the /// beginning of the segmented EXE header. /// public ushort ImportedNamesTableOffset { get; set; } /// /// Non-Resident Name Table offset, relative to the /// beginning of the file. /// public uint NonResidentNamesTableOffset { get; set; } /// /// Number of movable entries in the Entry Table. /// public ushort MovableEntriesCount { get; set; } /// /// Logical sector alignment shift count, log(base 2) of /// the segment sector size (default 9). /// public ushort SegmentAlignmentShiftCount { get; set; } /// /// Number of resource entries. /// public ushort ResourceEntriesCount { get; set; } /// /// Executable type, used by loader. /// public OperatingSystem TargetOperatingSystem { get; set; } /// /// Other OS/2 flags /// public OS2Flag AdditionalFlags { get; set; } /// /// Offset to return thunks or start of gangload area /// public ushort ReturnThunkOffset { get; set; } /// /// Offset to segment reference thunks or size of gangload area /// public ushort SegmentReferenceThunkOffset { get; set; } /// /// Minimum code swap area size /// public ushort MinCodeSwapAreaSize { get; set; } /// /// Windows SDK revison number /// public byte WindowsSDKRevision { get; set; } /// /// Windows SDK version number /// public byte WindowsSDKVersion { get; set; } } }