Add MoPaQ printing skeleton

This commit is contained in:
Matt Nadareski
2022-12-14 16:33:26 -08:00
parent b793b74b32
commit afa8b24ba9
2 changed files with 27 additions and 0 deletions

View File

@@ -278,6 +278,9 @@ namespace BurnOutSharp.Tools
if (magic.StartsWith(new byte?[] { 0x4d, 0x50, 0x51, 0x1a }))
return SupportedFileType.MPQ;
if (magic.StartsWith(new byte?[] { 0x4d, 0x50, 0x51, 0x1b }))
return SupportedFileType.MPQ;
#endregion
#region MSI

View File

@@ -292,6 +292,19 @@ namespace Test
}
}
// MoPaQ (MPQ) archive
else if (IsMoPaQ(magic))
{
// Build the archive information
Console.WriteLine("Creating MoPaQ deserializer");
Console.WriteLine();
// TODO: Write and use printing methods
Console.WriteLine("MoPaQ archive printing not currently enabled");
Console.WriteLine();
return;
}
// MS-CAB archive
else if (IsMSCAB(magic))
{
@@ -321,6 +334,17 @@ namespace Test
}
}
/// <summary>
/// Determine if the magic bytes indicate an MoPaQ archive
/// </summary>
private static bool IsMoPaQ(byte[] magic)
{
if (magic == null || magic.Length < 4)
return false;
return magic[0] == 'M' && magic[1] == 'P' && magic[2] == 'Q' && (magic[3] == 0x1A || magic[3] == 0x1B);
}
/// <summary>
/// Determine if the magic bytes indicate an MS-CAB archive
/// </summary>