mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-07-08 18:06:34 +00:00
CheckPath should not call CheckContents
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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<string> 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user