mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-02-13 13:45:57 +00:00
65 lines
2.6 KiB
C#
65 lines
2.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using BurnOutSharp.Interfaces;
|
|
using BurnOutSharp.Tools;
|
|
using BurnOutSharp.Wrappers;
|
|
|
|
namespace BurnOutSharp.ProtectionType
|
|
{
|
|
public class ElectronicArts : IPortableExecutableCheck
|
|
{
|
|
/// <inheritdoc/>
|
|
public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug)
|
|
{
|
|
// Get the sections from the executable, if possible
|
|
var sections = pex?.SectionTable;
|
|
if (sections == null)
|
|
return null;
|
|
|
|
string name = pex.FileDescription;
|
|
if (name?.Contains("EReg MFC Application") == true)
|
|
return $"EA CdKey Registration Module {Utilities.GetInternalVersion(pex)}";
|
|
else if (name?.Contains("Registration code installer program") == true)
|
|
return $"EA CdKey Registration Module {Utilities.GetInternalVersion(pex)}";
|
|
else if (name?.Equals("EA DRM Helper", StringComparison.OrdinalIgnoreCase) == true)
|
|
return $"EA DRM Protection {Utilities.GetInternalVersion(pex)}";
|
|
|
|
name = pex.InternalName;
|
|
if (name?.Equals("CDCode", StringComparison.Ordinal) == true)
|
|
return $"EA CdKey Registration Module {Utilities.GetInternalVersion(pex)}";
|
|
|
|
if (pex.FindDialogByTitle("About CDKey").Any())
|
|
return $"EA CdKey Registration Module {Utilities.GetInternalVersion(pex)}";
|
|
else if (pex.FindGenericResource("About CDKey").Any())
|
|
return $"EA CdKey Registration Module {Utilities.GetInternalVersion(pex)}";
|
|
|
|
// Get the .data/DATA section strings, if they exist
|
|
List<string> strs = pex.GetFirstSectionStrings(".data") ?? pex.GetFirstSectionStrings("DATA");
|
|
if (strs != null)
|
|
{
|
|
if (strs.Any(s => s.Contains("EReg Config Form")))
|
|
return "EA CdKey Registration Module";
|
|
}
|
|
|
|
// Get the .rdata section strings, if they exist
|
|
strs = pex.GetFirstSectionStrings(".rdata");
|
|
if (strs != null)
|
|
{
|
|
if (strs.Any(s => s.Contains("GenericEA")) && strs.Any(s => s.Contains("Activation")))
|
|
return "EA DRM Protection";
|
|
}
|
|
|
|
// Get the .rdata section strings, if they exist
|
|
strs = pex.GetFirstSectionStrings(".text");
|
|
if (strs != null)
|
|
{
|
|
if (strs.Any(s => s.Contains("GenericEA")) && strs.Any(s => s.Contains("Activation")))
|
|
return "EA DRM Protection";
|
|
}
|
|
|
|
return null;
|
|
}
|
|
}
|
|
}
|