mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-04-26 08:10:32 +00:00
Fix misleading version results
This commit is contained in:
@@ -91,8 +91,12 @@ namespace BurnOutSharp.Matching
|
||||
// Otherwise, invoke the version method
|
||||
else
|
||||
{
|
||||
string version = matcher.GetContentVersion(file, fileContent, positions) ?? "Unknown Version";
|
||||
matchedProtections.Add($"{matcher.ProtectionName ?? "Unknown Protection"} {version}" + (includePosition ? $" (Index {positionsString})" : string.Empty));
|
||||
// A null version returned means the check didn't pass at the version step
|
||||
string version = matcher.GetContentVersion(file, fileContent, positions);
|
||||
if (version == null)
|
||||
continue;
|
||||
|
||||
matchedProtections.Add($"{matcher.ProtectionName ?? "Unknown Protection"} {version}".TrimEnd() + (includePosition ? $" (Index {positionsString})" : string.Empty));
|
||||
}
|
||||
|
||||
// If we're stopping after the first protection, bail out here
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace BurnOutSharp.PackerType
|
||||
if (!string.IsNullOrEmpty(version))
|
||||
return version;
|
||||
|
||||
return null;
|
||||
return "(Unknown Version)";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
{
|
||||
char[] version = new ArraySegment<byte>(fileContent, positions[0] + 15, 4).Select(b => (char)b).ToArray();
|
||||
if (version[0] == 0x00)
|
||||
return "";
|
||||
return string.Empty;
|
||||
|
||||
return new string(version);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
{
|
||||
char[] version = new ArraySegment<byte>(fileContent, positions[0] + 15, 4).Select(b => (char)b).ToArray();
|
||||
if (version[0] == 0x00)
|
||||
return "";
|
||||
return string.Empty;
|
||||
|
||||
return new string(version);
|
||||
}
|
||||
|
||||
@@ -160,7 +160,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
subsubVersion = BitConverter.ToInt32(fileContent, index);
|
||||
|
||||
if (version == 0)
|
||||
return "";
|
||||
return string.Empty;
|
||||
|
||||
return $"{version}.{subVersion:00}.{subsubVersion:000}";
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
subSubSubVersion[3] = (byte)(fileContent[index] ^ 22);
|
||||
|
||||
if (version == 0 || version > 9)
|
||||
return "";
|
||||
return string.Empty;
|
||||
|
||||
return $"{version}.{subVersion[0]}{subVersion[1]}.{subSubVersion[0]}{subSubVersion[1]}.{subSubSubVersion[0]}{subSubSubVersion[1]}{subSubSubVersion[2]}{subSubSubVersion[3]}";
|
||||
}
|
||||
|
||||
@@ -38,8 +38,8 @@ namespace BurnOutSharp.ProtectionType
|
||||
|
||||
if (char.IsNumber(version) && char.IsNumber(subVersion))
|
||||
return $"{version}.{subVersion}";
|
||||
else
|
||||
return "";
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,9 +113,9 @@ namespace BurnOutSharp.ProtectionType
|
||||
return "5.5.0";
|
||||
case 0x4:
|
||||
return "5.5.2";
|
||||
default:
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user