Skip to content

Commit a3094ef

Browse files
committed
Add antimod detection (2/3)
1 parent 055fcbb commit a3094ef

File tree

2 files changed

+30
-4
lines changed

2 files changed

+30
-4
lines changed

BurnOutSharp/ProtectionFind.cs

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ public static Dictionary<string, string> Scan(string path, IProgress<Progress> p
9999
if (ProtectDVDVideo(path, files))
100100
protections[path] = "Protect DVD-Video";
101101

102+
// PSX Anti-modchip
103+
if (PSXAntiModchip(path, files))
104+
protections[path] = "PlayStation Anti-modchip";
105+
102106
// Zzxzz
103107
if (Directory.Exists(Path.Combine(path, "Zzxzz")))
104108
protections[path] = "Zzxzz";
@@ -691,6 +695,31 @@ private static bool ProtectDVDVideo(string path, string[] files)
691695
return false;
692696
}
693697

698+
private static bool PSXAntiModchip(string path, string[] files)
699+
{
700+
if (files.Where(s => s.ToLower().EndsWith(".cnf")).Count() > 0)
701+
{
702+
foreach (string file in files)
703+
{
704+
try
705+
{
706+
// Load the current file and check for specialty strings first
707+
StreamReader sr = new StreamReader(file, Encoding.Default);
708+
string FileContent = sr.ReadToEnd();
709+
sr.Close();
710+
711+
if (FileContent.Contains(" SOFTWARE TERMINATED\nCONSOLE MAY HAVE BEEN MODIFIED\n CALL 1-888-780-7690")
712+
|| FileContent.Contains("強制終了しました。\n本体が改造されている\nおそれがあります。"))
713+
return true;
714+
715+
}
716+
catch { }
717+
}
718+
}
719+
720+
return false;
721+
}
722+
694723
#endregion
695724

696725
#region Version detections
@@ -1157,9 +1186,6 @@ private static CaseInsensitiveDictionary<string> CreateFilenameProtectionMapping
11571186
// Origin
11581187
mapping.Add("OriginSetup.exe", "Origin");
11591188

1160-
// PSX LibCrypt - TODO: That's... not accurate
1161-
mapping.Add(".cnf", "PSX LibCrypt");
1162-
11631189
// SafeCast
11641190
mapping.Add("cdac11ba.exe", "SafeCast");
11651191

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Below is a list of the protections that can be detected using this code:
4545
- Origin (partial)
4646
- ProtectDisc
4747
- Protect DVD-Video
48-
- PSX LibCrypt (partial)
48+
- PlayStation Anti-modchip (En/Jp, not "Red Hand")
4949
- Ring PROTECH
5050
- SafeCast
5151
- SafeDisc (all versions)

0 commit comments

Comments
 (0)