Files
BinaryObjectScanner/BinaryObjectScanner.Protection/CDKey.cs

25 lines
717 B
C#
Raw Normal View History

2021-08-29 21:40:25 -07:00
using System;
using BinaryObjectScanner.Interfaces;
2023-03-07 16:59:14 -05:00
using BinaryObjectScanner.Wrappers;
2021-03-31 19:07:00 -07:00
namespace BinaryObjectScanner.Protection
2021-03-31 19:07:00 -07:00
{
2022-05-01 17:17:15 -07:00
public class CDKey : IPortableExecutableCheck
2021-03-31 19:07:00 -07:00
{
/// <inheritdoc/>
2022-05-01 17:17:15 -07:00
public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug)
2021-08-29 21:40:25 -07:00
{
2021-08-30 14:24:16 -07:00
// Get the sections from the executable, if possible
var sections = pex?.SectionTable;
if (sections == null)
return null;
2022-04-02 16:12:23 -07:00
string name = pex.InternalName;
if (name?.Equals("CDKey", StringComparison.OrdinalIgnoreCase) == true)
return "CD-Key / Serial";
2021-08-30 14:24:16 -07:00
2021-08-29 21:40:25 -07:00
return null;
}
2021-03-31 19:07:00 -07:00
}
}