Add a bunch of useful constants

This commit is contained in:
Matt Nadareski
2025-09-22 09:35:00 -04:00
parent 710ddc912d
commit 605a3bf30d
12 changed files with 83 additions and 2 deletions

View File

@@ -2,6 +2,8 @@ namespace SabreTools.Models.BDPlus
{
public static class Constants
{
public static readonly byte[] SignatureBytes = [0x42, 0x44, 0x53, 0x56, 0x4D, 0x5F, 0x43, 0x43];
public const string SignatureString = "BDSVM_CC";
}
}

View File

@@ -0,0 +1,9 @@
namespace SabreTools.Models.BZip2
{
public static class Constants
{
public static readonly byte[] SignatureBytes = [0x42, 0x52, 0x68];
public const string SignatureString = "BRh";
}
}

View File

@@ -2,6 +2,8 @@ namespace SabreTools.Models.CHD
{
public static class Constants
{
public static readonly byte[] SignatureBytes = [0x4D, 0x43, 0x6F, 0x6D, 0x70, 0x72, 0x48, 0x44];
public const string SignatureString = "MComprHD";
#region Header Sizes

View File

@@ -3,5 +3,7 @@ namespace SabreTools.Models.InstallShieldArchiveV3
public static class Constants
{
public const uint HeaderSignature = 0x8C655D13;
public static readonly byte[] HeaderSignatureBytes = [0x13, 0x5D, 0x65, 0x8C];
}
}

View File

@@ -0,0 +1,9 @@
namespace SabreTools.Models.LDSCRYPT
{
public static class Constants
{
public static readonly byte[] SignatureBytes = [0x4C, 0x44, 0x53, 0x43, 0x52, 0x59, 0x50, 0x54];
public const string SignatureString = "LDSCRYPT";
}
}

View File

@@ -3,20 +3,32 @@ namespace SabreTools.Models.PFF
/// <see href="https://devilsclaws.net/download/file-pff-new-bz2"/>
public static class Constants
{
public static readonly byte[] Version0SignatureBytes = [0x50, 0x46, 0x46, 0x30];
public const string Version0SignatureString = "PFF0";
public const uint Version0HSegmentSize = 0x00000020;
// Version 1 not confirmed
// public const string Version1SignatureString = "PFF1";
// public const uint Version1SegmentSize = 0x00000020;
public static readonly byte[] Version2SignatureBytes = [0x50, 0x46, 0x46, 0x32];
public const string Version2SignatureString = "PFF2";
public const uint Version2SegmentSize = 0x00000020;
public static readonly byte[] Version3SignatureBytes = [0x50, 0x46, 0x46, 0x33];
public const string Version3SignatureString = "PFF3";
public const uint Version3SegmentSize = 0x00000024;
public static readonly byte[] Version4SignatureBytes = [0x50, 0x46, 0x46, 0x34];
public const string Version4SignatureString = "PFF4";
public const uint Version4SegmentSize = 0x00000028;
public const string FooterKingTag = "KING";

View File

@@ -0,0 +1,9 @@
namespace SabreTools.Models.RAR
{
public static class Constants
{
public static readonly byte[] OldSignatureBytes = [0x52, 0x61, 0x72, 0x21, 0x1A, 0x07, 0x00];
public static readonly byte[] NewSignatureBytes = [0x52, 0x61, 0x72, 0x21, 0x1A, 0x07, 0x01, 0x00];
}
}

View File

@@ -0,0 +1,13 @@
namespace SabreTools.Models.RealArcades
{
public static class Constants
{
public static readonly byte[] MezzanineSignatureBytes = [0x58, 0x5A, 0x69, 0x70, 0x32, 0x2E, 0x30];
public const string MezzanineSignatureString = "XZip2.0";
public static readonly byte[] RgsSignatureBytes = [0x52, 0x41, 0x53, 0x47, 0x49, 0x32, 0x2E, 0x30];
public const string RgsSignatureString = "RASGI2.0";
}
}

View File

@@ -0,0 +1,7 @@
namespace SabreTools.Models.SevenZip
{
public static class Constants
{
public static readonly byte[] SignatureBytes = [0x37, 0x7A, 0xBC, 0xAF, 0x27, 0x1C];
}
}

View File

@@ -0,0 +1,9 @@
namespace SabreTools.Models.TAR
{
public static class Constants
{
public static readonly byte[] UstarSignatureBytes = [0x75, 0x73, 0x74, 0x61, 0x72];
public const string UstarSignatureString = "ustar";
}
}

View File

@@ -68,9 +68,9 @@ namespace SabreTools.Models.TAR
#region USTAR Extension
/// <summary>
/// UStar indicator, "ustar", then NUL
/// UStar indicator, "ustar"
/// </summary>
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 6)]
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 5)]
public string? Magic;
/// <summary>

View File

@@ -0,0 +1,7 @@
namespace SabreTools.Models.XZ
{
public static class Constants
{
public static readonly byte[] SignatureBytes = [0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00];
}
}