diff --git a/BurnOutSharp/Matching/MatchUtil.cs b/BurnOutSharp/Matching/MatchUtil.cs index da724fdc..6eea0cc6 100644 --- a/BurnOutSharp/Matching/MatchUtil.cs +++ b/BurnOutSharp/Matching/MatchUtil.cs @@ -91,8 +91,12 @@ namespace BurnOutSharp.Matching // Otherwise, invoke the version method else { - string version = matcher.GetContentVersion(file, fileContent, positions) ?? "Unknown Version"; - matchedProtections.Add($"{matcher.ProtectionName ?? "Unknown Protection"} {version}" + (includePosition ? $" (Index {positionsString})" : string.Empty)); + // A null version returned means the check didn't pass at the version step + string version = matcher.GetContentVersion(file, fileContent, positions); + if (version == null) + continue; + + matchedProtections.Add($"{matcher.ProtectionName ?? "Unknown Protection"} {version}".TrimEnd() + (includePosition ? $" (Index {positionsString})" : string.Empty)); } // If we're stopping after the first protection, bail out here diff --git a/BurnOutSharp/PackerType/SetupFactory.cs b/BurnOutSharp/PackerType/SetupFactory.cs index 1ae6bd7a..1c47fd40 100644 --- a/BurnOutSharp/PackerType/SetupFactory.cs +++ b/BurnOutSharp/PackerType/SetupFactory.cs @@ -79,7 +79,7 @@ namespace BurnOutSharp.PackerType if (!string.IsNullOrEmpty(version)) return version; - return null; + return "(Unknown Version)"; } } } diff --git a/BurnOutSharp/ProtectionType/CDCops.cs b/BurnOutSharp/ProtectionType/CDCops.cs index 4ea83bc1..2ade018a 100644 --- a/BurnOutSharp/ProtectionType/CDCops.cs +++ b/BurnOutSharp/ProtectionType/CDCops.cs @@ -61,7 +61,7 @@ namespace BurnOutSharp.ProtectionType { char[] version = new ArraySegment(fileContent, positions[0] + 15, 4).Select(b => (char)b).ToArray(); if (version[0] == 0x00) - return ""; + return string.Empty; return new string(version); } diff --git a/BurnOutSharp/ProtectionType/DVDCops.cs b/BurnOutSharp/ProtectionType/DVDCops.cs index 8ea7bb03..ca26480c 100644 --- a/BurnOutSharp/ProtectionType/DVDCops.cs +++ b/BurnOutSharp/ProtectionType/DVDCops.cs @@ -27,7 +27,7 @@ namespace BurnOutSharp.ProtectionType { char[] version = new ArraySegment(fileContent, positions[0] + 15, 4).Select(b => (char)b).ToArray(); if (version[0] == 0x00) - return ""; + return string.Empty; return new string(version); } diff --git a/BurnOutSharp/ProtectionType/SafeDisc.cs b/BurnOutSharp/ProtectionType/SafeDisc.cs index d007eafb..ae9704a2 100644 --- a/BurnOutSharp/ProtectionType/SafeDisc.cs +++ b/BurnOutSharp/ProtectionType/SafeDisc.cs @@ -160,7 +160,7 @@ namespace BurnOutSharp.ProtectionType subsubVersion = BitConverter.ToInt32(fileContent, index); if (version == 0) - return ""; + return string.Empty; return $"{version}.{subVersion:00}.{subsubVersion:000}"; } diff --git a/BurnOutSharp/ProtectionType/SecuROM.cs b/BurnOutSharp/ProtectionType/SecuROM.cs index cfe72c42..49e7e173 100644 --- a/BurnOutSharp/ProtectionType/SecuROM.cs +++ b/BurnOutSharp/ProtectionType/SecuROM.cs @@ -140,7 +140,7 @@ namespace BurnOutSharp.ProtectionType subSubSubVersion[3] = (byte)(fileContent[index] ^ 22); if (version == 0 || version > 9) - return ""; + return string.Empty; return $"{version}.{subVersion[0]}{subVersion[1]}.{subSubVersion[0]}{subSubVersion[1]}.{subSubSubVersion[0]}{subSubSubVersion[1]}{subSubSubVersion[2]}{subSubSubVersion[3]}"; } diff --git a/BurnOutSharp/ProtectionType/Sysiphus.cs b/BurnOutSharp/ProtectionType/Sysiphus.cs index e6837cc6..dba575f7 100644 --- a/BurnOutSharp/ProtectionType/Sysiphus.cs +++ b/BurnOutSharp/ProtectionType/Sysiphus.cs @@ -38,8 +38,8 @@ namespace BurnOutSharp.ProtectionType if (char.IsNumber(version) && char.IsNumber(subVersion)) return $"{version}.{subVersion}"; - else - return ""; + + return string.Empty; } } } diff --git a/BurnOutSharp/ProtectionType/Tages.cs b/BurnOutSharp/ProtectionType/Tages.cs index 68509109..315cf74e 100644 --- a/BurnOutSharp/ProtectionType/Tages.cs +++ b/BurnOutSharp/ProtectionType/Tages.cs @@ -113,9 +113,9 @@ namespace BurnOutSharp.ProtectionType return "5.5.0"; case 0x4: return "5.5.2"; + default: + return string.Empty; } - - return ""; } } }