Modify array finding, part 1

This commit is contained in:
Matt Nadareski
2021-03-20 19:00:22 -07:00
parent 07882f7632
commit cdc4d509ee
50 changed files with 190 additions and 168 deletions

View File

@@ -7,11 +7,11 @@
{
// .ldr
byte[] check = new byte[] { 0x2E, 0x6C, 0x64, 0x72 };
if (fileContent.Contains(check, out int position))
if (fileContent.FirstPosition(check, out int position))
{
// .ldt
byte[] check2 = new byte[] { 0x2E, 0x6C, 0x64, 0x74 };
if (fileContent.Contains(check2, out int position2))
if (fileContent.FirstPosition(check2, out int position2))
return "3PLock" + (includePosition ? $" (Index {position}, {position2})" : string.Empty);
}