mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-07-08 18:06:34 +00:00
Add and use SGA constants
This commit is contained in:
@@ -3,20 +3,12 @@ using System.IO;
|
||||
using System.Text;
|
||||
using BurnOutSharp.Models.SGA;
|
||||
using BurnOutSharp.Utilities;
|
||||
using static BurnOutSharp.Models.SGA.Constants;
|
||||
|
||||
namespace BurnOutSharp.Builders
|
||||
{
|
||||
public static class SGA
|
||||
{
|
||||
#region Constants
|
||||
|
||||
/// <summary>
|
||||
/// Length of a SGA checksum in bytes
|
||||
/// </summary>
|
||||
public const int HL_SGA_CHECKSUM_LENGTH = 0x00008000;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Byte Data
|
||||
|
||||
/// <summary>
|
||||
@@ -101,7 +93,7 @@ namespace BurnOutSharp.Builders
|
||||
// TODO: Use marshalling here instead of building
|
||||
byte[] signatureBytes = data.ReadBytes(8);
|
||||
string signature = Encoding.ASCII.GetString(signatureBytes);
|
||||
if (signature != "_ARCHIVE")
|
||||
if (signature != SignatureString)
|
||||
return null;
|
||||
|
||||
ushort majorVersion = data.ReadUInt16();
|
||||
|
||||
16
BurnOutSharp.Models/SGA/Constants.cs
Normal file
16
BurnOutSharp.Models/SGA/Constants.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
namespace BurnOutSharp.Models.SGA
|
||||
{
|
||||
public static class Constants
|
||||
{
|
||||
public static readonly byte[] SignatureBytes = new byte[] { 0x5f, 0x41, 0x52, 0x43, 0x48, 0x49, 0x56, 0x45 };
|
||||
|
||||
public const string SignatureString = "_ARCHIVE";
|
||||
|
||||
public const ulong SignatureUInt64 = 0x455649484352415f;
|
||||
|
||||
/// <summary>
|
||||
/// Length of a SGA checksum in bytes
|
||||
/// </summary>
|
||||
public const int HL_SGA_CHECKSUM_LENGTH = 0x00008000;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user