2021-03-21 14:30:37 -07:00
|
|
|
|
using System.Collections.Generic;
|
2022-12-08 14:53:59 -08:00
|
|
|
|
using System.Linq;
|
2023-03-09 11:52:28 -05:00
|
|
|
|
using BinaryObjectScanner.Interfaces;
|
2023-03-07 16:59:14 -05:00
|
|
|
|
using BinaryObjectScanner.Wrappers;
|
2021-03-21 14:30:37 -07:00
|
|
|
|
|
2023-03-09 23:19:27 -05:00
|
|
|
|
namespace BinaryObjectScanner.Protection
|
2019-09-27 23:52:24 -07:00
|
|
|
|
{
|
2022-05-01 17:17:15 -07:00
|
|
|
|
public class CDSHiELDSE : IPortableExecutableCheck
|
2019-09-27 23:52:24 -07:00
|
|
|
|
{
|
2021-02-26 01:26:49 -08:00
|
|
|
|
/// <inheritdoc/>
|
2022-05-01 17:17:15 -07:00
|
|
|
|
public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug)
|
2019-09-27 23:52:24 -07:00
|
|
|
|
{
|
2021-09-15 11:01:51 -07:00
|
|
|
|
// Get the sections from the executable, if possible
|
|
|
|
|
|
var sections = pex?.SectionTable;
|
|
|
|
|
|
if (sections == null)
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
2022-12-08 14:53:59 -08:00
|
|
|
|
// TODO: Indicates Hypertech Crack Proof as well?
|
|
|
|
|
|
//// Get the import directory table
|
|
|
|
|
|
//if (pex.ImportTable?.ImportDirectoryTable != null)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// bool match = pex.ImportTable.ImportDirectoryTable.Any(idte => idte.Name == "KeRnEl32.dLl");
|
|
|
|
|
|
// if (match)
|
|
|
|
|
|
// return "CDSHiELD SE";
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
2022-12-09 13:41:09 -08:00
|
|
|
|
// Get the code/CODE section strings, if they exist
|
|
|
|
|
|
List<string> strs = pex.GetFirstSectionStrings("code") ?? pex.GetFirstSectionStrings("CODE");
|
|
|
|
|
|
if (strs != null)
|
2021-07-17 23:40:16 -07:00
|
|
|
|
{
|
2022-12-09 13:41:09 -08:00
|
|
|
|
if (strs.Any(s => s.Contains("~0017.tmp")))
|
|
|
|
|
|
return "CDSHiELD SE";
|
2021-09-15 11:01:51 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return null;
|
2021-09-10 15:32:37 -07:00
|
|
|
|
}
|
2019-09-27 23:52:24 -07:00
|
|
|
|
}
|
|
|
|
|
|
}
|