2021-09-01 14:10:12 -07:00
|
|
|
|
using System;
|
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
|
|
|
|
|
|
|
|
|
|
namespace BurnOutSharp.ProtectionType
|
2021-03-20 13:29:46 -07:00
|
|
|
|
{
|
2022-05-01 17:17:15 -07:00
|
|
|
|
public class OnlineRegistration : IPortableExecutableCheck
|
2021-03-20 13:29:46 -07:00
|
|
|
|
{
|
2021-09-01 14:10:12 -07:00
|
|
|
|
/// <inheritdoc/>
|
2022-05-01 17:17:15 -07:00
|
|
|
|
public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug)
|
2021-03-23 09:52:09 -07:00
|
|
|
|
{
|
2021-09-01 14:10:12 -07:00
|
|
|
|
// Get the sections from the executable, if possible
|
|
|
|
|
|
var sections = pex?.SectionTable;
|
|
|
|
|
|
if (sections == null)
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
2021-09-11 23:03:56 -07:00
|
|
|
|
// TODO: Is this too broad in general?
|
2022-04-02 16:12:23 -07:00
|
|
|
|
string name = pex.InternalName;
|
2022-08-21 20:34:59 -07:00
|
|
|
|
if (name?.StartsWith("EReg", StringComparison.OrdinalIgnoreCase) == true)
|
2023-03-09 23:19:27 -05:00
|
|
|
|
return $"Executable-Based Online Registration {pex.GetInternalVersion()}";
|
2021-09-01 14:10:12 -07:00
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
}
|
2021-03-20 13:29:46 -07:00
|
|
|
|
}
|
|
|
|
|
|
}
|