From 05d79bb11a39fbd9d177b118fe0e90f3f815db6c Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Thu, 29 Mar 2018 00:02:48 -0700 Subject: [PATCH] [Constants] Add known rom header signatures --- SabreTools.Library/Data/Constants.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/SabreTools.Library/Data/Constants.cs b/SabreTools.Library/Data/Constants.cs index fa5cd0be..73a43816 100644 --- a/SabreTools.Library/Data/Constants.cs +++ b/SabreTools.Library/Data/Constants.cs @@ -513,22 +513,42 @@ namespace SabreTools.Library.Data #region Magic numbers public static readonly byte[] SevenZipSignature = { 0x37, 0x7a, 0xbc, 0xaf, 0x27, 0x1c }; + public static readonly byte[] A7800SignatureV1 = { 0x41, 0x54, 0x41, 0x52, 0x49, 0x37, 0x38, 0x30, 0x30 }; // Offset 0x01 + public static readonly byte[] A7800SignatureV2 = { 0x41, 0x43, 0x54, 0x55, 0x41, 0x4c, 0x20, 0x43, 0x41, 0x52, 0x54, 0x20, 0x44, 0x41, + 0x54, 0x41, 0x20, 0x53, 0x54, 0x41, 0x52, 0x54, 0x53, 0x20, 0x48, 0x45, 0x52, 0x45 }; // Offset 0x64 public static readonly byte[] BZ2Signature = { 0x42, 0x5a, 0x68 }; public static readonly byte[] CabinetSignature = { 0x4d, 0x53, 0x43, 0x46 }; public static readonly byte[] CHDSignature = { 0x4d, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x48, 0x44 }; public static readonly byte[] ELFSignature = { 0x7f, 0x45, 0x4c, 0x46 }; + public static readonly byte[] FDSSignatureV1 = { 0x46, 0x44, 0x53, 0x1a, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + public static readonly byte[] FDSSignatureV2 = { 0x46, 0x44, 0x53, 0x1a, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + public static readonly byte[] FDSSignatureV3 = { 0x46, 0x44, 0x53, 0x1a, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + public static readonly byte[] FDSSignatureV4 = { 0x46, 0x44, 0x53, 0x1a, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; public static readonly byte[] FreeArcSignature = { 0x41, 0x72, 0x43, 0x01 }; public static readonly byte[] GzSignature = { 0x1f, 0x8b, 0x08 }; public static readonly byte[] LRZipSignature = { 0x4c, 0x52, 0x5a, 0x49 }; + public static readonly byte[] LynxSignatureV1 = { 0x4c, 0x59, 0x4f, 0x58 }; + public static readonly byte[] LynxSignatureV2 = { 0x42, 0x53, 0x39 }; // Offset 0x06 public static readonly byte[] LZ4Signature = { 0x18, 0x4d, 0x22, 0x04 }; public static readonly byte[] LZ4SkippableMinSignature = { 0x18, 0x4d, 0x22, 0x04 }; public static readonly byte[] LZ4SkippableMaxSignature = { 0x18, 0x4d, 0x2a, 0x5f }; + public static readonly byte[] N64Signature = { 0x40, 0x12, 0x37, 0x80 }; + public static readonly byte[] NESSignature = { 0x4e, 0x45, 0x53, 0x1a }; + public static readonly byte[] PCESignature = { 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, 0xbb, 0x02 }; public static readonly byte[] PESignature = { 0x4d, 0x5a }; + public static readonly byte[] PSIDSignatureV1 = { 0x50, 0x53, 0x49, 0x44, 0x00, 0x01, 0x00, 0x76 }; + public static readonly byte[] PSIDSignatureV2 = { 0x50, 0x53, 0x49, 0x44, 0x00, 0x02, 0x00, 0x7c }; + public static readonly byte[] PSIDSignatureV3 = { 0x50, 0x53, 0x49, 0x44, 0x00, 0x03, 0x00, 0x7c }; public static readonly byte[] RarSignature = { 0x52, 0x61, 0x72, 0x21, 0x1a, 0x07, 0x00 }; public static readonly byte[] RarFiveSignature = { 0x52, 0x61, 0x72, 0x21, 0x1a, 0x07, 0x01, 0x00 }; + public static readonly byte[] SMCSignature = { 0xaa, 0xbb, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00 }; // Offset 0x16 + public static readonly byte[] SPCSignature = { 0x53, 0x4e, 0x45, 0x53, 0x2d, 0x53, 0x50, 0x43 }; public static readonly byte[] TarSignature = { 0x75, 0x73, 0x74, 0x61, 0x72, 0x20, 0x20, 0x00 }; public static readonly byte[] TarZeroSignature = { 0x75, 0x73, 0x74, 0x61, 0x72, 0x00, 0x30, 0x30 }; + public static readonly byte[] UFOSignature = { 0x53, 0x55, 0x50, 0x45, 0x52, 0x55, 0x46, 0x4f }; // Offset 0x16 + public static readonly byte[] V64Signature = { 0x80, 0x37, 0x12, 0x40 }; public static readonly byte[] XZSignature = { 0xfd, 0x37, 0x7a, 0x58, 0x5a, 0x00, 0x00 }; + public static readonly byte[] Z64Signature = { 0x37, 0x80, 0x40, 0x12 }; public static readonly byte[] ZipSignature = { 0x50, 0x4b, 0x03, 0x04 }; public static readonly byte[] ZipSignatureEmpty = { 0x50, 0x4b, 0x05, 0x06 }; public static readonly byte[] ZipSignatureSpanned = { 0x50, 0x4b, 0x07, 0x08 };