namespace SabreTools.Data.Models.XenonExecutable
{
///
/// Xenon (Xbox 360) Executable format header
///
///
///
public class Header
{
///
/// "XEX2" is the only supported magic identifier string
/// "XEX0", "XEX-", "XEX?", "XEX%", and "XEX1" files are not supported, and are only found in early pre-production builds
///
public byte[] MagicNumber { get; set; } = new byte[4];
///
/// Bit field with lowest 8 bits having known values: (lowest to highest)
/// Title Module, Exports To Title, System Debugger, DLL Module, Module Patch, Patch Full, Patch Delta, User Mode
/// Upper 3 bytes should be zeroed
///
/// Big-endian
public uint ModuleFlags { get; set; }
///
/// Address at which the PE data begins
/// The PE data is encrypted/compressed in retail XEX files
///
/// Big-endian
public uint PEDataOffset { get; set; }
///
/// Reserved field, should be zeroed
///
/// Big-endian
public uint Reserved { get; set; }
///
/// Address at which the certificate structure begins
///
/// Big-endian
public uint CertificateOffset { get; set; }
///
/// Number of optional headers
///
/// Big-endian
public uint OptionalHeaderCount { get; set; }
///
/// Optional headers that follow the main header
///
public OptionalHeader[]? OptionalHeaders { get; set; }
}
}