mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-09-22 23:05:03 +00:00
Add MoPaQ printing skeleton
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user