using System;
namespace BurnOutSharp.Models.LinearExecutable
{
// TODO: Should this be a flag?
public enum BundleType : byte
{
///
/// Unused Entry.
///
UnusedEntry = 0x00,
///
/// 16-bit Entry.
///
SixteenBitEntry = 0x01,
///
/// 286 Call Gate Entry.
///
TwoEightySixCallGateEntry = 0x02,
///
/// 32-bit Entry.
///
ThirtyTwoBitEntry = 0x03,
///
/// Forwarder Entry.
///
ForwarderEntry = 0x04,
///
/// Parameter Typing Information Present.
///
///
/// This bit signifies that additional information is contained in the
/// linear EXE module and will be used in the future for parameter type checking.
///
ParameterTypingInformationPresent = 0x80,
}
public enum ByteOrder : byte
{
///
/// little-endian
///
LE = 0x00,
///
/// big-endian
///
/// non-zero
BE = 0x01,
}
public enum CPUType : ushort
{
///
/// Intel 80286 or upwardly compatible
///
Intel80286 = 0x01,
///
/// Intel 80386 or upwardly compatible
///
Intel80386 = 0x02,
///
/// Intel 80486 or upwardly compatible
///
Intel80486 = 0x03,
///
/// Intel 80586 or upwardly compatible
///
Intel80586 = 0x04,
///
/// Intel i860 (N10) or compatible
///
Inteli860 = 0x20,
///
/// Intel "N11" or compatible
///
IntelN11 = 0x21,
///
/// MIPS Mark I (R2000, R3000) or compatible
///
MIPSMarkI = 0x40,
///
/// MIPS Mark II ( R6000 ) or compatible
///
MIPSMarkII = 0x41,
///
/// MIPS Mark III ( R4000 ) or compatible
///
MIPSMarkIII = 0x42,
}
public enum DebugFormatType : byte
{
///
/// 32-bit CodeView debugger format.
///
CodeView32Bit = 0x00,
///
/// AIX debugger format.
///
AIXDebugger = 0x01,
///
/// 16-bit CodeView debugger format.
///
CodeView16Bit = 0x02,
///
/// 32-bit OS/2 PM debugger (IBM) format.
///
OS2PM32Bit = 0x04,
}
public enum DirectiveNumber : ushort
{
///
/// Resident Flag Mask.
///
///
/// Directive numbers with this bit set indicate that the directive data
/// is in the resident area and will be kept resident in memory when the
/// module is loaded.
///
ResidentFlagMask = 0x8000,
///
/// Verify Record Directive. (Verify record is a resident table.)
///
VerifyRecordDirective = 0x8001,
///
/// Language Information Directive. (This is a non-resident table.)
///
LanguageInformationDirective = 0x0002,
///
/// Co-Processor Required Support Table.
///
CoProcessorRequiredSupportTable = 0x0003,
///
/// Thread State Initialization Directive.
///
ThreadStateInitializationDirective = 0x0004,
// Additional directives can be added as needed in the future, as long as
// they do not overlap previously defined directive numbers.
}
[Flags]
public enum ModuleFlags : uint
{
///
/// Reserved for system use.
///
Reserved0 = 0x00000001,
///
/// Reserved for system use.
///
Reserved1 = 0x00000002,
///
/// Per-Process Library Initialization.
///
///
/// The setting of this bit requires the EIP Object # and EIP fields
/// to have valid values. If the EIP Object # and EIP fields are
/// valid and this bit is NOT set, then Global Library Initialization
/// is assumed. Setting this bit for an EXE file is invalid.
///
Initialization = 0x00000004,
///
/// Reserved for system use.
///
Reserved3 = 0x00000008,
///
/// Internal fixups for the module have been applied.
///
///
/// The setting of this bit in a Linear Executable Module indicates that
/// each object of the module has a preferred load address specified in
/// the Object Table Reloc Base Addr. If the module's objects can not be
/// loaded at these preferred addresses, then the relocation records that
/// have been retained in the file data will be applied.
///
InternalFixupsApplied = 0x00000010,
///
/// External fixups for the module have been applied.
///
ExternalFixupsApplied = 0x00000020,
///
/// Reserved for system use.
///
Reserved6 = 0x00000040,
///
/// Reserved for system use.
///
Reserved7 = 0x00000080,
///
/// Incompatible with PM windowing.
///
IncompatibleWithPMWindowing = 0x00000100,
///
/// Incompatible with PM windowing.
///
CompatibleWithPMWindowing = 0x00000200,
///
/// Uses PM windowing API.
///
UsesPMWindowing = 0x00000300,
///
/// Reserved for system use.
///
Reserved10 = 0x00000400,
///
/// Reserved for system use.
///
Reserved11 = 0x00000800,
///
/// Reserved for system use.
///
Reserved12 = 0x00001000,
///
/// Module is not loadable.
///
///
/// When the 'Module is not loadable' flag is set, it indicates that
/// either errors were detected at link time or that the module is
/// being incrementally linked and therefore can't be loaded.
///
ModuleNotLoadable = 0x00002000,
///
/// Reserved for system use.
///
Reserved14 = 0x00004000,
///
/// Module type mask.
///
ModuleTypeMask = 0x00038000,
///
/// Program module.
///
///
/// A module can not contain dynamic links to other modules that have
/// the 'program module' type.
///
ProgramModule = 0x00000000,
///
/// Library module.
///
LibraryModule = 0x00008000,
///
/// Protected Memory Library module.
///
ProtectedMemoryLibraryModule = 0x00018000,
///
/// Physical Device Driver module.
///
PhysicalDeviceDriverModule = 0x00020000,
///
/// Virtual Device Driver module.
///
VirtualDeviceDriverModule = 0x00028000,
///
/// Per-process Library Termination.
///
///
/// The setting of this bit requires the EIP Object # and EIP fields
/// to have valid values. If the EIP Object # and EIP fields are
/// valid and this bit is NOT set, then Global Library Termination
/// is assumed. Setting this bit for an EXE file is invalid.
///
PerProcessLibraryTermination = 0x40000000,
}
[Flags]
public enum ObjectFlags : ushort
{
///
/// Readable Object.
///
ReadableObject = 0x0001,
///
/// Writable Object.
///
WritableObject = 0x0002,
///
/// Executable Object.
///
ExecutableObject = 0x0004,
// The readable, writable and executable flags provide support for all possible
// protections. In systems where all of these protections are not supported,
// the loader will be responsible for making the appropriate protection match
// for the system.
///
/// Resource Object.
///
ResourceObject = 0x0008,
///
/// Discardable Object.
///
DiscardableObject = 0x0010,
///
/// Object is Shared.
///
Shared = 0x0020,
///
/// Object has Preload Pages.
///
HasPreloadPages = 0x0040,
///
/// Object has Invalid Pages.
///
HasInvalidPages = 0x0080,
///
/// Object has Zero Filled Pages.
///
HasZeroFilledPages = 0x0100,
///
/// Object is Resident (valid for VDDs, PDDs only).
///
Resident = 0x0200,
///
/// Object is Resident & Contiguous (VDDs, PDDs only).
///
ResidentAndContiguous = 0x0300,
///
/// Object is Resident & 'long-lockable' (VDDs, PDDs only).
///
ResidentAndLongLockable = 0x0400,
///
/// Reserved for system use.
///
Reserved = 0x0800,
///
/// 16:16 Alias Required (80x86 Specific).
///
AliasRequired = 0x1000,
///
/// Big/Default Bit Setting (80x86 Specific).
///
BitSetting = 0x2000,
// The 'big/default' bit, for data segments, controls the setting of the
// Big bit in the segment descriptor. (The Big bit, or B-bit, determines
// whether ESP or SP is used as the stack pointer.) For code segments,
// this bit controls the setting of the Default bit in the segment
// descriptor. (The Default bit, or D-bit, determines whether the default
// word size is 32-bits or 16-bits. It also affects the interpretation of
// the instruction stream.)
///
/// Object is conforming for code (80x86 Specific).
///
Conforming = 0x4000,
///
/// Object I/O privilege level (80x86 Specific). Only used for 16:16 Alias Objects.
///
PrivilegeLevel = 0x8000,
}
[Flags]
public enum ObjectPageFlags : ushort
{
///
/// Legal Physical Page in the module (Offset from Preload Page Section).
///
LegalPhysicalPage = 0x0000,
///
/// Iterated Data Page (Offset from Iterated Data Pages Section).
///
IteratedDataPage = 0x0001,
///
/// Invalid Page (zero).
///
InvalidPage = 0x0002,
///
/// Zero Filled Page (zero).
///
ZeroFilledPage = 0x0003,
///
/// Range of Pages.
///
RangeOfPages = 0x0004,
}
public enum OperatingSystem : ushort
{
///
/// Unknown (any "new-format" OS)
///
Unknown = 0x00,
///
/// OS/2 (default)
///
OS2 = 0x01,
///
/// Windows
///
Windows = 0x02,
///
/// DOS 4.x
///
DOS4x = 0x03,
///
/// Windows 386
///
Windows386 = 0x04,
}
public enum WordOrder : byte
{
///
/// little-endian
///
LE = 0x00,
///
/// big-endian
///
/// non-zero
BE = 0x01,
}
}