mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-07-20 07:45:07 +00:00
Use framework in even more content protections
This commit is contained in:
@@ -46,7 +46,7 @@ namespace BurnOutSharp.PackerType
|
||||
return null;
|
||||
}
|
||||
|
||||
public static string GetVersion(string file, byte[] fileContent, int position)
|
||||
public static string GetVersion(string file, byte[] fileContent, List<int> positions)
|
||||
{
|
||||
byte[] signature = new ArraySegment<byte>(fileContent, 0x30, 12).ToArray();
|
||||
|
||||
|
||||
@@ -32,10 +32,11 @@ namespace BurnOutSharp.PackerType
|
||||
return MatchUtil.GetFirstContentMatch(file, fileContent, matchers, includePosition);
|
||||
}
|
||||
|
||||
public static string GetVersion(string file, byte[] fileContent, int index)
|
||||
public static string GetVersion(string file, byte[] fileContent, List<int> positions)
|
||||
{
|
||||
try
|
||||
{
|
||||
int index = positions[0];
|
||||
index += 24;
|
||||
if (fileContent[index] != 'v')
|
||||
return "(Unknown Version)";
|
||||
|
||||
@@ -30,9 +30,9 @@ namespace BurnOutSharp.PackerType
|
||||
return MatchUtil.GetFirstContentMatch(file, fileContent, matchers, includePosition);
|
||||
}
|
||||
|
||||
public static string GetVersion(string file, byte[] fileContent, int position)
|
||||
public static string GetVersion(string file, byte[] fileContent, List<int> positions)
|
||||
{
|
||||
return $"v{BitConverter.ToInt16(fileContent, position + 4)}";
|
||||
return $"v{BitConverter.ToInt16(fileContent, positions[0] + 4)}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace BurnOutSharp.PackerType
|
||||
return null;
|
||||
}
|
||||
|
||||
public static string GetVersion(string file, byte[] fileContent, int position)
|
||||
public static string GetVersion(string file, byte[] fileContent, List<int> positions)
|
||||
{
|
||||
// Check the manifest version first
|
||||
string version = Utilities.GetManifestVersion(fileContent);
|
||||
|
||||
@@ -45,10 +45,11 @@ namespace BurnOutSharp.PackerType
|
||||
return MatchUtil.GetFirstContentMatch(file, fileContent, matchers, includePosition);
|
||||
}
|
||||
|
||||
public static string GetVersion(string file, byte[] fileContent, int index)
|
||||
public static string GetVersion(string file, byte[] fileContent, List<int> positions)
|
||||
{
|
||||
try
|
||||
{
|
||||
int index = positions[0];
|
||||
index -= 5;
|
||||
string versionString = Encoding.ASCII.GetString(fileContent, index, 4);
|
||||
if (!char.IsNumber(versionString[0]))
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace BurnOutSharp.PackerType
|
||||
return null;
|
||||
}
|
||||
|
||||
public static string GetVersion(string file, byte[] fileContent, int position)
|
||||
public static string GetVersion(string file, byte[] fileContent, List<int> positions)
|
||||
{
|
||||
// Check the manifest version first
|
||||
string version = Utilities.GetManifestVersion(fileContent);
|
||||
|
||||
Reference in New Issue
Block a user