Modify array finding, part 2

This commit is contained in:
Matt Nadareski
2021-03-20 20:47:56 -07:00
parent b6b7a5e7aa
commit 544aaed9da
65 changed files with 193 additions and 186 deletions

View File

@@ -11,12 +11,12 @@ namespace BurnOutSharp.ProtectionType
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
{
// Cd3Ctl
byte[] check = new byte[] { 0x43, 0x64, 0x33, 0x43, 0x74, 0x6C };
byte?[] check = new byte?[] { 0x43, 0x64, 0x33, 0x43, 0x74, 0x6C };
if (fileContent.FirstPosition(check, out int position))
return "MediaMax CD-3" + (includePosition ? $" (Index {position})" : string.Empty);
// DllInstallSbcp
check = new byte[] { 0x44, 0x6C, 0x6C, 0x49, 0x6E, 0x73, 0x74, 0x61, 0x6C, 0x6C, 0x53, 0x62, 0x63, 0x70 };
check = new byte?[] { 0x44, 0x6C, 0x6C, 0x49, 0x6E, 0x73, 0x74, 0x61, 0x6C, 0x6C, 0x53, 0x62, 0x63, 0x70 };
if (fileContent.FirstPosition(check, out position))
return "MediaMax CD-3" + (includePosition ? $" (Index {position})" : string.Empty);