using System; namespace BinaryObjectScanner.Models.NewExecutable { [Flags] public enum FixedSegmentEntryFlag : byte { /// /// Set if the entry is exported. /// Exported = 0x01, /// /// Set if the entry uses a global (shared) data segments. /// /// /// The first assembly-language instruction in the /// entry point prologue must be "MOV AX,data /// segment number". This may be set only for /// SINGLEDATA library modules. /// Global = 0x02, } [Flags] public enum HeaderFlag : ushort { #region Program Flags NOAUTODATA = 0x0000, /// /// Shared automatic data segment /// SINGLEDATA = 0x0001, /// /// Instanced automatic data segment /// MULTIPLEDATA = 0x0002, /// /// Global initialization /// GlobalInitialization = 0x0004, /// /// Protected mode only /// ProtectedModeOnly = 0x0008, /// /// 8086 instructions /// Instructions8086 = 0x0010, /// /// 80286 instructions /// Instructions80286 = 0x0020, /// /// 80386 instructions /// Instructions80386 = 0x0040, /// /// 80x87 instructions /// Instructions80x87 = 0x0080, #endregion #region Application Flags /// /// Full screen (not aware of Windows/P.M. API) /// FullScreen = 0x0100, /// /// Compatible with Windows/P.M. API /// WindowsPMCompatible = 0x0200, /// /// Uses Windows/P.M. API /// WindowsPM = 0x0400, /// /// OS/2 family application /// OS2FamilyApplication = 0x0800, /// /// Unknown (Reserved?) /// UnknownReserved = 0x1000, /// /// Errors detected at link time, module will not load /// ErrorsDetectedAtLinkTime = 0x2000, /// /// Unknown (non-conforming program) /// UnknownNonConforming = 0x4000, /// /// Library module. /// The SS:SP information is invalid, CS:IP points /// to an initialization procedure that is called /// with AX equal to the module handle. This /// initialization procedure must perform a far /// return to the caller, with AX not equal to /// zero to indicate success, or AX equal to zero /// to indicate failure to initialize. DS is set /// to the library's data segment if the /// SINGLEDATA flag is set. Otherwise, DS is set /// to the caller's data segment. /// /// /// A program or DLL can only contain dynamic /// links to executable files that have this /// library module flag set. One program cannot /// dynamic-link to another program. /// LibraryModule = 0x8000, #endregion } [Flags] public enum MoveableSegmentEntryFlag : byte { /// /// Set if the entry is exported. /// Exported = 0x01, /// /// Set if the entry uses a global (shared) data segments. /// Global = 0x02, } public enum OperatingSystem : byte { OS2 = 0x01, WINDOWS = 0x02, EU_MSDOS4 = 0x03, WINDOWS_386 = 0x04, BOSS = 0x05, } [Flags] public enum OS2Flag : byte { /// /// Long filename support /// LongFilenameSupport = 0x01, /// /// 2.x protected mode /// ProtectedMode = 0x02, /// /// 2.x proportional fonts /// ProportionalFonts = 0x04, /// /// Executable has gangload area /// HasGangload = 0x08, /// /// Unknown /// Unknown = 0xF0, } public enum OSFixupType : ushort { /// /// FIARQQ, FJARQQ /// FIARQQ = 0x0001, /// /// FISRQQ, FJSRQQ /// FISRQQ = 0x0002, /// /// FICRQQ, FJCRQQ /// FICRQQ = 0x0003, FIERQQ = 0x0004, FIDRQQ = 0x0005, FIWRQQ = 0x0006, } [Flags] public enum RelocationRecordFlag : byte { TARGET_MASK = 0x03, INTERNALREF = 0x00, IMPORTORDINAL = 0x01, IMPORTNAME = 0x02, OSFIXUP = 0x03, ADDITIVE = 0x04, } public enum RelocationRecordSourceType : byte { SOURCE_MASK = 0x0F, LOBYTE = 0x00, SEGMENT = 0x02, /// /// 32-bit pointer /// FAR_ADDR = 0x03, /// /// 16-bit offset /// OFFSET = 0x05, } [Flags] public enum ResourceTypeResourceFlag : ushort { /// /// Resource is not fixed. /// MOVEABLE = 0x0010, /// /// Resource can be shared. /// PURE = 0x0020, /// /// Resource is preloaded. /// PRELOAD = 0x0040, } public enum SegmentEntryType { /// /// 000h - There is no entry data in an unused bundle. The next bundle /// follows this field. This is used by the linker to skip ordinal numbers. /// Unused, /// /// 001h-0FEh - Segment number for fixed segment entries. A fixed segment /// entry is 3 bytes long. /// FixedSegment, /// /// 0FFH - Moveable segment entries. The entry data contains the segment /// number for the entry points. A moveable segment entry is 6 bytes long. /// MoveableSegment, } [Flags] public enum SegmentTableEntryFlag : ushort { /// /// Segment-type field. /// TYPE_MASK = 0x0007, /// /// Code-segment type. /// CODE = 0x0000, /// /// Data-segment type. /// DATA = 0x0001, /// /// Segment is not fixed. /// MOVEABLE = 0x0010, /// /// Segment will be preloaded; read-only if this is a data segment. /// PRELOAD = 0x0040, /// /// Set if segment has relocation records. /// RELOCINFO = 0x0100, /// /// Discard priority. /// DISCARD = 0xF000, } }