mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-07-19 23:35:01 +00:00
Move resource helpers to PortableExecutable
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using BurnOutSharp.ExecutableType.Microsoft.PE;
|
||||
using BurnOutSharp.Tools;
|
||||
|
||||
namespace BurnOutSharp.ProtectionType
|
||||
{
|
||||
@@ -14,7 +13,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
if (sections == null)
|
||||
return null;
|
||||
|
||||
string name = Utilities.GetInternalName(pex);
|
||||
string name = pex.GetInternalName();
|
||||
if (!string.IsNullOrWhiteSpace(name) && name.Equals("CDKey", StringComparison.OrdinalIgnoreCase))
|
||||
return "CD-Key / Serial";
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
if (sections == null)
|
||||
return null;
|
||||
|
||||
string name = Utilities.GetFileDescription(pex);
|
||||
string name = pex.GetFileDescription();
|
||||
if (!string.IsNullOrWhiteSpace(name) && name.Contains("EReg MFC Application"))
|
||||
return $"EA CdKey Registration Module {Utilities.GetInternalVersion(pex)}";
|
||||
else if (!string.IsNullOrWhiteSpace(name) && name.Contains("Registration code installer program"))
|
||||
@@ -30,11 +30,11 @@ namespace BurnOutSharp.ProtectionType
|
||||
else if (!string.IsNullOrWhiteSpace(name) && name.Equals("EA DRM Helper", StringComparison.OrdinalIgnoreCase))
|
||||
return $"EA DRM Protection {Utilities.GetInternalVersion(pex)}";
|
||||
|
||||
name = Utilities.GetInternalName(pex);
|
||||
name = pex.GetInternalName();
|
||||
if (!string.IsNullOrWhiteSpace(name) && name.Equals("CDCode", StringComparison.Ordinal))
|
||||
return $"EA CdKey Registration Module {Utilities.GetInternalVersion(pex)}";
|
||||
|
||||
var resource = Utilities.FindResourceInSection(pex.ResourceSection, dataContains: "A\0b\0o\0u\0t\0 \0C\0D\0K\0e\0y");
|
||||
var resource = pex.FindResource(dataContains: "A\0b\0o\0u\0t\0 \0C\0D\0K\0e\0y");
|
||||
if (resource != null)
|
||||
return $"EA CdKey Registration Module {Utilities.GetInternalVersion(pex)}";
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
if (sections == null)
|
||||
return null;
|
||||
|
||||
string name = Utilities.GetFileDescription(pex);
|
||||
string name = pex.GetFileDescription();
|
||||
if (!string.IsNullOrWhiteSpace(name) && name.StartsWith("Games for Windows - LIVE Zero Day Piracy Protection", StringComparison.OrdinalIgnoreCase))
|
||||
return $"Games for Windows LIVE - Zero Day Piracy Protection Module {Utilities.GetInternalVersion(pex)}";
|
||||
else if (!string.IsNullOrWhiteSpace(name) && name.StartsWith("Games for Windows", StringComparison.OrdinalIgnoreCase))
|
||||
|
||||
@@ -18,15 +18,15 @@ namespace BurnOutSharp.ProtectionType
|
||||
if (sections == null)
|
||||
return null;
|
||||
|
||||
string name = Utilities.GetFileDescription(pex);
|
||||
string name = pex.GetFileDescription();
|
||||
if (!string.IsNullOrWhiteSpace(name) && name.Contains("ImpulseReactor Dynamic Link Library"))
|
||||
return $"Impulse Reactor Core Module {Utilities.GetInternalVersion(pex)}";
|
||||
|
||||
name = Utilities.GetProductName(pex);
|
||||
name = pex.GetProductName();
|
||||
if (!string.IsNullOrWhiteSpace(name) && name.Contains("ImpulseReactor Dynamic Link Library"))
|
||||
return $"Impulse Reactor Core Module {Utilities.GetInternalVersion(pex)}";
|
||||
|
||||
name = Utilities.GetOriginalFileName(pex);
|
||||
name = pex.GetOriginalFileName();
|
||||
if (!string.IsNullOrWhiteSpace(name) && name.Contains("ReactorActivate.exe"))
|
||||
return $"Stardock Product Activation {Utilities.GetInternalVersion(pex)}";
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using BurnOutSharp.ExecutableType.Microsoft.PE;
|
||||
using BurnOutSharp.Tools;
|
||||
|
||||
namespace BurnOutSharp.ProtectionType
|
||||
{
|
||||
@@ -29,7 +28,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
if (sections == null)
|
||||
return null;
|
||||
|
||||
var fileNameResource = Utilities.FindResourceInSection(pex.ResourceSection, dataContains: $"NO NESTED PRMS SUPPORTED");
|
||||
var fileNameResource = pex.FindResource(dataContains: $"NO NESTED PRMS SUPPORTED");
|
||||
if (fileNameResource != null)
|
||||
return "ITENIUM Trial & Buy Protection";
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
using System.Collections.Generic;
|
||||
using BurnOutSharp.ExecutableType.Microsoft.PE;
|
||||
using BurnOutSharp.Matching;
|
||||
using BurnOutSharp.Tools;
|
||||
|
||||
namespace BurnOutSharp.ProtectionType
|
||||
{
|
||||
@@ -16,7 +15,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
if (sections == null)
|
||||
return null;
|
||||
|
||||
string name = Utilities.GetFileDescription(pex);
|
||||
string name = pex.GetFileDescription();
|
||||
if (!string.IsNullOrWhiteSpace(name) && name.Contains("SDKHM (KEEP)"))
|
||||
return "key2AudioXS";
|
||||
else if (!string.IsNullOrWhiteSpace(name) && name.Contains("SDKHM (KEPT)"))
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
using System.Collections.Generic;
|
||||
using BurnOutSharp.ExecutableType.Microsoft.PE;
|
||||
using BurnOutSharp.Matching;
|
||||
using BurnOutSharp.Tools;
|
||||
|
||||
namespace BurnOutSharp.ProtectionType
|
||||
{
|
||||
@@ -16,7 +15,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
if (sections == null)
|
||||
return null;
|
||||
|
||||
var resource = Utilities.FindResourceInSection(pex.ResourceSection, dataContains: "Cd3Ctl");
|
||||
var resource = pex.FindResource(dataContains: "Cd3Ctl");
|
||||
if (resource != null)
|
||||
return $"MediaMax CD-3";
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
return null;
|
||||
|
||||
// TODO: Is this too broad in general?
|
||||
string name = Utilities.GetInternalName(pex);
|
||||
string name = pex.GetInternalName();
|
||||
if (!string.IsNullOrWhiteSpace(name) && name.StartsWith("EReg", StringComparison.OrdinalIgnoreCase))
|
||||
return $"Executable-Based Online Registration {Utilities.GetInternalVersion(pex)}";
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using BurnOutSharp.ExecutableType.Microsoft.PE;
|
||||
using BurnOutSharp.Matching;
|
||||
using BurnOutSharp.Tools;
|
||||
|
||||
namespace BurnOutSharp.ProtectionType
|
||||
{
|
||||
@@ -17,11 +16,11 @@ namespace BurnOutSharp.ProtectionType
|
||||
if (sections == null)
|
||||
return null;
|
||||
|
||||
string name = Utilities.GetFileDescription(pex);
|
||||
string name = pex.GetFileDescription();
|
||||
if (!string.IsNullOrWhiteSpace(name) && name.Equals("Origin", StringComparison.OrdinalIgnoreCase))
|
||||
return "Origin";
|
||||
|
||||
name = Utilities.GetProductName(pex);
|
||||
name = pex.GetProductName();
|
||||
if (!string.IsNullOrWhiteSpace(name) && name.Equals("Origin", StringComparison.OrdinalIgnoreCase))
|
||||
return "Origin";
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
if (sections == null)
|
||||
return null;
|
||||
|
||||
string name = Utilities.GetFileDescription(pex);
|
||||
string name = pex.GetFileDescription();
|
||||
if (!string.IsNullOrWhiteSpace(name) && name.Equals("SafeCast2", StringComparison.OrdinalIgnoreCase))
|
||||
return $"SafeCast";
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
if (sections == null)
|
||||
return null;
|
||||
|
||||
string name = Utilities.GetFileDescription(pex);
|
||||
string name = pex.GetFileDescription();
|
||||
if (!string.IsNullOrWhiteSpace(name) && name.Contains("SecuROM PA"))
|
||||
return $"SecuROM PA v{Utilities.GetInternalVersion(pex)}";
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
if (sections == null)
|
||||
return null;
|
||||
|
||||
string name = Utilities.GetFileDescription(pex);
|
||||
string name = pex.GetFileDescription();
|
||||
if (!string.IsNullOrWhiteSpace(name) && name.StartsWith("DVM Library", StringComparison.OrdinalIgnoreCase))
|
||||
return $"SolidShield {Utilities.GetInternalVersion(pex)}";
|
||||
else if (!string.IsNullOrWhiteSpace(name) && name.StartsWith("Solidshield Activation Library", StringComparison.OrdinalIgnoreCase))
|
||||
@@ -28,7 +28,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
else if (!string.IsNullOrWhiteSpace(name) && name.StartsWith("Activation Manager", StringComparison.OrdinalIgnoreCase))
|
||||
return $"SolidShield Activation Manager Module {GetInternalVersion(pex)}";
|
||||
|
||||
name = Utilities.GetProductName(pex);
|
||||
name = pex.GetProductName();
|
||||
if (!string.IsNullOrWhiteSpace(name) && name.StartsWith("Solidshield Activation Library", StringComparison.OrdinalIgnoreCase))
|
||||
return $"SolidShield Core.dll {Utilities.GetInternalVersion(pex)}";
|
||||
else if (!string.IsNullOrWhiteSpace(name) && name.StartsWith("Solidshield Library", StringComparison.OrdinalIgnoreCase))
|
||||
@@ -58,7 +58,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
}
|
||||
|
||||
// Get the wrapper resource, if it exists
|
||||
var resource = Utilities.FindResourceInSection(pex.ResourceSection, dataContains: "B\0I\0N\0" + (char)0x07 + "\0I\0D\0R\0_\0S\0G\0T\0");
|
||||
var resource = pex.FindResource(dataContains: "B\0I\0N\0" + (char)0x07 + "\0I\0D\0R\0_\0S\0G\0T\0");
|
||||
if (resource != null)
|
||||
return "SolidShield EXE Wrapper v1";
|
||||
|
||||
@@ -190,7 +190,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
|
||||
private static string GetInternalVersion(PortableExecutable pex)
|
||||
{
|
||||
string companyName = Utilities.GetCompanyName(pex)?.ToLowerInvariant();
|
||||
string companyName = pex.GetCompanyName()?.ToLowerInvariant();
|
||||
if (!string.IsNullOrWhiteSpace(companyName) && (companyName.Contains("solidshield") || companyName.Contains("tages")))
|
||||
return Utilities.GetInternalVersion(pex);
|
||||
|
||||
|
||||
@@ -18,18 +18,18 @@ namespace BurnOutSharp.ProtectionType
|
||||
if (sections == null)
|
||||
return null;
|
||||
|
||||
string name = Utilities.GetLegalCopyright(pex);
|
||||
string name = pex.GetLegalCopyright();
|
||||
if (!string.IsNullOrWhiteSpace(name) && name.Contains("Protection Technology")) // Protection Technology (StarForce)?
|
||||
return $"StarForce {Utilities.GetInternalVersion(pex)}";
|
||||
|
||||
name = Utilities.GetInternalName(pex);
|
||||
name = pex.GetInternalName();
|
||||
if (!string.IsNullOrWhiteSpace(name) && name.Equals("CORE.EXE", StringComparison.Ordinal))
|
||||
return $"StarForce {Utilities.GetInternalVersion(pex)}";
|
||||
else if (!string.IsNullOrWhiteSpace(name) && name.Equals("protect.exe", StringComparison.Ordinal))
|
||||
return $"StarForce {Utilities.GetInternalVersion(pex)}";
|
||||
|
||||
// TODO: Find what fvinfo field actually maps to this
|
||||
name = Utilities.GetFileDescription(pex);
|
||||
name = pex.GetFileDescription();
|
||||
if (!string.IsNullOrWhiteSpace(name) && name.Contains("Protected Module"))
|
||||
return $"StarForce 5";
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
if (sections == null)
|
||||
return null;
|
||||
|
||||
string name = Utilities.GetFileDescription(pex);
|
||||
string name = pex.GetFileDescription();
|
||||
if (!string.IsNullOrEmpty(name) && name.Contains("Steam Autorun Setup"))
|
||||
return "Steam";
|
||||
else if (!string.IsNullOrEmpty(name) && name.Contains("Steam Client API"))
|
||||
@@ -26,7 +26,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
else if (!string.IsNullOrEmpty(name) && name.Contains("Steam Client Service"))
|
||||
return "Steam";
|
||||
|
||||
name = Utilities.GetProductName(pex);
|
||||
name = pex.GetProductName();
|
||||
if (!string.IsNullOrEmpty(name) && name.Contains("Steam Autorun Setup"))
|
||||
return "Steam";
|
||||
else if (!string.IsNullOrEmpty(name) && name.Contains("Steam Client API"))
|
||||
|
||||
@@ -28,13 +28,13 @@ namespace BurnOutSharp.ProtectionType
|
||||
// - TagesClient.exe
|
||||
// - TagesClient.dat (Does not always exist)
|
||||
|
||||
string name = Utilities.GetFileDescription(pex);
|
||||
string name = pex.GetFileDescription();
|
||||
if (!string.IsNullOrWhiteSpace(name) && name.StartsWith("TagesSetup", StringComparison.OrdinalIgnoreCase))
|
||||
return $"TAGES Driver Setup {GetVersion(pex)}";
|
||||
else if (!string.IsNullOrWhiteSpace(name) && name.StartsWith("Tagès activation client", StringComparison.OrdinalIgnoreCase))
|
||||
return $"TAGES Activation Client {GetVersion(pex)}";
|
||||
|
||||
name = Utilities.GetProductName(pex);
|
||||
name = pex.GetProductName();
|
||||
if (!string.IsNullOrWhiteSpace(name) && name.StartsWith("Application TagesSetup", StringComparison.OrdinalIgnoreCase))
|
||||
return $"TAGES Driver Setup {GetVersion(pex)}";
|
||||
else if (!string.IsNullOrWhiteSpace(name) && name.StartsWith("T@GES", StringComparison.OrdinalIgnoreCase))
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using BurnOutSharp.ExecutableType.Microsoft.PE;
|
||||
using BurnOutSharp.Tools;
|
||||
|
||||
namespace BurnOutSharp.ProtectionType
|
||||
{
|
||||
@@ -13,7 +12,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
if (sections == null)
|
||||
return null;
|
||||
|
||||
var resource = Utilities.FindResourceInSection(pex.ResourceSection, dataContains: "3\02\01\0S\0t\0u\0d\0i\0o\0s\0 \0A\0c\0t\0i\0v\0a\0t\0i\0o\0n\0");
|
||||
var resource = pex.FindResource(dataContains: "3\02\01\0S\0t\0u\0d\0i\0o\0s\0 \0A\0c\0t\0i\0v\0a\0t\0i\0o\0n\0");
|
||||
if (resource != null)
|
||||
return $"321Studios Online Activation";
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
using System.Collections.Generic;
|
||||
using BurnOutSharp.ExecutableType.Microsoft.PE;
|
||||
using BurnOutSharp.Matching;
|
||||
using BurnOutSharp.Tools;
|
||||
|
||||
namespace BurnOutSharp.ProtectionType
|
||||
{
|
||||
@@ -17,7 +16,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
if (sections == null)
|
||||
return null;
|
||||
|
||||
string name = Utilities.GetFileDescription(pex);
|
||||
string name = pex.GetFileDescription();
|
||||
if (!string.IsNullOrEmpty(name) && name.Contains("Ubisoft Connect Installer"))
|
||||
return "Uplay / Ubisoft Connect";
|
||||
else if (!string.IsNullOrEmpty(name) && name.Contains("Ubisoft Connect Service"))
|
||||
@@ -34,7 +33,7 @@ namespace BurnOutSharp.ProtectionType
|
||||
return "Uplay / Ubisoft Connect";
|
||||
|
||||
// There's also a variant that looks like "Uplay <version> installer"
|
||||
name = Utilities.GetProductName(pex);
|
||||
name = pex.GetProductName();
|
||||
if (!string.IsNullOrEmpty(name) && name.Contains("Ubisoft Connect"))
|
||||
return "Uplay / Ubisoft Connect";
|
||||
else if (!string.IsNullOrEmpty(name) && name.Contains("Uplay"))
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
using System.Collections.Generic;
|
||||
using BurnOutSharp.ExecutableType.Microsoft.PE;
|
||||
using BurnOutSharp.Matching;
|
||||
using BurnOutSharp.Tools;
|
||||
|
||||
namespace BurnOutSharp.ProtectionType
|
||||
{
|
||||
@@ -16,11 +15,11 @@ namespace BurnOutSharp.ProtectionType
|
||||
if (sections == null)
|
||||
return null;
|
||||
|
||||
string name = Utilities.GetFileDescription(pex);
|
||||
string name = pex.GetFileDescription();
|
||||
if (!string.IsNullOrEmpty(name) && name.Contains("Copy Protection Viewer"))
|
||||
return "WTM Protection Viewer";
|
||||
|
||||
name = Utilities.GetProductName(pex);
|
||||
name = pex.GetProductName();
|
||||
if (!string.IsNullOrEmpty(name) && name.Contains("WTM Copy Protection Viewer"))
|
||||
return "WTM Protection Viewer";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user