mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-07-16 05:45:03 +00:00
Clean up MS-CAB SFX a little
This commit is contained in:
@@ -7,9 +7,6 @@ namespace BurnOutSharp.PackerType
|
||||
// TODO: Add extraction, which should be possible with LibMSPackN, but it refuses to extract due to SFX files lacking the typical CAB identifiers.
|
||||
public class MicrosoftCABSFX : IContentCheck
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public bool ShouldScan(byte[] magic) => true;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
@@ -18,11 +15,23 @@ namespace BurnOutSharp.PackerType
|
||||
|
||||
string name = fvinfo?.InternalName.Trim();
|
||||
if (!string.IsNullOrWhiteSpace(name) && name.Equals("Wextract", StringComparison.OrdinalIgnoreCase))
|
||||
return $"Microsoft CAB SFX v{Utilities.GetFileVersion(file)}";
|
||||
{
|
||||
string version = GetVersion(file, fileContent, null);
|
||||
if (!string.IsNullOrWhiteSpace(version))
|
||||
return $"Microsoft CAB SFX v{Utilities.GetFileVersion(file)}";
|
||||
|
||||
return "Microsoft CAB SFX";
|
||||
}
|
||||
|
||||
name = fvinfo?.OriginalFilename.Trim();
|
||||
if (!string.IsNullOrWhiteSpace(name) && name.Equals("WEXTRACT.EXE", StringComparison.OrdinalIgnoreCase))
|
||||
return $"Microsoft CAB SFX v{Utilities.GetFileVersion(file)}";
|
||||
{
|
||||
string version = GetVersion(file, fileContent, null);
|
||||
if (!string.IsNullOrWhiteSpace(version))
|
||||
return $"Microsoft CAB SFX v{Utilities.GetFileVersion(file)}";
|
||||
|
||||
return "Microsoft CAB SFX";
|
||||
}
|
||||
|
||||
var matchers = new List<ContentMatchSet>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user