mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-09-22 14:54:56 +00:00
Split IPathCheck method
This commit is contained in:
@@ -5,12 +5,18 @@ namespace BurnOutSharp
|
||||
public interface IPathCheck
|
||||
{
|
||||
/// <summary>
|
||||
/// Check a path for protections based on file and directory names
|
||||
/// Check a file path for protections based on path name
|
||||
/// </summary>
|
||||
/// <param name="path">Path to check for protection indicators</param>
|
||||
/// <param name="isDirectory">True if the path represents a directory, false otherwise</param>
|
||||
/// <param name="files">Enumerable of strings representing files in a directory if the path is a directory, assumed null otherwise</param>
|
||||
/// <returns>String containing any protections found in the path</returns>
|
||||
string CheckPath(string path, bool isDirectory, IEnumerable<string> files);
|
||||
/// <param name="files">Enumerable of strings representing files in a directory</param>
|
||||
/// <remarks>This can do some limited content checking as well, but it's suggested to use IContentCheck instead, if possible</remarks>
|
||||
string CheckDirectoryPath(string path, IEnumerable<string> files);
|
||||
|
||||
/// <summary>
|
||||
/// Check a file path for protections based on path name
|
||||
/// </summary>
|
||||
/// <param name="path">Path to check for protection indicators</param>
|
||||
/// <remarks>This can do some limited content checking as well, but it's suggested to use IContentCheck instead, if possible</remarks>
|
||||
string CheckFilePath(string path);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,40 +8,49 @@ namespace BurnOutSharp.ProtectionType
|
||||
public class AACS : IPathCheck
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string CheckPath(string path, bool isDirectory, IEnumerable<string> files)
|
||||
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
||||
{
|
||||
if (isDirectory)
|
||||
// HD-DVD
|
||||
if (files.Any(f => f.Contains(Path.Combine("AACS", "MKBROM.AACS"))))
|
||||
{
|
||||
if (files.Any(f => f.Contains(Path.Combine("AACS", "MKBROM.AACS"))))
|
||||
{
|
||||
string file = files.FirstOrDefault(f => Path.GetFileName(f).Equals("MKBROM.AACS", StringComparison.OrdinalIgnoreCase));
|
||||
int? version = GetVersion(file);
|
||||
return (version == null ? "AACS (Unknown Version)" : $"AACS Version {version}");
|
||||
}
|
||||
if (files.Any(f => f.Contains(Path.Combine("AACS", "MKB_RO.inf"))))
|
||||
{
|
||||
string file = files.FirstOrDefault(f => Path.GetFileName(f).Equals("MKB_RO.inf", StringComparison.OrdinalIgnoreCase));
|
||||
int? version = GetVersion(file);
|
||||
return (version == null ? "AACS (Unknown Version)" : $"AACS Version {version}");
|
||||
}
|
||||
string file = files.FirstOrDefault(f => Path.GetFileName(f).Equals("MKBROM.AACS", StringComparison.OrdinalIgnoreCase));
|
||||
int? version = GetVersion(file);
|
||||
return version == null ? "AACS (Unknown Version)" : $"AACS Version {version}";
|
||||
}
|
||||
else
|
||||
|
||||
// BD-ROM
|
||||
if (files.Any(f => f.Contains(Path.Combine("AACS", "MKB_RO.inf"))))
|
||||
{
|
||||
string filename = Path.GetFileName(path);
|
||||
if (filename.Equals("MKBROM.AACS", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
int? version = GetVersion(path);
|
||||
return (version == null ? "AACS (Unknown Version)" : $"AACS Version {version}");
|
||||
}
|
||||
if (filename.Equals("MKB_RO.inf", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
int? version = GetVersion(path);
|
||||
return (version == null ? "AACS (Unknown Version)" : $"AACS Version {version}");
|
||||
}
|
||||
string file = files.FirstOrDefault(f => Path.GetFileName(f).Equals("MKB_RO.inf", StringComparison.OrdinalIgnoreCase));
|
||||
int? version = GetVersion(file);
|
||||
return version == null ? "AACS (Unknown Version)" : $"AACS Version {version}";
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckFilePath(string path)
|
||||
{
|
||||
string filename = Path.GetFileName(path);
|
||||
|
||||
// HD-DVD
|
||||
if (filename.Equals("MKBROM.AACS", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
int? version = GetVersion(path);
|
||||
return version == null ? "AACS (Unknown Version)" : $"AACS Version {version}";
|
||||
}
|
||||
|
||||
// BD-ROM
|
||||
if (filename.Equals("MKB_RO.inf", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
int? version = GetVersion(path);
|
||||
return version == null ? "AACS (Unknown Version)" : $"AACS Version {version}";
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static int? GetVersion(string path)
|
||||
{
|
||||
if (!File.Exists(path))
|
||||
|
||||
@@ -8,20 +8,21 @@ namespace BurnOutSharp.ProtectionType
|
||||
public class AlphaDVD : IPathCheck
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string CheckPath(string path, bool isDirectory, IEnumerable<string> files)
|
||||
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
||||
{
|
||||
if (isDirectory)
|
||||
{
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("PlayDVD.exe", StringComparison.OrdinalIgnoreCase)))
|
||||
return "Alpha-DVD";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("PlayDVD.exe", StringComparison.OrdinalIgnoreCase))
|
||||
return "Alpha-DVD";
|
||||
}
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("PlayDVD.exe", StringComparison.OrdinalIgnoreCase)))
|
||||
return "Alpha-DVD";
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckFilePath(string path)
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("PlayDVD.exe", StringComparison.OrdinalIgnoreCase))
|
||||
return "Alpha-DVD";
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace BurnOutSharp.ProtectionType
|
||||
{
|
||||
public class BDPlus : IPathCheck
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string CheckPath(string path, bool isDirectory, IEnumerable<string> files)
|
||||
{
|
||||
// Multiple .svm files should always be present, but as far as I can tell, 00000.svm is the first one made and should be present no matter what.
|
||||
if (isDirectory)
|
||||
{
|
||||
if (files.Any(f => f.Contains(Path.Combine("BDSVM", "00000.svm")))
|
||||
&& files.Any(f => f.Contains(Path.Combine("BDSVM", "BACKUP", "00000.svm"))))
|
||||
{
|
||||
string file = files.FirstOrDefault(f => Path.GetFileName(f).Equals("00000.svm", StringComparison.OrdinalIgnoreCase));
|
||||
string version = GetVersion(file);
|
||||
return (version == null ? "BD+ (Unknown Version)" : $"BD+ Version {version}");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
string filename = Path.GetFileName(path);
|
||||
if (filename.Equals("00000.svm", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
string version = GetVersion(path);
|
||||
return (version == null ? "BD+ (Unknown Version)" : $"BD+ Version {version}");
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// Version detection logic from libbdplus was used to implement this
|
||||
private static string GetVersion(string path)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var fs = File.OpenRead(path))
|
||||
{
|
||||
fs.Seek(0x0d, SeekOrigin.Begin);
|
||||
int year1 = fs.ReadByte();
|
||||
int year2 = fs.ReadByte();
|
||||
int month = fs.ReadByte();
|
||||
int day = fs.ReadByte();
|
||||
|
||||
int year = (year1 << 8) | year2;
|
||||
|
||||
// If the result isn't a valid date, report it as an unknown version
|
||||
if (year < 2006 || year > 2100 || month < 1 || month > 12 || day < 1 || day > 31)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return $"{year}/{month}/{day}";
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
68
BurnOutSharp/ProtectionType/BDPlus.cs
Normal file
68
BurnOutSharp/ProtectionType/BDPlus.cs
Normal file
@@ -0,0 +1,68 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace BurnOutSharp.ProtectionType
|
||||
{
|
||||
public class BDPlus : IPathCheck
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
||||
{
|
||||
if (files.Any(f => f.Contains(Path.Combine("BDSVM", "00000.svm")))
|
||||
&& files.Any(f => f.Contains(Path.Combine("BDSVM", "BACKUP", "00000.svm"))))
|
||||
{
|
||||
string file = files.FirstOrDefault(f => Path.GetFileName(f).Equals("00000.svm", StringComparison.OrdinalIgnoreCase));
|
||||
string version = GetVersion(file);
|
||||
return version == null ? "BD+ (Unknown Version)" : $"BD+ Version {version}";
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckFilePath(string path)
|
||||
{
|
||||
string filename = Path.GetFileName(path);
|
||||
if (filename.Equals("00000.svm", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
string version = GetVersion(path);
|
||||
return version == null ? "BD+ (Unknown Version)" : $"BD+ Version {version}";
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <remarks>Version detection logic from libbdplus was used to implement this</remarks>
|
||||
private static string GetVersion(string path)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var fs = File.OpenRead(path))
|
||||
{
|
||||
fs.Seek(0x0d, SeekOrigin.Begin);
|
||||
int year1 = fs.ReadByte();
|
||||
int year2 = fs.ReadByte();
|
||||
int month = fs.ReadByte();
|
||||
int day = fs.ReadByte();
|
||||
|
||||
int year = (year1 << 8) | year2;
|
||||
|
||||
// If the result isn't a valid date, report it as an unknown version
|
||||
if (year < 2006 || year > 2100 || month < 1 || month > 12 || day < 1 || day > 31)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return $"{year}/{month}/{day}";
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,20 +8,21 @@ namespace BurnOutSharp.ProtectionType
|
||||
public class Bitpool : IPathCheck
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string CheckPath(string path, bool isDirectory, IEnumerable<string> files)
|
||||
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
||||
{
|
||||
if (isDirectory)
|
||||
{
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("bitpool.rsc", StringComparison.OrdinalIgnoreCase)))
|
||||
return "Bitpool";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("bitpool.rsc", StringComparison.OrdinalIgnoreCase))
|
||||
return "Bitpool";
|
||||
}
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("bitpool.rsc", StringComparison.OrdinalIgnoreCase)))
|
||||
return "Bitpool";
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckFilePath(string path)
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("bitpool.rsc", StringComparison.OrdinalIgnoreCase))
|
||||
return "Bitpool";
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,26 +8,27 @@ namespace BurnOutSharp.ProtectionType
|
||||
public class ByteShield : IPathCheck
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string CheckPath(string path, bool isDirectory, IEnumerable<string> files)
|
||||
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
||||
{
|
||||
if (isDirectory)
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("Byteshield.dll", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetExtension(f).Trim('.').Equals("bbz", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("Byteshield.dll", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetExtension(f).Trim('.').Equals("bbz", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
return "ByteShield";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("Byteshield.dll", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetExtension(path).Trim('.').Equals("bbz", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "ByteShield";
|
||||
}
|
||||
return "ByteShield";
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckFilePath(string path)
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("Byteshield.dll", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetExtension(path).Trim('.').Equals("bbz", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "ByteShield";
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,34 +24,35 @@ namespace BurnOutSharp.ProtectionType
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckPath(string path, bool isDirectory, IEnumerable<string> files)
|
||||
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
||||
{
|
||||
if (isDirectory)
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("CDCOPS.DLL", StringComparison.OrdinalIgnoreCase))
|
||||
&& (files.Any(f => Path.GetExtension(f).Trim('.').Equals("GZ_", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetExtension(f).Trim('.').Equals("W_X", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetExtension(f).Trim('.').Equals("Qz", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetExtension(f).Trim('.').Equals("QZ_", StringComparison.OrdinalIgnoreCase))))
|
||||
{
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("CDCOPS.DLL", StringComparison.OrdinalIgnoreCase))
|
||||
&& (files.Any(f => Path.GetExtension(f).Trim('.').Equals("GZ_", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetExtension(f).Trim('.').Equals("W_X", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetExtension(f).Trim('.').Equals("Qz", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetExtension(f).Trim('.').Equals("QZ_", StringComparison.OrdinalIgnoreCase))))
|
||||
{
|
||||
return "CD-Cops";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("CDCOPS.DLL", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetExtension(path).Trim('.').Equals("GZ_", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetExtension(path).Trim('.').Equals("W_X", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetExtension(path).Trim('.').Equals("Qz", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetExtension(path).Trim('.').Equals("QZ_", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "CD-Cops";
|
||||
}
|
||||
return "CD-Cops";
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckFilePath(string path)
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("CDCOPS.DLL", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetExtension(path).Trim('.').Equals("GZ_", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetExtension(path).Trim('.').Equals("W_X", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetExtension(path).Trim('.').Equals("Qz", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetExtension(path).Trim('.').Equals("QZ_", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "CD-Cops";
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static string GetVersion(byte[] fileContent, int position)
|
||||
{
|
||||
char[] version = new ArraySegment<byte>(fileContent, position + 15, 4).Select(b => (char)b).ToArray();
|
||||
|
||||
@@ -19,20 +19,21 @@ namespace BurnOutSharp.ProtectionType
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckPath(string path, bool isDirectory, IEnumerable<string> files)
|
||||
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
||||
{
|
||||
if (isDirectory)
|
||||
{
|
||||
if (files.Any(f => Path.GetExtension(f).Trim('.').Equals("AFP", StringComparison.OrdinalIgnoreCase)))
|
||||
return "CD-Lock";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Path.GetExtension(path).Trim('.').Equals("AFP", StringComparison.OrdinalIgnoreCase))
|
||||
return "CD-Lock";
|
||||
}
|
||||
if (files.Any(f => Path.GetExtension(f).Trim('.').Equals("AFP", StringComparison.OrdinalIgnoreCase)))
|
||||
return "CD-Lock";
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckFilePath(string path)
|
||||
{
|
||||
if (Path.GetExtension(path).Trim('.').Equals("AFP", StringComparison.OrdinalIgnoreCase))
|
||||
return "CD-Lock";
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,31 +8,32 @@ namespace BurnOutSharp.ProtectionType
|
||||
public class CDProtector : IPathCheck
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string CheckPath(string path, bool isDirectory, IEnumerable<string> files)
|
||||
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
||||
{
|
||||
if (isDirectory)
|
||||
// TODO: Verify if these are OR or AND
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("_cdp16.dat", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("_cdp16.dll", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("_cdp32.dat", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("_cdp32.dll", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
// TODO: Verify if these are OR or AND
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("_cdp16.dat", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("_cdp16.dll", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("_cdp32.dat", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("_cdp32.dll", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
return "CD-Protector";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("_cdp16.dat", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("_cdp16.dll", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("_cdp32.dat", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("_cdp32.dll", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "CD-Protector";
|
||||
}
|
||||
return "CD-Protector";
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckFilePath(string path)
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("_cdp16.dat", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("_cdp16.dll", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("_cdp32.dat", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("_cdp32.dll", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "CD-Protector";
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,29 +8,30 @@ namespace BurnOutSharp.ProtectionType
|
||||
public class CDX : IPathCheck
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string CheckPath(string path, bool isDirectory, IEnumerable<string> files)
|
||||
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
||||
{
|
||||
if (isDirectory)
|
||||
// TODO: Verify if these are OR or AND
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("CHKCDX16.DLL", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("CHKCDX32.DLL", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("CHKCDXNT.DLL", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
// TODO: Verify if these are OR or AND
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("CHKCDX16.DLL", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("CHKCDX32.DLL", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("CHKCDXNT.DLL", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
return "CD-X";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("CHKCDX16.DLL", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("CHKCDX32.DLL", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("CHKCDXNT.DLL", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "CD-X";
|
||||
}
|
||||
return "CD-X";
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckFilePath(string path)
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("CHKCDX16.DLL", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("CHKCDX32.DLL", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("CHKCDXNT.DLL", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "CD-X";
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,42 +30,43 @@ namespace BurnOutSharp.ProtectionType
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckPath(string path, bool isDirectory, IEnumerable<string> files)
|
||||
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
||||
{
|
||||
if (isDirectory)
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("CACTUSPJ.exe", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("CDSPlayer.app", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("PJSTREAM.DLL", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("wmmp.exe", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetExtension(f).Trim('.').Equals("cds", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("CACTUSPJ.exe", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("CDSPlayer.app", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("PJSTREAM.DLL", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("wmmp.exe", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetExtension(f).Trim('.').Equals("cds", StringComparison.OrdinalIgnoreCase)))
|
||||
string versionPath = files.FirstOrDefault(f => Path.GetFileName(f).Equals("version.txt", StringComparison.OrdinalIgnoreCase));
|
||||
if (!string.IsNullOrWhiteSpace(versionPath))
|
||||
{
|
||||
string versionPath = files.FirstOrDefault(f => Path.GetFileName(f).Equals("version.txt", StringComparison.OrdinalIgnoreCase));
|
||||
if (!string.IsNullOrWhiteSpace(versionPath))
|
||||
{
|
||||
string version = GetVersion(versionPath);
|
||||
if (!string.IsNullOrWhiteSpace(version))
|
||||
return $"Cactus Data Shield {version}";
|
||||
}
|
||||
string version = GetVersion(versionPath);
|
||||
if (!string.IsNullOrWhiteSpace(version))
|
||||
return $"Cactus Data Shield {version}";
|
||||
}
|
||||
|
||||
return "Cactus Data Shield 200";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("CACTUSPJ.exe", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("CDSPlayer.app", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("PJSTREAM.DLL", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("wmmp.exe", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetExtension(path).Trim('.').Equals("cds", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "Cactus Data Shield 200";
|
||||
}
|
||||
return "Cactus Data Shield 200";
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckFilePath(string path)
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("CACTUSPJ.exe", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("CDSPlayer.app", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("PJSTREAM.DLL", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("wmmp.exe", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetExtension(path).Trim('.').Equals("cds", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "Cactus Data Shield 200";
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static string GetVersion(string path)
|
||||
{
|
||||
if (!File.Exists(path))
|
||||
|
||||
@@ -19,23 +19,23 @@ namespace BurnOutSharp.ProtectionType
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckPath(string path, bool isDirectory, IEnumerable<string> files)
|
||||
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
||||
{
|
||||
return null;
|
||||
|
||||
// TODO: The following checks are overly broad and should be refined
|
||||
//if (isDirectory)
|
||||
//{
|
||||
// if (files.Any(f => Path.GetFileName(f).Equals("Autorun.dat", StringComparison.OrdinalIgnoreCase)))
|
||||
// return "CopyKiller";
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// if (Path.GetFileName(path).Equals("Autorun.dat", StringComparison.OrdinalIgnoreCase))
|
||||
// return "CopyKiller";
|
||||
//}
|
||||
// if (files.Any(f => Path.GetFileName(f).Equals("Autorun.dat", StringComparison.OrdinalIgnoreCase)))
|
||||
// return "CopyKiller";
|
||||
|
||||
//return null;
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckFilePath(string path)
|
||||
{
|
||||
// TODO: The following checks are overly broad and should be refined
|
||||
// if (Path.GetFileName(path).Equals("Autorun.dat", StringComparison.OrdinalIgnoreCase))
|
||||
// return "CopyKiller";
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,20 +8,21 @@ namespace BurnOutSharp.ProtectionType
|
||||
public class DVDCrypt : IPathCheck
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string CheckPath(string path, bool isDirectory, IEnumerable<string> files)
|
||||
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
||||
{
|
||||
if (isDirectory)
|
||||
{
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("DvdCrypt.pdb", StringComparison.OrdinalIgnoreCase)))
|
||||
return "DVD Crypt";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("DvdCrypt.pdb", StringComparison.OrdinalIgnoreCase))
|
||||
return "DVD Crypt";
|
||||
}
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("DvdCrypt.pdb", StringComparison.OrdinalIgnoreCase)))
|
||||
return "DVD Crypt";
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckFilePath(string path)
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("DvdCrypt.pdb", StringComparison.OrdinalIgnoreCase))
|
||||
return "DVD Crypt";
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,11 +7,8 @@ namespace BurnOutSharp.ProtectionType
|
||||
public class DVDMoviePROTECT : IPathCheck
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string CheckPath(string path, bool isDirectory, IEnumerable<string> files)
|
||||
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
||||
{
|
||||
if (!isDirectory)
|
||||
return null;
|
||||
|
||||
if (Directory.Exists(Path.Combine(path, "VIDEO_TS")))
|
||||
{
|
||||
string[] bupfiles = files.Where(s => s.EndsWith(".bup")).ToArray();
|
||||
@@ -26,5 +23,11 @@ namespace BurnOutSharp.ProtectionType
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckFilePath(string path)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,27 +8,29 @@ namespace BurnOutSharp.ProtectionType
|
||||
public class DiscGuard : IPathCheck
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string CheckPath(string path, bool isDirectory, IEnumerable<string> files)
|
||||
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
||||
{
|
||||
if (isDirectory)
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("IOSLINK.VXD", StringComparison.OrdinalIgnoreCase))
|
||||
&& files.Any(f => Path.GetFileName(f).Equals("IOSLINK.DLL", StringComparison.OrdinalIgnoreCase))
|
||||
&& files.Any(f => Path.GetFileName(f).Equals("IOSLINK.SYS", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("IOSLINK.VXD", StringComparison.OrdinalIgnoreCase))
|
||||
&& files.Any(f => Path.GetFileName(f).Equals("IOSLINK.SYS", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
return "DiscGuard";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("IOSLINK.VXD", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("IOSLINK.DLL", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("IOSLINK.SYS", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "DiscGuard";
|
||||
}
|
||||
return "DiscGuard";
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckFilePath(string path)
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("IOSLINK.VXD", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("IOSLINK.DLL", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("IOSLINK.SYS", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "DiscGuard";
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,18 +8,19 @@ namespace BurnOutSharp.ProtectionType
|
||||
public class FreeLock : IPathCheck
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string CheckPath(string path, bool isDirectory, IEnumerable<string> files)
|
||||
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
||||
{
|
||||
if (isDirectory)
|
||||
{
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("FREELOCK.IMG", StringComparison.OrdinalIgnoreCase)))
|
||||
return "FreeLock";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("FREELOCK.IMG", StringComparison.OrdinalIgnoreCase))
|
||||
return "FreeLock";
|
||||
}
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("FREELOCK.IMG", StringComparison.OrdinalIgnoreCase)))
|
||||
return "FreeLock";
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckFilePath(string path)
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("FREELOCK.IMG", StringComparison.OrdinalIgnoreCase))
|
||||
return "FreeLock";
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -19,18 +19,19 @@ namespace BurnOutSharp.ProtectionType
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckPath(string path, bool isDirectory, IEnumerable<string> files)
|
||||
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
||||
{
|
||||
if (isDirectory)
|
||||
{
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("XLiveRedist.msi", StringComparison.OrdinalIgnoreCase)))
|
||||
return "Games for Windows - Live";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("XLiveRedist.msi", StringComparison.OrdinalIgnoreCase))
|
||||
return "Games for Windows - Live";
|
||||
}
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("XLiveRedist.msi", StringComparison.OrdinalIgnoreCase)))
|
||||
return "Games for Windows - Live";
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckFilePath(string path)
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("XLiveRedist.msi", StringComparison.OrdinalIgnoreCase))
|
||||
return "Games for Windows - Live";
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -8,28 +8,29 @@ namespace BurnOutSharp.ProtectionType
|
||||
public class HexalockAutoLock : IPathCheck
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string CheckPath(string path, bool isDirectory, IEnumerable<string> files)
|
||||
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
||||
{
|
||||
if (isDirectory)
|
||||
// TODO: Verify if these are OR or AND
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("Start_Here.exe", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("HCPSMng.exe", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("MFINT.DLL", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("MFIMP.DLL", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
// TODO: Verify if these are OR or AND
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("Start_Here.exe", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("HCPSMng.exe", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("MFINT.DLL", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("MFIMP.DLL", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
return "Hexalock AutoLock";
|
||||
}
|
||||
return "Hexalock AutoLock";
|
||||
}
|
||||
else
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckFilePath(string path)
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("Start_Here.exe", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("HCPSMng.exe", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("MFINT.DLL", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("MFIMP.DLL", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("Start_Here.exe", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("HCPSMng.exe", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("MFINT.DLL", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("MFIMP.DLL", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "Hexalock AutoLock";
|
||||
}
|
||||
return "Hexalock AutoLock";
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -26,18 +26,19 @@ namespace BurnOutSharp.ProtectionType
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckPath(string path, bool isDirectory, IEnumerable<string> files)
|
||||
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
||||
{
|
||||
if (isDirectory)
|
||||
{
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("ImpulseReactor.dll", StringComparison.OrdinalIgnoreCase)))
|
||||
return "Impulse Reactor " + Utilities.GetFileVersion(files.First(f => Path.GetFileName(f).Equals("ImpulseReactor.dll", StringComparison.OrdinalIgnoreCase)));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("ImpulseReactor.dll", StringComparison.OrdinalIgnoreCase))
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("ImpulseReactor.dll", StringComparison.OrdinalIgnoreCase)))
|
||||
return "Impulse Reactor " + Utilities.GetFileVersion(files.First(f => Path.GetFileName(f).Equals("ImpulseReactor.dll", StringComparison.OrdinalIgnoreCase)));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckFilePath(string path)
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("ImpulseReactor.dll", StringComparison.OrdinalIgnoreCase))
|
||||
return "Impulse Reactor " + Utilities.GetFileVersion(path);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -8,24 +8,25 @@ namespace BurnOutSharp.ProtectionType
|
||||
public class IndyVCD : IPathCheck
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string CheckPath(string path, bool isDirectory, IEnumerable<string> files)
|
||||
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
||||
{
|
||||
if (isDirectory)
|
||||
// TODO: Verify if these are OR or AND
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("INDYVCD.AX", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("INDYMP3.idt", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
// TODO: Verify if these are OR or AND
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("INDYVCD.AX", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("INDYMP3.idt", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
return "IndyVCD";
|
||||
}
|
||||
return "IndyVCD";
|
||||
}
|
||||
else
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckFilePath(string path)
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("INDYVCD.AX", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("INDYMP3.idt", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("INDYVCD.AX", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("INDYMP3.idt", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "IndyVCD";
|
||||
}
|
||||
return "IndyVCD";
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -8,24 +8,25 @@ namespace BurnOutSharp.ProtectionType
|
||||
public class Key2AudioXS : IPathCheck
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string CheckPath(string path, bool isDirectory, IEnumerable<string> files)
|
||||
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
||||
{
|
||||
if (isDirectory)
|
||||
// TODO: Verify if these are OR or AND
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("SDKHM.EXE", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("SDKHM.DLL", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
// TODO: Verify if these are OR or AND
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("SDKHM.EXE", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("SDKHM.DLL", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
return "key2AudioXS";
|
||||
}
|
||||
return "key2AudioXS";
|
||||
}
|
||||
else
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckFilePath(string path)
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("SDKHM.EXE", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("SDKHM.DLL", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("SDKHM.EXE", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("SDKHM.DLL", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "key2AudioXS";
|
||||
}
|
||||
return "key2AudioXS";
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -42,40 +42,41 @@ namespace BurnOutSharp.ProtectionType
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckPath(string path, bool isDirectory, IEnumerable<string> files)
|
||||
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
||||
{
|
||||
if (isDirectory)
|
||||
if (Directory.Exists(Path.Combine(path, "LASERLOK")))
|
||||
{
|
||||
if (Directory.Exists(Path.Combine(path, "LASERLOK")))
|
||||
{
|
||||
return "LaserLock";
|
||||
}
|
||||
|
||||
// TODO: Verify if these are OR or AND
|
||||
else if (files.Any(f => Path.GetFileName(f).Equals("NOMOUSE.SP", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("NOMOUSE.COM", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("l16dll.dll", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("laserlok.in", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("laserlok.o10", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("laserlok.011", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
return "LaserLock";
|
||||
}
|
||||
return "LaserLock";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (path != null && string.Equals(Path.GetFileName(path), "NOMOUSE.SP", StringComparison.OrdinalIgnoreCase))
|
||||
return $"LaserLock {GetVersion16Bit(path)}";
|
||||
|
||||
if (Path.GetFileName(path).Equals("NOMOUSE.SP", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("NOMOUSE.COM", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("l16dll.dll", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("laserlok.in", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("laserlok.o10", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("laserlok.011", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "LaserLock";
|
||||
}
|
||||
// TODO: Verify if these are OR or AND
|
||||
else if (files.Any(f => Path.GetFileName(f).Equals("NOMOUSE.SP", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("NOMOUSE.COM", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("l16dll.dll", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("laserlok.in", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("laserlok.o10", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("laserlok.011", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
return "LaserLock";
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckFilePath(string path)
|
||||
{
|
||||
if (path != null && string.Equals(Path.GetFileName(path), "NOMOUSE.SP", StringComparison.OrdinalIgnoreCase))
|
||||
return $"LaserLock {GetVersion16Bit(path)}";
|
||||
|
||||
if (Path.GetFileName(path).Equals("NOMOUSE.SP", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("NOMOUSE.COM", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("l16dll.dll", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("laserlok.in", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("laserlok.o10", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("laserlok.011", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "LaserLock";
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -8,18 +8,19 @@ namespace BurnOutSharp.ProtectionType
|
||||
public class MediaCloQ : IPathCheck
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string CheckPath(string path, bool isDirectory, IEnumerable<string> files)
|
||||
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
||||
{
|
||||
if (isDirectory)
|
||||
{
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("sunncomm.ico", StringComparison.OrdinalIgnoreCase)))
|
||||
return "MediaCloQ";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("sunncomm.ico", StringComparison.OrdinalIgnoreCase))
|
||||
return "MediaCloQ";
|
||||
}
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("sunncomm.ico", StringComparison.OrdinalIgnoreCase)))
|
||||
return "MediaCloQ";
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckFilePath(string path)
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("sunncomm.ico", StringComparison.OrdinalIgnoreCase))
|
||||
return "MediaCloQ";
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -24,18 +24,19 @@ namespace BurnOutSharp.ProtectionType
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckPath(string path, bool isDirectory, IEnumerable<string> files)
|
||||
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
||||
{
|
||||
if (isDirectory)
|
||||
{
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("LaunchCd.exe", StringComparison.OrdinalIgnoreCase)))
|
||||
return "MediaMax CD-3";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("LaunchCd.exe", StringComparison.OrdinalIgnoreCase))
|
||||
return "MediaMax CD-3";
|
||||
}
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("LaunchCd.exe", StringComparison.OrdinalIgnoreCase)))
|
||||
return "MediaMax CD-3";
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckFilePath(string path)
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("LaunchCd.exe", StringComparison.OrdinalIgnoreCase))
|
||||
return "MediaMax CD-3";
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -19,18 +19,19 @@ namespace BurnOutSharp.ProtectionType
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckPath(string path, bool isDirectory, IEnumerable<string> files)
|
||||
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
||||
{
|
||||
if (isDirectory)
|
||||
{
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("OriginSetup.exe", StringComparison.OrdinalIgnoreCase)))
|
||||
return "Origin";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("OriginSetup.exe", StringComparison.OrdinalIgnoreCase))
|
||||
return "Origin";
|
||||
}
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("OriginSetup.exe", StringComparison.OrdinalIgnoreCase)))
|
||||
return "Origin";
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckFilePath(string path)
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("OriginSetup.exe", StringComparison.OrdinalIgnoreCase))
|
||||
return "Origin";
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -7,11 +7,8 @@ namespace BurnOutSharp.ProtectionType
|
||||
public class ProtectDVDVideo : IPathCheck
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string CheckPath(string path, bool isDirectory, IEnumerable<string> files)
|
||||
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
||||
{
|
||||
if (!isDirectory)
|
||||
return null;
|
||||
|
||||
if (Directory.Exists(Path.Combine(path, "VIDEO_TS")))
|
||||
{
|
||||
string[] ifofiles = files.Where(s => s.EndsWith(".ifo")).ToArray();
|
||||
@@ -22,7 +19,13 @@ namespace BurnOutSharp.ProtectionType
|
||||
return "Protect DVD-Video";
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckFilePath(string path)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,18 +8,19 @@ namespace BurnOutSharp.ProtectionType
|
||||
public class SafeCast : IPathCheck
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string CheckPath(string path, bool isDirectory, IEnumerable<string> files)
|
||||
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
||||
{
|
||||
if (isDirectory)
|
||||
{
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("cdac11ba.exe", StringComparison.OrdinalIgnoreCase)))
|
||||
return "SafeCast";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("cdac11ba.exe", StringComparison.OrdinalIgnoreCase))
|
||||
return "SafeCast";
|
||||
}
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("cdac11ba.exe", StringComparison.OrdinalIgnoreCase)))
|
||||
return "SafeCast";
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckFilePath(string path)
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("cdac11ba.exe", StringComparison.OrdinalIgnoreCase))
|
||||
return "SafeCast";
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -61,69 +61,70 @@ namespace BurnOutSharp.ProtectionType
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckPath(string path, bool isDirectory, IEnumerable<string> files)
|
||||
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
||||
{
|
||||
if (isDirectory)
|
||||
// TODO: These are all cop-outs that don't check the existence of the other files
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("DPLAYERX.DLL", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
// TODO: These are all cop-outs that don't check the existence of the other files
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("DPLAYERX.DLL", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
string file = files.First(f => Path.GetFileName(f).Equals("DPLAYERX.DLL", StringComparison.OrdinalIgnoreCase));
|
||||
return GetDPlayerXVersion(file);
|
||||
}
|
||||
else if (files.Any(f => Path.GetFileName(f).Equals("drvmgt.dll", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
string file = files.First(f => Path.GetFileName(f).Equals("drvmgt.dll", StringComparison.OrdinalIgnoreCase));
|
||||
return GetDrvmgtVersion(file);
|
||||
}
|
||||
else if (files.Any(f => Path.GetFileName(f).Equals("secdrv.sys", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
string file = files.First(f => Path.GetFileName(f).Equals("secdrv.sys", StringComparison.OrdinalIgnoreCase));
|
||||
return GetSecdrvVersion(file);
|
||||
}
|
||||
else if (path.EndsWith(".SafeDiscDVD.bundle", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "SafeDisc for Macintosh";
|
||||
}
|
||||
string file = files.First(f => Path.GetFileName(f).Equals("DPLAYERX.DLL", StringComparison.OrdinalIgnoreCase));
|
||||
return GetDPlayerXVersion(file);
|
||||
}
|
||||
else
|
||||
else if (files.Any(f => Path.GetFileName(f).Equals("drvmgt.dll", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
// V1
|
||||
if (Path.GetFileName(path).Equals("CLCD16.DLL", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("CLCD32.DLL", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("CLOKSPL.EXE", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetExtension(path).Trim('.').Equals("icd", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "SafeDisc 1";
|
||||
}
|
||||
string file = files.First(f => Path.GetFileName(f).Equals("drvmgt.dll", StringComparison.OrdinalIgnoreCase));
|
||||
return GetDrvmgtVersion(file);
|
||||
}
|
||||
else if (files.Any(f => Path.GetFileName(f).Equals("secdrv.sys", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
string file = files.First(f => Path.GetFileName(f).Equals("secdrv.sys", StringComparison.OrdinalIgnoreCase));
|
||||
return GetSecdrvVersion(file);
|
||||
}
|
||||
else if (path.EndsWith(".SafeDiscDVD.bundle", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "SafeDisc for Macintosh";
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
// V1 or greater
|
||||
else if (Path.GetFileName(path).Equals("00000001.TMP", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetExtension(path).Trim('.').Equals("016", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetExtension(path).Trim('.').Equals("256", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "SafeDisc 1 or greater";
|
||||
}
|
||||
/// <inheritdoc/>
|
||||
public string CheckFilePath(string path)
|
||||
{
|
||||
// V1
|
||||
if (Path.GetFileName(path).Equals("CLCD16.DLL", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("CLCD32.DLL", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("CLOKSPL.EXE", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetExtension(path).Trim('.').Equals("icd", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "SafeDisc 1";
|
||||
}
|
||||
|
||||
// V2 or greater
|
||||
else if (Path.GetFileName(path).Equals("00000002.TMP", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "SafeDisc 2 or greater";
|
||||
}
|
||||
// V1 or greater
|
||||
else if (Path.GetFileName(path).Equals("00000001.TMP", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetExtension(path).Trim('.').Equals("016", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetExtension(path).Trim('.').Equals("256", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "SafeDisc 1 or greater";
|
||||
}
|
||||
|
||||
// Specific Versions
|
||||
else if (Path.GetFileName(path).Equals("DPLAYERX.DLL", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return GetDPlayerXVersion(path);
|
||||
}
|
||||
else if (Path.GetFileName(path).Equals("drvmgt.dll", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return GetDrvmgtVersion(path);
|
||||
}
|
||||
else if (Path.GetFileName(path).Equals("secdrv.sys", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return GetSecdrvVersion(path);
|
||||
}
|
||||
// V2 or greater
|
||||
else if (Path.GetFileName(path).Equals("00000002.TMP", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "SafeDisc 2 or greater";
|
||||
}
|
||||
|
||||
// Specific Versions
|
||||
else if (Path.GetFileName(path).Equals("DPLAYERX.DLL", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return GetDPlayerXVersion(path);
|
||||
}
|
||||
else if (Path.GetFileName(path).Equals("drvmgt.dll", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return GetDrvmgtVersion(path);
|
||||
}
|
||||
else if (Path.GetFileName(path).Equals("secdrv.sys", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return GetSecdrvVersion(path);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -8,18 +8,19 @@ namespace BurnOutSharp.ProtectionType
|
||||
public class SafeDiscLite : IPathCheck
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string CheckPath(string path, bool isDirectory, IEnumerable<string> files)
|
||||
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
||||
{
|
||||
if (isDirectory)
|
||||
{
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("00000001.LT1", StringComparison.OrdinalIgnoreCase)))
|
||||
return "SafeDisc Lite";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("00000001.LT1", StringComparison.OrdinalIgnoreCase))
|
||||
return "SafeDisc Lite";
|
||||
}
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("00000001.LT1", StringComparison.OrdinalIgnoreCase)))
|
||||
return "SafeDisc Lite";
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckFilePath(string path)
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("00000001.LT1", StringComparison.OrdinalIgnoreCase))
|
||||
return "SafeDisc Lite";
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -19,26 +19,27 @@ namespace BurnOutSharp.ProtectionType
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckPath(string path, bool isDirectory, IEnumerable<string> files)
|
||||
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
||||
{
|
||||
if (isDirectory)
|
||||
// TODO: Verify if these are OR or AND
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("SafeLock.dat", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("SafeLock.001", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("SafeLock.128", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
// TODO: Verify if these are OR or AND
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("SafeLock.dat", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("SafeLock.001", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("SafeLock.128", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
return "SafeLock";
|
||||
}
|
||||
return "SafeLock";
|
||||
}
|
||||
else
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckFilePath(string path)
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("SafeLock.dat", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("SafeLock.001", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("SafeLock.128", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("SafeLock.dat", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("SafeLock.001", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("SafeLock.128", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "SafeLock";
|
||||
}
|
||||
return "SafeLock";
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -50,42 +50,43 @@ namespace BurnOutSharp.ProtectionType
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckPath(string path, bool isDirectory, IEnumerable<string> files)
|
||||
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
||||
{
|
||||
if (isDirectory)
|
||||
// TODO: Verify if these are OR or AND
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("CMS16.DLL", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("CMS_95.DLL", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("CMS_NT.DLL", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("CMS32_95.DLL", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("CMS32_NT.DLL", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
// TODO: Verify if these are OR or AND
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("CMS16.DLL", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("CMS_95.DLL", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("CMS_NT.DLL", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("CMS32_95.DLL", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("CMS32_NT.DLL", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
return "SecuROM";
|
||||
}
|
||||
else if (files.Any(f => Path.GetFileName(f).Equals("SINTF32.DLL", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("SINTF16.DLL", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("SINTFNT.DLL", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
return "SecuROM New";
|
||||
}
|
||||
return "SecuROM";
|
||||
}
|
||||
else
|
||||
else if (files.Any(f => Path.GetFileName(f).Equals("SINTF32.DLL", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("SINTF16.DLL", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("SINTFNT.DLL", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("CMS16.DLL", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("CMS_95.DLL", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("CMS_NT.DLL", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("CMS32_95.DLL", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("CMS32_NT.DLL", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "SecuROM";
|
||||
}
|
||||
else if (Path.GetFileName(path).Equals("SINTF32.DLL", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("SINTF16.DLL", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("SINTFNT.DLL", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "SecuROM New";
|
||||
}
|
||||
return "SecuROM New";
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckFilePath(string path)
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("CMS16.DLL", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("CMS_95.DLL", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("CMS_NT.DLL", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("CMS32_95.DLL", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("CMS32_NT.DLL", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "SecuROM";
|
||||
}
|
||||
else if (Path.GetFileName(path).Equals("SINTF32.DLL", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("SINTF16.DLL", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("SINTFNT.DLL", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "SecuROM New";
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -19,24 +19,25 @@ namespace BurnOutSharp.ProtectionType
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckPath(string path, bool isDirectory, IEnumerable<string> files)
|
||||
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
||||
{
|
||||
if (isDirectory)
|
||||
// TODO: Verify if these are OR or AND
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("00001.TMP", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("00002.TMP", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
// TODO: Verify if these are OR or AND
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("00001.TMP", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("00002.TMP", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
return "SmartE";
|
||||
}
|
||||
return "SmartE";
|
||||
}
|
||||
else
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckFilePath(string path)
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("00001.TMP", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("00002.TMP", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("00001.TMP", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("00002.TMP", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "SmartE";
|
||||
}
|
||||
return "SmartE";
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -8,24 +8,25 @@ namespace BurnOutSharp.ProtectionType
|
||||
public class SoftLock : IPathCheck
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string CheckPath(string path, bool isDirectory, IEnumerable<string> files)
|
||||
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
||||
{
|
||||
if (isDirectory)
|
||||
// TODO: Verify if these are OR or AND
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("SOFTLOCKI.dat", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("SOFTLOCKC.dat", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
// TODO: Verify if these are OR or AND
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("SOFTLOCKI.dat", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("SOFTLOCKC.dat", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
return "SoftLock";
|
||||
}
|
||||
return "SoftLock";
|
||||
}
|
||||
else
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckFilePath(string path)
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("SOFTLOCKI.dat", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("SOFTLOCKC.dat", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("SOFTLOCKI.dat", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("SOFTLOCKC.dat", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "SoftLock";
|
||||
}
|
||||
return "SoftLock";
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -114,28 +114,29 @@ namespace BurnOutSharp.ProtectionType
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckPath(string path, bool isDirectory, IEnumerable<string> files)
|
||||
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
||||
{
|
||||
if (isDirectory)
|
||||
// TODO: Verify if these are OR or AND
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("dvm.dll", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("hc.dll", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("solidshield-cd.dll", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("c11prot.dll", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
// TODO: Verify if these are OR or AND
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("dvm.dll", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("hc.dll", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("solidshield-cd.dll", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("c11prot.dll", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
return "SolidShield";
|
||||
}
|
||||
return "SolidShield";
|
||||
}
|
||||
else
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckFilePath(string path)
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("dvm.dll", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("hc.dll", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("solidshield-cd.dll", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("c11prot.dll", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("dvm.dll", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("hc.dll", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("solidshield-cd.dll", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("c11prot.dll", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "SolidShield";
|
||||
}
|
||||
return "SolidShield";
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -65,24 +65,25 @@ namespace BurnOutSharp.ProtectionType
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckPath(string path, bool isDirectory, IEnumerable<string> files)
|
||||
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
||||
{
|
||||
if (isDirectory)
|
||||
// TODO: Verify if these are OR or AND
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("protect.dll", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("protect.exe", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
// TODO: Verify if these are OR or AND
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("protect.dll", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("protect.exe", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
return "StarForce";
|
||||
}
|
||||
return "StarForce";
|
||||
}
|
||||
else
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckFilePath(string path)
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("protect.dll", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("protect.exe", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("protect.dll", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("protect.exe", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "StarForce";
|
||||
}
|
||||
return "StarForce";
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -9,29 +9,30 @@ namespace BurnOutSharp.ProtectionType
|
||||
public class Steam : IPathCheck
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string CheckPath(string path, bool isDirectory, IEnumerable<string> files)
|
||||
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
||||
{
|
||||
if (isDirectory)
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("SteamInstall.exe", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("SteamInstall.ini", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("SteamInstall.msi", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("SteamRetailInstaller.dmg", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("SteamSetup.exe", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("SteamInstall.exe", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("SteamInstall.ini", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("SteamInstall.msi", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("SteamRetailInstaller.dmg", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("SteamSetup.exe", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
return "Steam";
|
||||
}
|
||||
return "Steam";
|
||||
}
|
||||
else
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckFilePath(string path)
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("SteamInstall.exe", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("SteamInstall.ini", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("SteamInstall.msi", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("SteamRetailInstaller.dmg", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("SteamSetup.exe", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("SteamInstall.exe", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("SteamInstall.ini", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("SteamInstall.msi", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("SteamRetailInstaller.dmg", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("SteamSetup.exe", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "Steam";
|
||||
}
|
||||
return "Steam";
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -8,18 +8,19 @@ namespace BurnOutSharp.ProtectionType
|
||||
public class TZCopyProtector : IPathCheck
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string CheckPath(string path, bool isDirectory, IEnumerable<string> files)
|
||||
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
||||
{
|
||||
if (isDirectory)
|
||||
{
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("_742893.016", StringComparison.OrdinalIgnoreCase)))
|
||||
return "TZCopyProtector";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("_742893.016", StringComparison.OrdinalIgnoreCase))
|
||||
return "TZCopyProtector";
|
||||
}
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("_742893.016", StringComparison.OrdinalIgnoreCase)))
|
||||
return "TZCopyProtector";
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckFilePath(string path)
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("_742893.016", StringComparison.OrdinalIgnoreCase))
|
||||
return "TZCopyProtector";
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -33,58 +33,57 @@ namespace BurnOutSharp.ProtectionType
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckPath(string path, bool isDirectory, IEnumerable<string> files)
|
||||
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
||||
{
|
||||
if (isDirectory)
|
||||
List<string> protections = new List<string>();
|
||||
|
||||
// TODO: Verify if these are OR or AND
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("Tages.dll", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("Wave.aif", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
List<string> protections = new List<string>();
|
||||
|
||||
// TODO: Verify if these are OR or AND
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("Tages.dll", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("Wave.aif", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
protections.Add("TAGES");
|
||||
}
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("tagesclient.exe", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
string file = files.First(f => Path.GetFileName(f).Equals("tagesclient.exe", StringComparison.OrdinalIgnoreCase));
|
||||
protections.Add("TAGES Activation Client " + Utilities.GetFileVersion(file));
|
||||
}
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("TagesSetup.exe", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
string file = files.First(f => Path.GetFileName(f).Equals("TagesSetup.exe", StringComparison.OrdinalIgnoreCase));
|
||||
protections.Add("TAGES Setup " + Utilities.GetFileVersion(file));
|
||||
}
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("TagesSetup_x64.exe", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
string file = files.First(f => Path.GetFileName(f).Equals("TagesSetup_x64.exe", StringComparison.OrdinalIgnoreCase));
|
||||
protections.Add("TAGES Setup " + Utilities.GetFileVersion(file));
|
||||
}
|
||||
|
||||
if (protections.Count() == 0)
|
||||
return null;
|
||||
else
|
||||
return string.Join(", ", protections);
|
||||
protections.Add("TAGES");
|
||||
}
|
||||
else
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("tagesclient.exe", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("Tages.dll", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("Wave.aif", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "TAGES";
|
||||
}
|
||||
else if (Path.GetFileName(path).Equals("tagesclient.exe", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "TAGES Activation Client " + Utilities.GetFileVersion(path);
|
||||
}
|
||||
else if (Path.GetFileName(path).Equals("TagesSetup.exe", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "TAGES Setup " + Utilities.GetFileVersion(path);
|
||||
}
|
||||
else if (Path.GetFileName(path).Equals("TagesSetup_x64.exe", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "TAGES Setup " + Utilities.GetFileVersion(path);
|
||||
}
|
||||
string file = files.First(f => Path.GetFileName(f).Equals("tagesclient.exe", StringComparison.OrdinalIgnoreCase));
|
||||
protections.Add("TAGES Activation Client " + Utilities.GetFileVersion(file));
|
||||
}
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("TagesSetup.exe", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
string file = files.First(f => Path.GetFileName(f).Equals("TagesSetup.exe", StringComparison.OrdinalIgnoreCase));
|
||||
protections.Add("TAGES Setup " + Utilities.GetFileVersion(file));
|
||||
}
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("TagesSetup_x64.exe", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
string file = files.First(f => Path.GetFileName(f).Equals("TagesSetup_x64.exe", StringComparison.OrdinalIgnoreCase));
|
||||
protections.Add("TAGES Setup " + Utilities.GetFileVersion(file));
|
||||
}
|
||||
|
||||
if (protections.Count() == 0)
|
||||
return null;
|
||||
else
|
||||
return string.Join(", ", protections);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckFilePath(string path)
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("Tages.dll", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("Wave.aif", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "TAGES";
|
||||
}
|
||||
else if (Path.GetFileName(path).Equals("tagesclient.exe", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "TAGES Activation Client " + Utilities.GetFileVersion(path);
|
||||
}
|
||||
else if (Path.GetFileName(path).Equals("TagesSetup.exe", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "TAGES Setup " + Utilities.GetFileVersion(path);
|
||||
}
|
||||
else if (Path.GetFileName(path).Equals("TagesSetup_x64.exe", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "TAGES Setup " + Utilities.GetFileVersion(path);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -8,18 +8,19 @@ namespace BurnOutSharp.ProtectionType
|
||||
public class Uplay : IPathCheck
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string CheckPath(string path, bool isDirectory, IEnumerable<string> files)
|
||||
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
||||
{
|
||||
if (isDirectory)
|
||||
{
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("UplayInstaller.exe", StringComparison.OrdinalIgnoreCase)))
|
||||
return "Uplay";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("UplayInstaller.exe", StringComparison.OrdinalIgnoreCase))
|
||||
return "Uplay";
|
||||
}
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("UplayInstaller.exe", StringComparison.OrdinalIgnoreCase)))
|
||||
return "Uplay";
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckFilePath(string path)
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("UplayInstaller.exe", StringComparison.OrdinalIgnoreCase))
|
||||
return "Uplay";
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -46,18 +46,19 @@ namespace BurnOutSharp.ProtectionType
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckPath(string path, bool isDirectory, IEnumerable<string> files)
|
||||
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
||||
{
|
||||
if (isDirectory)
|
||||
{
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("VOB-PCD.KEY", StringComparison.OrdinalIgnoreCase)))
|
||||
return "VOB ProtectCD/DVD";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("VOB-PCD.KEY", StringComparison.OrdinalIgnoreCase))
|
||||
return "VOB ProtectCD/DVD";
|
||||
}
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("VOB-PCD.KEY", StringComparison.OrdinalIgnoreCase)))
|
||||
return "VOB ProtectCD/DVD";
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckFilePath(string path)
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("VOB-PCD.KEY", StringComparison.OrdinalIgnoreCase))
|
||||
return "VOB ProtectCD/DVD";
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -19,28 +19,29 @@ namespace BurnOutSharp.ProtectionType
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckPath(string path, bool isDirectory, IEnumerable<string> files)
|
||||
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
||||
{
|
||||
if (isDirectory)
|
||||
// TODO: Verify if these are OR or AND
|
||||
if (files.Any(f => Path.GetExtension(f).Trim('.').Equals("IMP", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("imp.dat", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("wtmfiles.dat", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("Viewer.exe", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
// TODO: Verify if these are OR or AND
|
||||
if (files.Any(f => Path.GetExtension(f).Trim('.').Equals("IMP", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("imp.dat", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("wtmfiles.dat", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("Viewer.exe", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
return "WTM CD Protect";
|
||||
}
|
||||
return "WTM CD Protect";
|
||||
}
|
||||
else
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckFilePath(string path)
|
||||
{
|
||||
if (Path.GetExtension(path).Trim('.').Equals("IMP", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("imp.dat", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("wtmfiles.dat", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("Viewer.exe", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
if (Path.GetExtension(path).Trim('.').Equals("IMP", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("imp.dat", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("wtmfiles.dat", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("Viewer.exe", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "WTM CD Protect";
|
||||
}
|
||||
return "WTM CD Protect";
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -8,18 +8,19 @@ namespace BurnOutSharp.ProtectionType
|
||||
public class Winlock : IPathCheck
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string CheckPath(string path, bool isDirectory, IEnumerable<string> files)
|
||||
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
||||
{
|
||||
if (isDirectory)
|
||||
{
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("WinLock.PSX", StringComparison.OrdinalIgnoreCase)))
|
||||
return "Winlock";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("WinLock.PSX", StringComparison.OrdinalIgnoreCase))
|
||||
return "Winlock";
|
||||
}
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("WinLock.PSX", StringComparison.OrdinalIgnoreCase)))
|
||||
return "Winlock";
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckFilePath(string path)
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("WinLock.PSX", StringComparison.OrdinalIgnoreCase))
|
||||
return "Winlock";
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -30,34 +30,35 @@ namespace BurnOutSharp.ProtectionType
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckPath(string path, bool isDirectory, IEnumerable<string> files)
|
||||
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
||||
{
|
||||
if (isDirectory)
|
||||
// TODO: Verify if these are OR or AND
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("XCP.DAT", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("ECDPlayerControl.ocx", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("go.exe", StringComparison.OrdinalIgnoreCase))) // Path.Combine("contents", "go.exe")
|
||||
{
|
||||
// TODO: Verify if these are OR or AND
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("XCP.DAT", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("ECDPlayerControl.ocx", StringComparison.OrdinalIgnoreCase))
|
||||
|| files.Any(f => Path.GetFileName(f).Equals("go.exe", StringComparison.OrdinalIgnoreCase))) // Path.Combine("contents", "go.exe")
|
||||
string versionDatPath = files.FirstOrDefault(f => Path.GetFileName(f).Equals("VERSION.DAT", StringComparison.OrdinalIgnoreCase));
|
||||
if (!string.IsNullOrWhiteSpace(versionDatPath))
|
||||
{
|
||||
string versionDatPath = files.FirstOrDefault(f => Path.GetFileName(f).Equals("VERSION.DAT", StringComparison.OrdinalIgnoreCase));
|
||||
if (!string.IsNullOrWhiteSpace(versionDatPath))
|
||||
{
|
||||
string xcpVersion = GetDatVersion(versionDatPath);
|
||||
if (!string.IsNullOrWhiteSpace(xcpVersion))
|
||||
return xcpVersion;
|
||||
}
|
||||
string xcpVersion = GetDatVersion(versionDatPath);
|
||||
if (!string.IsNullOrWhiteSpace(xcpVersion))
|
||||
return xcpVersion;
|
||||
}
|
||||
|
||||
return "XCP";
|
||||
}
|
||||
return "XCP";
|
||||
}
|
||||
else
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckFilePath(string path)
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("XCP.DAT", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("ECDPlayerControl.ocx", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("go.exe", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("XCP.DAT", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("ECDPlayerControl.ocx", StringComparison.OrdinalIgnoreCase)
|
||||
|| Path.GetFileName(path).Equals("go.exe", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "XCP";
|
||||
}
|
||||
return "XCP";
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -7,22 +7,23 @@ namespace BurnOutSharp.ProtectionType
|
||||
public class Zzxzz : IPathCheck
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string CheckPath(string path, bool isDirectory, IEnumerable<string> files)
|
||||
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
||||
{
|
||||
if (isDirectory)
|
||||
{
|
||||
if (File.Exists(Path.Combine(path, "Zzxzz", "Zzz.aze")))
|
||||
return "Zzxzz";
|
||||
if (File.Exists(Path.Combine(path, "Zzxzz", "Zzz.aze")))
|
||||
return "Zzxzz";
|
||||
|
||||
else if (Directory.Exists(Path.Combine(path, "Zzxzz")))
|
||||
return "Zzxzz";
|
||||
}
|
||||
else
|
||||
{
|
||||
string filename = Path.GetFileName(path);
|
||||
if (filename.Equals("Zzz.aze", StringComparison.OrdinalIgnoreCase))
|
||||
return "Zzxzz";
|
||||
}
|
||||
else if (Directory.Exists(Path.Combine(path, "Zzxzz")))
|
||||
return "Zzxzz";
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckFilePath(string path)
|
||||
{
|
||||
string filename = Path.GetFileName(path);
|
||||
if (filename.Equals("Zzz.aze", StringComparison.OrdinalIgnoreCase))
|
||||
return "Zzxzz";
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -198,7 +198,13 @@ namespace BurnOutSharp
|
||||
foreach (var pathCheckClass in pathCheckClasses)
|
||||
{
|
||||
IPathCheck pathCheck = Activator.CreateInstance(pathCheckClass) as IPathCheck;
|
||||
string protection = pathCheck.CheckPath(path, isDirectory, files);
|
||||
|
||||
string protection = null;
|
||||
if (isDirectory)
|
||||
protection = pathCheck.CheckDirectoryPath(path, files);
|
||||
else
|
||||
protection = pathCheck.CheckFilePath(path);
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(protection))
|
||||
protections.Add(protection);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user