Add skeleton for Macrovision sub-protections

This commit is contained in:
Matt Nadareski
2022-10-26 20:38:12 -07:00
parent ac917df519
commit 82b9c03a7e
6 changed files with 139 additions and 0 deletions

View File

@@ -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
{
/// <summary>
/// This is a placeholder C-Dilla (sub-Macrovision) specific functionality
/// </summary>
public partial class Macrovision
{
// TODO: Add methods for specific PE, path, and version checks here
}
}

View File

@@ -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
{
/// <summary>
/// This is a placeholder Cactus Data Shield (sub-Macrovision) specific functionality
/// </summary>
public partial class Macrovision
{
// TODO: Add methods for specific PE, path, and version checks here
}
}

View File

@@ -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
{
/// <summary>
/// This is a placeholder FLEXnet (sub-Macrovision) specific functionality
/// </summary>
public partial class Macrovision
{
// TODO: Add methods for specific PE, path, and version checks here
}
}

View File

@@ -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
{
/// <summary>
/// This is a placeholder SafeCast (sub-Macrovision) specific functionality
/// </summary>
public partial class Macrovision
{
// TODO: Add methods for specific PE, path, and version checks here
}
}

View File

@@ -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
{
/// <summary>
/// This is a placeholder SafeDisc (sub-Macrovision) specific functionality
/// </summary>
public partial class Macrovision
{
// TODO: Add methods for specific PE, path, and version checks here
}
}

View File

@@ -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
{
/// <summary>
/// This is a placeholder for all Macrovision-based protections. See partial classes for more details
/// </summary>
public partial class Macrovision : IPathCheck, 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;
// TODO: Add all common Macrovision PE checks here
return null;
}
/// <inheritdoc/>
public ConcurrentQueue<string> CheckDirectoryPath(string path, IEnumerable<string> files)
{
// TODO: Add all common Macrovision directory path checks here
return MatchUtil.GetAllMatches(files, null, any: false);
}
/// <inheritdoc/>
public string CheckFilePath(string path)
{
// TODO: Add all common Macrovision file path checks here
return MatchUtil.GetFirstMatch(path, null, any: true);
}
}
}