Skip to content

Commit

Permalink
Add antimod detection (2/3)
Browse files Browse the repository at this point in the history
  • Loading branch information
mnadareski committed Jul 18, 2018
1 parent 055fcbb commit a3094ef
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
32 changes: 29 additions & 3 deletions BurnOutSharp/ProtectionFind.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ public static Dictionary<string, string> Scan(string path, IProgress<Progress> p
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";
Expand Down Expand Up @@ -691,6 +695,31 @@ private static bool ProtectDVDVideo(string path, string[] files)
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
Expand Down Expand Up @@ -1157,9 +1186,6 @@ private static CaseInsensitiveDictionary<string> CreateFilenameProtectionMapping
// Origin
mapping.Add("OriginSetup.exe", "Origin");

// PSX LibCrypt - TODO: That's... not accurate
mapping.Add(".cnf", "PSX LibCrypt");

// SafeCast
mapping.Add("cdac11ba.exe", "SafeCast");

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a3094ef

Please sign in to comment.