Files
SabreTools.Serialization/SabreTools.Data.Models/XboxExecutable/Certificate.cs

100 lines
3.3 KiB
C#
Raw Normal View History

2026-03-13 10:51:31 -04:00
namespace SabreTools.Data.Models.XboxExecutable
2026-03-13 10:28:05 -04:00
{
/// <summary>
/// XBox Executable certificate
/// </summary>
/// <see href="https://www.caustik.com/cxbx/download/xbe.htm"/>
2026-03-13 12:31:33 -04:00
/// <see href="https://github.com/Cxbx-Reloaded/Cxbx-Reloaded/blob/master/src/common/xbe/Xbe.h"/>
2026-03-13 10:51:31 -04:00
public class Certificate
2026-03-13 10:28:05 -04:00
{
/// <summary>
/// Number of bytes that should be reserved for this certificate.
/// </summary>
public uint SizeOfCertificate { get; set; }
/// <summary>
/// Time and Date when this certificate was created. Standard windows format.
/// </summary>
public uint TimeDate { get; set; }
/// <summary>
/// Title ID for this application. This field doesn't appear to matter with
/// unsigned code, so it can be set to zero.
/// </summary>
2026-03-14 20:51:22 -04:00
public uint TitleID { get; set; }
2026-03-13 10:28:05 -04:00
/// <summary>
/// Title name for this application (i.e. L"The Simpsons Road Rage").
/// This buffer contains enough room for 40 Unicode characters.
/// </summary>
public byte[] TitleName { get; set; } = new byte[0x50];
/// <summary>
/// Alternate Title IDs (16 4-byte DWORDs) for this certificate. These do not appear
/// to matter with unsigned code (or signed code, for that matter), so they can all
/// be set to zero.
/// </summary>
2026-03-14 20:51:22 -04:00
public uint[] AlternativeTitleIDs { get; set; } = new uint[16];
2026-03-13 10:28:05 -04:00
/// <summary>
/// Allowed media types for this .XBE.
/// </summary>
2026-03-13 10:51:31 -04:00
public AllowedMediaTypes AllowedMediaTypes { get; set; }
2026-03-13 10:28:05 -04:00
/// <summary>
/// Game region for this .XBE.
/// </summary>
2026-03-13 10:51:31 -04:00
public GameRegion GameRegion { get; set; }
2026-03-13 10:28:05 -04:00
/// <summary>
/// Game ratings for this .XBE. It is typically safe to set this to 0xFFFFFFFF.
/// </summary>
public uint GameRatings { get; set; }
/// <summary>
/// Disk Number. Typically zero.
/// </summary>
public uint DiskNumber { get; set; }
/// <summary>
/// Certificate Version.
/// </summary>
public uint Version { get; set; }
/// <summary>
/// 16-byte LAN Key. An unsigned .XBE can just zero these out.
/// </summary>
public byte[] LANKey { get; set; } = new byte[16];
/// <summary>
/// 16-byte Signature Key. An unsigned .XBE can just zero these out.
/// </summary>
public byte[] SignatureKey { get; set; } = new byte[16];
/// <summary>
/// 16 x 16-byte Signature Keys. An unsigned .XBE can just zero these out.
/// </summary>
2026-03-13 10:51:31 -04:00
public byte[][] AlternateSignatureKeys { get; set; } = new byte[16][];
2026-03-13 12:10:45 -04:00
2026-03-13 12:29:17 -04:00
/// <summary>
/// Original Certificate Size?
/// </summary>
public uint OriginalCertificateSize { get; set; }
/// <summary>
/// Online Service ID
/// </summary>
public uint OnlineService { get; set; }
/// <summary>
/// Extra Security Flags
/// </summary>
public uint SecurityFlags { get; set; }
/// <summary>
/// Code Encryption Key?
/// </summary>
public byte[] CodeEncKey { get; set; } = new byte[16];
2026-03-13 10:28:05 -04:00
}
}