Add antimod detection (2/3)

This commit is contained in:
Matt Nadareski
2018-07-18 12:06:25 -07:00
parent 055fcbbde7
commit a3094ef471
2 changed files with 30 additions and 4 deletions

View File

@@ -99,6 +99,10 @@ namespace BurnOutSharp
if (ProtectDVDVideo(path, files))
protections[path] = "Protect DVD-Video";
// PSX Anti-modchip
if (PSXAntiModchip(path, files))
protections[path] = "PlayStation Anti-modchip";
// Zzxzz
if (Directory.Exists(Path.Combine(path, "Zzxzz")))
protections[path] = "Zzxzz";
@@ -691,6 +695,31 @@ namespace BurnOutSharp
return false;
}
private static bool PSXAntiModchip(string path, string[] files)
{
if (files.Where(s => s.ToLower().EndsWith(".cnf")).Count() > 0)
{
foreach (string file in files)
{
try
{
// Load the current file and check for specialty strings first
StreamReader sr = new StreamReader(file, Encoding.Default);
string FileContent = sr.ReadToEnd();
sr.Close();
if (FileContent.Contains(" SOFTWARE TERMINATED\nCONSOLE MAY HAVE BEEN MODIFIED\n CALL 1-888-780-7690")
|| FileContent.Contains("強制終了しました。\n本体が改造されている\nおそれがあります。"))
return true;
}
catch { }
}
}
return false;
}
#endregion
#region Version detections
@@ -1157,9 +1186,6 @@ namespace BurnOutSharp
// Origin
mapping.Add("OriginSetup.exe", "Origin");
// PSX LibCrypt - TODO: That's... not accurate
mapping.Add(".cnf", "PSX LibCrypt");
// SafeCast
mapping.Add("cdac11ba.exe", "SafeCast");

View File

@@ -45,7 +45,7 @@ Below is a list of the protections that can be detected using this code:
- Origin (partial)
- ProtectDisc
- Protect DVD-Video
- PSX LibCrypt (partial)
- PlayStation Anti-modchip (En/Jp, not "Red Hand")
- Ring PROTECH
- SafeCast
- SafeDisc (all versions)