Add VOB-PCD.KEY detection

This commit is contained in:
Matt Nadareski
2024-11-04 09:38:25 -05:00
parent e5dc66b140
commit 9c27da72bb
2 changed files with 27 additions and 2 deletions

View File

@@ -4,13 +4,14 @@ using System.Linq;
using BinaryObjectScanner.Interfaces;
using SabreTools.Matching;
using SabreTools.Matching.Content;
using SabreTools.Matching.Paths;
using SabreTools.Serialization.Wrappers;
namespace BinaryObjectScanner.Protection
{
// This protection was called VOB ProtectCD / ProtectDVD in versions prior to 6
// ProtectDISC 9/10 checks for the presence of CSS on the disc to run, but don't encrypt any sectors or check for keys. Confirmed in Redump entries 78367 and 110095.
public class ProtectDISC : IPortableExecutableCheck
public class ProtectDISC : IPortableExecutableCheck, IPathCheck
{
/// <inheritdoc/>
public string? CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug)
@@ -95,6 +96,30 @@ namespace BinaryObjectScanner.Protection
return null;
}
/// <inheritdoc/>
public IEnumerable<string> CheckDirectoryPath(string path, IEnumerable<string>? files)
{
var matchers = new List<PathMatchSet>
{
// https://github.com/SabreTools/BinaryObjectScanner/issues/110
new(new FilePathMatch("VOB-PCD.KEY"), "VOB ProtectCD/DVD"),
};
return MatchUtil.GetAllMatches(files, matchers, any: false);
}
/// <inheritdoc/>
public string? CheckFilePath(string path)
{
var matchers = new List<PathMatchSet>
{
// https://github.com/SabreTools/BinaryObjectScanner/issues/110
new(new FilePathMatch("VOB-PCD.KEY"), "VOB ProtectCD/DVD"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
}
public static string GetOldVersion(string matchedString)
{
// Remove unnecessary parts

View File

@@ -114,7 +114,7 @@ Below is a list of protections detected by BinaryObjectScanner. The two columns
| Origin | True | True | |
| phenoProtect | False | False | Text file check only |
| PlayJ | True | True | |
| ProtectDISC / VOB ProtectCD/DVD | True | False | |
| ProtectDISC / VOB ProtectCD/DVD | True | True | |
| Protect DVD-Video | False | True | Unconfirmed¹ |
| PlayStation Anti-modchip | True | False | En/Jp, not "Red Hand"; PSX executables only |
| Rainbow Sentinel | True | True | |