mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-07-13 12:26:49 +00:00
Add LE/LX module format directives table
This commit is contained in:
@@ -64,6 +64,42 @@ namespace BurnOutSharp.Models.LinearExecutable
|
||||
MIPSMarkIII = 0x42,
|
||||
}
|
||||
|
||||
public enum DirectiveNumber : ushort
|
||||
{
|
||||
/// <summary>
|
||||
/// Resident Flag Mask.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 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.
|
||||
/// </remarks>
|
||||
ResidentFlagMask = 0x8000,
|
||||
|
||||
/// <summary>
|
||||
/// Verify Record Directive. (Verify record is a resident table.)
|
||||
/// </summary>
|
||||
VerifyRecordDirective = 0x8001,
|
||||
|
||||
/// <summary>
|
||||
/// Language Information Directive. (This is a non-resident table.)
|
||||
/// </summary>
|
||||
LanguageInformationDirective = 0x0002,
|
||||
|
||||
/// <summary>
|
||||
/// Co-Processor Required Support Table.
|
||||
/// </summary>
|
||||
CoProcessorRequiredSupportTable = 0x0003,
|
||||
|
||||
/// <summary>
|
||||
/// Thread State Initialization Directive.
|
||||
/// </summary>
|
||||
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
|
||||
{
|
||||
|
||||
@@ -43,7 +43,12 @@ namespace BurnOutSharp.Models.LinearExecutable
|
||||
public ResidentNameTableEntry[] ResidentNameTable { get; set; }
|
||||
|
||||
// TODO: Entry table
|
||||
// TODO: Module format directives table
|
||||
|
||||
/// <summary>
|
||||
/// Module format directives table (optional)
|
||||
/// </summary>
|
||||
public ModuleFormatDirectivesTableEntry[] ModuleFormatDirectivesTable { get; set; }
|
||||
|
||||
// TODO: Resident directives data
|
||||
// TODO: Per-page checksum table
|
||||
// TODO: Fix-up page table
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace BurnOutSharp.Models.LinearExecutable
|
||||
{
|
||||
/// <summary>
|
||||
/// The Module Format Directives Table is an optional table that allows additional
|
||||
/// options to be specified. It also allows for the extension of the linear EXE
|
||||
/// format by allowing additional tables of information to be added to the linear
|
||||
/// EXE module without affecting the format of the linear EXE header. Likewise,
|
||||
/// module format directives provide a place in the linear EXE module for
|
||||
/// 'temporary tables' of information, such as incremental linking information
|
||||
/// and statistic information gathered on the module. When there are no module
|
||||
/// format directives for a linear EXE module, the fields in the linear EXE header
|
||||
/// referencing the module format directives table are zero.
|
||||
/// </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"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public class ModuleFormatDirectivesTableEntry
|
||||
{
|
||||
/// <summary>
|
||||
/// Directive number.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The directive number specifies the type of directive defined. This can be
|
||||
/// used to determine the format of the information in the directive data.
|
||||
/// </remarks>
|
||||
public DirectiveNumber DirectiveNumber;
|
||||
|
||||
/// <summary>
|
||||
/// Directive data length.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This specifies the length in byte of the directive data for this directive number.
|
||||
/// </remarks>
|
||||
public ushort DirectiveDataLength;
|
||||
|
||||
/// <summary>
|
||||
/// Directive data offset.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This is the offset to the directive data for this directive number. It is relative
|
||||
/// to beginning of linear EXE header for a resident table, and relative to the
|
||||
/// beginning of the EXE file for non-resident tables.
|
||||
/// </remarks>
|
||||
public uint DirectiveDataOffset;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user