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 CDCheck : IPortableExecutableCheck
|
2019-09-27 23:52:24 -07:00
|
|
|
|
{
|
2021-08-25 19:37:32 -07:00
|
|
|
|
/// <inheritdoc/>
|
2022-05-01 17:17:15 -07:00
|
|
|
|
public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug)
|
2021-08-29 21:13:50 -07:00
|
|
|
|
{
|
|
|
|
|
|
// Get the sections from the executable, if possible
|
|
|
|
|
|
var sections = pex?.SectionTable;
|
|
|
|
|
|
if (sections == null)
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
2022-12-08 14:36:43 -08:00
|
|
|
|
string name = pex.Comments;
|
|
|
|
|
|
if (name?.Contains("CDCheck utlity for Microsoft Game Studios") == true)
|
|
|
|
|
|
return "Microsoft Game Studios CD Check";
|
2021-08-29 21:13:50 -07:00
|
|
|
|
|
2022-12-08 14:36:43 -08:00
|
|
|
|
// To broad to be of use
|
|
|
|
|
|
//name = pex.InternalName;
|
|
|
|
|
|
//if (name?.Contains("CDCheck") == true)
|
|
|
|
|
|
// return "Microsoft Game Studios CD Check";
|
2021-08-29 21:13:50 -07:00
|
|
|
|
|
2022-12-08 14:36:43 -08:00
|
|
|
|
// To broad to be of use
|
|
|
|
|
|
//name = pex.OriginalFilename;
|
|
|
|
|
|
//if (name?.Contains("CDCheck.exe") == true)
|
|
|
|
|
|
// return "Microsoft Game Studios CD Check";
|
2021-09-13 23:46:59 -07:00
|
|
|
|
|
2022-12-08 14:36:43 -08:00
|
|
|
|
return null;
|
2019-09-27 23:52:24 -07:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|