mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-04-24 23:30:07 +00:00
Add LE/LX object page table
This commit is contained in:
@@ -313,6 +313,35 @@ namespace BurnOutSharp.Models.LinearExecutable
|
||||
PrivilegeLevel = 0x8000,
|
||||
}
|
||||
|
||||
[Flags]
|
||||
public enum ObjectPageFlags : ushort
|
||||
{
|
||||
/// <summary>
|
||||
/// Legal Physical Page in the module (Offset from Preload Page Section).
|
||||
/// </summary>
|
||||
LegalPhysicalPage = 0x0000,
|
||||
|
||||
/// <summary>
|
||||
/// Iterated Data Page (Offset from Iterated Data Pages Section).
|
||||
/// </summary>
|
||||
IteratedDataPage = 0x0001,
|
||||
|
||||
/// <summary>
|
||||
/// Invalid Page (zero).
|
||||
/// </summary>
|
||||
InvalidPage = 0x0002,
|
||||
|
||||
/// <summary>
|
||||
/// Zero Filled Page (zero).
|
||||
/// </summary>
|
||||
ZeroFilledPage = 0x0003,
|
||||
|
||||
/// <summary>
|
||||
/// Range of Pages.
|
||||
/// </summary>
|
||||
RangeOfPages = 0x0004,
|
||||
}
|
||||
|
||||
public enum OperatingSystem : ushort
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -25,7 +25,11 @@ namespace BurnOutSharp.Models.LinearExecutable
|
||||
/// </summary>
|
||||
public ObjectTableEntry[] ObjectTable { get; set; }
|
||||
|
||||
// TODO: Object page map table
|
||||
/// <summary>
|
||||
/// Object page table
|
||||
/// </summary>
|
||||
public ObjectPageTableEntry[] ObjectPageTable { get; set; }
|
||||
|
||||
// TODO: Object iterate data map table
|
||||
// TODO: Resource table
|
||||
// TODO: Resident-names table
|
||||
|
||||
60
BurnOutSharp.Models/LinearExecutable/ObjectPageTableEntry.cs
Normal file
60
BurnOutSharp.Models/LinearExecutable/ObjectPageTableEntry.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace BurnOutSharp.Models.LinearExecutable
|
||||
{
|
||||
/// <summary>
|
||||
/// The Object page table provides information about a logical page in an object.
|
||||
/// A logical page may be an enumerated page, a pseudo page or an iterated page.
|
||||
/// The structure of the object page table in conjunction with the structure of
|
||||
/// the object table allows for efficient access of a page when a page fault occurs,
|
||||
/// while still allowing the physical page data to be located in the preload page,
|
||||
/// demand load page or iterated data page sections in the linear EXE module. The
|
||||
/// logical page entries in the Object Page Table are numbered starting from one.
|
||||
/// The Object Page Table is parallel to the Fixup Page Table as they are both
|
||||
/// indexed by the logical page number.
|
||||
/// </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 ObjectPageTableEntry
|
||||
{
|
||||
/// <summary>
|
||||
/// Offset to the page data in the EXE file.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This field, when bit shifted left by the PAGE OFFSET SHIFT from the module
|
||||
/// header, specifies the offset from the beginning of the Preload Page section
|
||||
/// of the physical page data in the EXE file that corresponds to this logical
|
||||
/// page entry. The page data may reside in the Preload Pages, Demand Load Pages
|
||||
/// or the Iterated Data Pages sections.
|
||||
///
|
||||
/// If the FLAGS field specifies that this is a zero-Filled page then the PAGE
|
||||
/// DATA OFFSET field will contain a 0.
|
||||
///
|
||||
/// If the logical page is specified as an iterated data page, as indicated by
|
||||
/// the FLAGS field, then this field specifies the offset into the Iterated Data
|
||||
/// Pages section.
|
||||
///
|
||||
/// The logical page number (Object Page Table index), is used to index the Fixup
|
||||
/// Page Table to find any fixups associated with the logical page.
|
||||
/// </remarks>
|
||||
public uint PageDataOffset;
|
||||
|
||||
/// <summary>
|
||||
/// Number of bytes of data for this page.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This field specifies the actual number of bytes that represent the page in the
|
||||
/// file. If the PAGE SIZE field from the module header is greater than the value
|
||||
/// of this field and the FLAGS field indicates a Legal Physical Page, the remaining
|
||||
/// bytes are to be filled with zeros. If the FLAGS field indicates an Iterated Data
|
||||
/// Page, the iterated data records will completely fill out the remainder.
|
||||
/// </remarks>
|
||||
public ushort DataSize;
|
||||
|
||||
/// <summary>
|
||||
/// Attributes specifying characteristics of this logical page.
|
||||
/// </summary>
|
||||
public ObjectPageFlags Flags;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user