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 22:19:38 -07:00
|
|
|
|
|
2023-03-09 23:19:27 -05:00
|
|
|
|
namespace BinaryObjectScanner.Protection
|
2019-09-27 23:52:24 -07:00
|
|
|
|
{
|
2022-12-20 11:26:22 -08:00
|
|
|
|
/// <remarks>
|
|
|
|
|
|
/// PiD only looks for the `.ldr` section, from testing
|
|
|
|
|
|
/// There don't seem to be any other signs that this is 3P-Lock anywhere in the example files
|
|
|
|
|
|
/// No website has been found for 3P-Lock yet
|
|
|
|
|
|
/// </remarks>
|
2022-05-01 17:17:15 -07:00
|
|
|
|
public class ThreePLock : IPortableExecutableCheck
|
2019-09-27 23:52:24 -07:00
|
|
|
|
{
|
2021-09-07 21:02:52 -07: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-07 21:02:52 -07:00
|
|
|
|
// Get the sections from the executable, if possible
|
|
|
|
|
|
var sections = pex?.SectionTable;
|
|
|
|
|
|
if (sections == null)
|
|
|
|
|
|
return null;
|
2021-03-21 22:19:38 -07:00
|
|
|
|
|
2021-09-10 15:32:37 -07:00
|
|
|
|
//This produced false positives in some DirectX 9.0c installer files
|
|
|
|
|
|
//"Y" + (char)0xC3 + "U" + (char)0x8B + (char)0xEC + (char)0x83 + (char)0xEC + "0SVW"
|
|
|
|
|
|
|
2022-12-20 11:26:22 -08:00
|
|
|
|
// Get the .ldr and .ldt sections, if they exist
|
|
|
|
|
|
if (pex.ContainsSection(".ldr", exact: true) && pex.ContainsSection(".ldt", exact: true))
|
|
|
|
|
|
return $"3P-Lock Copy Protection";
|
2020-09-10 21:10:32 -07:00
|
|
|
|
|
2021-09-07 21:02:52 -07:00
|
|
|
|
return null;
|
2021-08-25 19:37:32 -07:00
|
|
|
|
}
|
2019-09-27 23:52:24 -07:00
|
|
|
|
}
|
|
|
|
|
|
}
|