mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-07-16 22:05:13 +00:00
Add and use XZP constants
This commit is contained in:
@@ -2,6 +2,7 @@ using System.IO;
|
||||
using System.Text;
|
||||
using BurnOutSharp.Models.XZP;
|
||||
using BurnOutSharp.Utilities;
|
||||
using static BurnOutSharp.Models.XZP.Constants;
|
||||
|
||||
namespace BurnOutSharp.Builders
|
||||
{
|
||||
@@ -170,7 +171,7 @@ namespace BurnOutSharp.Builders
|
||||
|
||||
byte[] signature = data.ReadBytes(4);
|
||||
header.Signature = Encoding.ASCII.GetString(signature);
|
||||
if (header.Signature != "piZx")
|
||||
if (header.Signature != HeaderSignatureString)
|
||||
return null;
|
||||
|
||||
header.Version = data.ReadUInt32();
|
||||
@@ -262,7 +263,7 @@ namespace BurnOutSharp.Builders
|
||||
footer.FileLength = data.ReadUInt32();
|
||||
byte[] signature = data.ReadBytes(4);
|
||||
footer.Signature = Encoding.ASCII.GetString(signature);
|
||||
if (footer.Signature != "tFzX")
|
||||
if (footer.Signature != FooterSignatureString)
|
||||
return null;
|
||||
|
||||
return footer;
|
||||
|
||||
17
BurnOutSharp.Models/XZP/Constants.cs
Normal file
17
BurnOutSharp.Models/XZP/Constants.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
namespace BurnOutSharp.Models.XZP
|
||||
{
|
||||
public static class Constants
|
||||
{
|
||||
public static readonly byte[] HeaderSignatureBytes = new byte[] { 0x70, 0x69, 0x5a, 0x78 };
|
||||
|
||||
public const string HeaderSignatureString = "piZx";
|
||||
|
||||
public const uint HeaderSignatureUInt32 = 0x785a6970;
|
||||
|
||||
public static readonly byte[] FooterSignatureBytes = new byte[] { 0x74, 0x46, 0x7a, 0x58 };
|
||||
|
||||
public const string FooterSignatureString = "tFzX";
|
||||
|
||||
public const uint FooterSignatureUInt32 = 0x587a4674;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user