mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-04-18 20:22:42 +00:00
Add support for detecting Installer VISE (#38)
* Add support for detecting Installer VISE * Add comment about extraction
This commit is contained in:
51
BurnOutSharp/PackerType/InstallerVISE.cs
Normal file
51
BurnOutSharp/PackerType/InstallerVISE.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using BurnOutSharp.Matching;
|
||||
|
||||
namespace BurnOutSharp.PackerType
|
||||
{
|
||||
public class InstallerVISE : IContentCheck, IScannable
|
||||
{
|
||||
/// <summary>
|
||||
/// Set of all ContentMatchSets for this protection
|
||||
/// </summary>
|
||||
private static readonly List<ContentMatchSet> contentMatchers = new List<ContentMatchSet>
|
||||
{
|
||||
//TODO: Add exact version detection for Windows builds, make sure versions before 3.X are detected as well, and detect the Mac builds.
|
||||
|
||||
// ViseMain
|
||||
new ContentMatchSet(
|
||||
new ContentMatch(new byte?[] { 0x56, 0x69, 0x73, 0x65, 0x4D, 0x61, 0x69, 0x6E }, start: 0xE0A4, end: 0xE0A5),
|
||||
"Installer VISE"),
|
||||
};
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool ShouldScan(byte[] magic) => true;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
||||
{
|
||||
return MatchUtil.GetFirstMatch(file, fileContent, contentMatchers, includePosition);
|
||||
}
|
||||
|
||||
// TODO: Add Installer VISE extraction
|
||||
// https://github.com/Bioruebe/UniExtract2
|
||||
/// <inheritdoc/>
|
||||
public Dictionary<string, List<string>> Scan(Scanner scanner, string file)
|
||||
{
|
||||
if (!File.Exists(file))
|
||||
return null;
|
||||
|
||||
using (var fs = File.OpenRead(file))
|
||||
{
|
||||
return Scan(scanner, fs, file);
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public Dictionary<string, List<string>> Scan(Scanner scanner, Stream stream, string file)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user