From 82b9c03a7e87c6b01d9824049bd6bc2cf8d9cf9f Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Wed, 26 Oct 2022 20:38:12 -0700 Subject: [PATCH] Add skeleton for Macrovision sub-protections --- .../ProtectionType/Macrovision.CDilla.cs | 19 ++++++++ .../Macrovision.CactusDataShield.cs | 19 ++++++++ .../ProtectionType/Macrovision.FLEXnet.cs | 19 ++++++++ .../ProtectionType/Macrovision.SafeCast.cs | 19 ++++++++ .../ProtectionType/Macrovision.SafeDisc.cs | 19 ++++++++ BurnOutSharp/ProtectionType/Macrovision.cs | 44 +++++++++++++++++++ 6 files changed, 139 insertions(+) create mode 100644 BurnOutSharp/ProtectionType/Macrovision.CDilla.cs create mode 100644 BurnOutSharp/ProtectionType/Macrovision.CactusDataShield.cs create mode 100644 BurnOutSharp/ProtectionType/Macrovision.FLEXnet.cs create mode 100644 BurnOutSharp/ProtectionType/Macrovision.SafeCast.cs create mode 100644 BurnOutSharp/ProtectionType/Macrovision.SafeDisc.cs create mode 100644 BurnOutSharp/ProtectionType/Macrovision.cs diff --git a/BurnOutSharp/ProtectionType/Macrovision.CDilla.cs b/BurnOutSharp/ProtectionType/Macrovision.CDilla.cs new file mode 100644 index 00000000..2a3796d8 --- /dev/null +++ b/BurnOutSharp/ProtectionType/Macrovision.CDilla.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.IO; +using BurnOutSharp.ExecutableType.Microsoft.PE; +using BurnOutSharp.Interfaces; +using BurnOutSharp.Matching; +using BurnOutSharp.Tools; + +namespace BurnOutSharp.ProtectionType +{ + /// + /// This is a placeholder C-Dilla (sub-Macrovision) specific functionality + /// + public partial class Macrovision + { + // TODO: Add methods for specific PE, path, and version checks here + } +} diff --git a/BurnOutSharp/ProtectionType/Macrovision.CactusDataShield.cs b/BurnOutSharp/ProtectionType/Macrovision.CactusDataShield.cs new file mode 100644 index 00000000..5cae3445 --- /dev/null +++ b/BurnOutSharp/ProtectionType/Macrovision.CactusDataShield.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.IO; +using BurnOutSharp.ExecutableType.Microsoft.PE; +using BurnOutSharp.Interfaces; +using BurnOutSharp.Matching; +using BurnOutSharp.Tools; + +namespace BurnOutSharp.ProtectionType +{ + /// + /// This is a placeholder Cactus Data Shield (sub-Macrovision) specific functionality + /// + public partial class Macrovision + { + // TODO: Add methods for specific PE, path, and version checks here + } +} diff --git a/BurnOutSharp/ProtectionType/Macrovision.FLEXnet.cs b/BurnOutSharp/ProtectionType/Macrovision.FLEXnet.cs new file mode 100644 index 00000000..3dc3b41e --- /dev/null +++ b/BurnOutSharp/ProtectionType/Macrovision.FLEXnet.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.IO; +using BurnOutSharp.ExecutableType.Microsoft.PE; +using BurnOutSharp.Interfaces; +using BurnOutSharp.Matching; +using BurnOutSharp.Tools; + +namespace BurnOutSharp.ProtectionType +{ + /// + /// This is a placeholder FLEXnet (sub-Macrovision) specific functionality + /// + public partial class Macrovision + { + // TODO: Add methods for specific PE, path, and version checks here + } +} diff --git a/BurnOutSharp/ProtectionType/Macrovision.SafeCast.cs b/BurnOutSharp/ProtectionType/Macrovision.SafeCast.cs new file mode 100644 index 00000000..b500c00a --- /dev/null +++ b/BurnOutSharp/ProtectionType/Macrovision.SafeCast.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.IO; +using BurnOutSharp.ExecutableType.Microsoft.PE; +using BurnOutSharp.Interfaces; +using BurnOutSharp.Matching; +using BurnOutSharp.Tools; + +namespace BurnOutSharp.ProtectionType +{ + /// + /// This is a placeholder SafeCast (sub-Macrovision) specific functionality + /// + public partial class Macrovision + { + // TODO: Add methods for specific PE, path, and version checks here + } +} diff --git a/BurnOutSharp/ProtectionType/Macrovision.SafeDisc.cs b/BurnOutSharp/ProtectionType/Macrovision.SafeDisc.cs new file mode 100644 index 00000000..10e0770c --- /dev/null +++ b/BurnOutSharp/ProtectionType/Macrovision.SafeDisc.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.IO; +using BurnOutSharp.ExecutableType.Microsoft.PE; +using BurnOutSharp.Interfaces; +using BurnOutSharp.Matching; +using BurnOutSharp.Tools; + +namespace BurnOutSharp.ProtectionType +{ + /// + /// This is a placeholder SafeDisc (sub-Macrovision) specific functionality + /// + public partial class Macrovision + { + // TODO: Add methods for specific PE, path, and version checks here + } +} diff --git a/BurnOutSharp/ProtectionType/Macrovision.cs b/BurnOutSharp/ProtectionType/Macrovision.cs new file mode 100644 index 00000000..b538ae7e --- /dev/null +++ b/BurnOutSharp/ProtectionType/Macrovision.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.IO; +using BurnOutSharp.ExecutableType.Microsoft.PE; +using BurnOutSharp.Interfaces; +using BurnOutSharp.Matching; +using BurnOutSharp.Tools; + +namespace BurnOutSharp.ProtectionType +{ + /// + /// This is a placeholder for all Macrovision-based protections. See partial classes for more details + /// + public partial class Macrovision : IPathCheck, IPortableExecutableCheck + { + /// + 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; + + // TODO: Add all common Macrovision PE checks here + + return null; + } + + /// + public ConcurrentQueue CheckDirectoryPath(string path, IEnumerable files) + { + // TODO: Add all common Macrovision directory path checks here + return MatchUtil.GetAllMatches(files, null, any: false); + } + + /// + public string CheckFilePath(string path) + { + // TODO: Add all common Macrovision file path checks here + return MatchUtil.GetFirstMatch(path, null, any: true); + } + } +}