Use framework in even more content protections

This commit is contained in:
Matt Nadareski
2021-03-22 11:43:51 -07:00
parent da165345b6
commit e47a52dbe0
20 changed files with 203 additions and 147 deletions

View File

@@ -131,9 +131,18 @@ namespace BurnOutSharp.ProtectionType
return null;
}
public static string GetVersion(string file, byte[] fileContent, int position)
public static string Get320to4xVersion(string file, byte[] fileContent, List<int> positions)
{
int index = position + 20; // Begin reading after "BoG_ *90.0&!! Yy>" for old SafeDisc
string version = SearchSafeDiscVersion(file, fileContent);
if (version.Length > 0)
return version;
return "3.20-4.xx (version removed)";
}
public static string GetVersion(string file, byte[] fileContent, List<int> positions)
{
int index = positions[0] + 20; // Begin reading after "BoG_ *90.0&!! Yy>" for old SafeDisc
int version = BitConverter.ToInt32(fileContent, index);
index += 4;
int subVersion = BitConverter.ToInt32(fileContent, index);
@@ -143,7 +152,7 @@ namespace BurnOutSharp.ProtectionType
if (version != 0)
return $"{version}.{subVersion:00}.{subsubVersion:000}";
index = position + 18 + 14; // Begin reading after "BoG_ *90.0&!! Yy>" for newer SafeDisc
index = positions[0] + 18 + 14; // Begin reading after "BoG_ *90.0&!! Yy>" for newer SafeDisc
version = BitConverter.ToInt32(fileContent, index);
index += 4;
subVersion = BitConverter.ToInt32(fileContent, index);
@@ -156,15 +165,6 @@ namespace BurnOutSharp.ProtectionType
return $"{version}.{subVersion:00}.{subsubVersion:000}";
}
public static string Get320to4xVersion(string file, byte[] fileContent, int position)
{
string version = SearchSafeDiscVersion(file, fileContent);
if (version.Length > 0)
return version;
return "3.20-4.xx (version removed)";
}
private static string GetDPlayerXVersion(string file)
{
if (file == null || !File.Exists(file))