From 0bc1d1efa66ae49ac209d7e0c91a24bf643c5656 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Thu, 20 Feb 2020 14:28:26 -0800 Subject: [PATCH] CheckPath should not call CheckContents --- BurnOutSharp/ProtectionFind.cs | 5 --- .../ProtectionType/CactusDataShield.cs | 1 + BurnOutSharp/ProtectionType/PSXAntiModchip.cs | 33 ++----------------- 3 files changed, 3 insertions(+), 36 deletions(-) diff --git a/BurnOutSharp/ProtectionFind.cs b/BurnOutSharp/ProtectionFind.cs index 9618ac29..e77e189f 100644 --- a/BurnOutSharp/ProtectionFind.cs +++ b/BurnOutSharp/ProtectionFind.cs @@ -249,11 +249,6 @@ namespace BurnOutSharp if (!string.IsNullOrWhiteSpace(protection)) protections.Add(protection); - // PSX Anti-modchip - protection = PSXAntiModchip.CheckPath(path, files, isDirectory); - if (!string.IsNullOrWhiteSpace(protection)) - protections.Add(protection); - // SafeCast protection = SafeCast.CheckPath(path, files, isDirectory); if (!string.IsNullOrWhiteSpace(protection)) diff --git a/BurnOutSharp/ProtectionType/CactusDataShield.cs b/BurnOutSharp/ProtectionType/CactusDataShield.cs index b35f891a..d02dead2 100644 --- a/BurnOutSharp/ProtectionType/CactusDataShield.cs +++ b/BurnOutSharp/ProtectionType/CactusDataShield.cs @@ -8,6 +8,7 @@ namespace BurnOutSharp.ProtectionType { public class CactusDataShield { + // TODO: Get header info for CDSPlayer.app so it can be integrated better into the rest of the content checks public static string CheckContents(string file) { if (Path.GetFileName(file) == "CDSPlayer.app") diff --git a/BurnOutSharp/ProtectionType/PSXAntiModchip.cs b/BurnOutSharp/ProtectionType/PSXAntiModchip.cs index 85dffc5b..ad240724 100644 --- a/BurnOutSharp/ProtectionType/PSXAntiModchip.cs +++ b/BurnOutSharp/ProtectionType/PSXAntiModchip.cs @@ -1,12 +1,8 @@ -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; - -namespace BurnOutSharp.ProtectionType +namespace BurnOutSharp.ProtectionType { public class PSXAntiModchip { + // TODO: Figure out PSX binary header so this can be checked explicitly public static string CheckContents(string file, string fileContent) { // TODO: Detect Red Hand protection @@ -18,30 +14,5 @@ namespace BurnOutSharp.ProtectionType return null; } - - public static string CheckPath(string path, IEnumerable files, bool isDirectory) - { - if (isDirectory) - { - if (files.Where(s => s.ToLowerInvariant().EndsWith(".cnf")).Count() > 0) - { - foreach (string file in files) - { - // Load the current file content - string fileContent = null; - using (StreamReader sr = new StreamReader(file, Encoding.Default)) - { - fileContent = sr.ReadToEnd(); - } - - string protection = CheckContents(path, fileContent); - if (!string.IsNullOrWhiteSpace(protection)) - return protection; - } - } - } - - return null; - } } }