2022-05-01 20:44:45 -07:00
|
|
|
using System.Collections.Concurrent;
|
2022-03-15 22:35:44 -07:00
|
|
|
using System.Collections.Generic;
|
2022-05-01 20:44:45 -07:00
|
|
|
using System.IO;
|
2022-12-09 14:22:59 -08:00
|
|
|
using System.Linq;
|
2022-05-01 17:41:50 -07:00
|
|
|
using BurnOutSharp.Interfaces;
|
2022-12-03 22:17:48 -08:00
|
|
|
using BurnOutSharp.Wrappers;
|
2022-03-15 22:35:44 -07:00
|
|
|
|
|
|
|
|
namespace BurnOutSharp.PackerType
|
|
|
|
|
{
|
|
|
|
|
// TODO: Add extraction
|
2022-07-13 12:50:06 -07:00
|
|
|
// https://raw.githubusercontent.com/wolfram77web/app-peid/master/userdb.txt
|
2022-05-01 20:44:45 -07:00
|
|
|
public class GenteeInstaller : IPortableExecutableCheck, IScannable
|
2022-03-15 22:35:44 -07:00
|
|
|
{
|
|
|
|
|
/// <inheritdoc/>
|
2022-05-01 17:17:15 -07:00
|
|
|
public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug)
|
2022-03-15 22:35:44 -07:00
|
|
|
{
|
|
|
|
|
// Get the sections from the executable, if possible
|
|
|
|
|
var sections = pex?.SectionTable;
|
|
|
|
|
if (sections == null)
|
|
|
|
|
return null;
|
|
|
|
|
|
2022-12-09 14:22:59 -08:00
|
|
|
// Get the .data/DATA section strings, if they exist
|
|
|
|
|
List<string> strs = pex.GetFirstSectionStrings(".data") ?? pex.GetFirstSectionStrings("DATA");
|
|
|
|
|
if (strs != null)
|
2022-03-15 22:35:44 -07:00
|
|
|
{
|
2022-12-09 14:22:59 -08:00
|
|
|
if (strs.Any(s => s.Contains("Gentee installer")))
|
|
|
|
|
return "Gentee Installer";
|
2022-03-15 22:35:44 -07:00
|
|
|
|
2022-12-09 14:22:59 -08:00
|
|
|
if (strs.Any(s => s.Contains("ginstall.dll")))
|
|
|
|
|
return "Gentee Installer";
|
2022-03-15 22:35:44 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|
2022-05-01 20:44:45 -07:00
|
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
public ConcurrentDictionary<string, ConcurrentQueue<string>> Scan(Scanner scanner, string file)
|
|
|
|
|
{
|
|
|
|
|
if (!File.Exists(file))
|
|
|
|
|
return null;
|
|
|
|
|
|
2022-12-22 22:03:32 -08:00
|
|
|
using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.Read))
|
2022-05-01 20:44:45 -07:00
|
|
|
{
|
|
|
|
|
return Scan(scanner, fs, file);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
public ConcurrentDictionary<string, ConcurrentQueue<string>> Scan(Scanner scanner, Stream stream, string file)
|
|
|
|
|
{
|
|
|
|
|
return null;
|
|
|
|
|
}
|
2022-03-15 22:35:44 -07:00
|
|
|
}
|
|
|
|
|
}
|