From 3b4929a3682933624855b2cd04dd51080c93f6c3 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Thu, 8 Dec 2022 17:19:42 -0800 Subject: [PATCH] Invert if in ProtectDisc check for clarity --- BurnOutSharp/ProtectionType/ProtectDisc.cs | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/BurnOutSharp/ProtectionType/ProtectDisc.cs b/BurnOutSharp/ProtectionType/ProtectDisc.cs index 8d5d61ed..7376e61e 100644 --- a/BurnOutSharp/ProtectionType/ProtectDisc.cs +++ b/BurnOutSharp/ProtectionType/ProtectDisc.cs @@ -23,18 +23,18 @@ namespace BurnOutSharp.ProtectionType for (int i = 3; i < sections.Length; i++) { var nthSectionData = pex.GetSectionData(i); - if (nthSectionData != null) - { - var matchers = new List - { - // ACE-PCD - new ContentMatchSet(new byte?[] { 0x41, 0x43, 0x45, 0x2D, 0x50, 0x43, 0x44 }, GetVersion6till8, "ProtectDISC"), - }; + if (nthSectionData == null) + continue; - string match = MatchUtil.GetFirstMatch(file, nthSectionData, matchers, includeDebug); - if (!string.IsNullOrWhiteSpace(match)) - return match; - } + var matchers = new List + { + // ACE-PCD + new ContentMatchSet(new byte?[] { 0x41, 0x43, 0x45, 0x2D, 0x50, 0x43, 0x44 }, GetVersion6till8, "ProtectDISC"), + }; + + string match = MatchUtil.GetFirstMatch(file, nthSectionData, matchers, includeDebug); + if (!string.IsNullOrWhiteSpace(match)) + return match; } // Get the .data/DATA section, if it exists @@ -269,7 +269,7 @@ namespace BurnOutSharp.ProtectionType return string.Empty; } - + private static string GetVOBBuild(byte[] fileContent, int position) { if (!char.IsNumber((char)fileContent[position - 13]))