Files
BinaryObjectScanner/BinaryObjectScanner.Protection/CactusDataShield.cs

34 lines
1.2 KiB
C#
Raw Normal View History

2023-03-07 11:31:55 -05:00
using System.Collections.Generic;
using System.Linq;
using BinaryObjectScanner.Interfaces;
2023-03-07 16:59:14 -05:00
using BinaryObjectScanner.Matching;
namespace BinaryObjectScanner.Protection
{
2023-03-07 11:31:55 -05:00
public class CactusDataShield : IContentCheck
{
/// <inheritdoc/>
2022-05-01 17:17:15 -07:00
public string CheckContents(string file, byte[] fileContent, bool includeDebug)
2022-03-14 11:20:11 -07:00
{
// TODO: Limit these checks to Mac binaries
// TODO: Obtain a sample to find where this string is in a typical executable
if (includeDebug)
{
2022-03-14 11:52:49 -07:00
var contentMatchSets = new List<ContentMatchSet>
{
// CDSPlayer
new ContentMatchSet(new byte?[] { 0x43, 0x44, 0x53, 0x50, 0x6C, 0x61, 0x79, 0x65, 0x72 }, "Cactus Data Shield 200"),
// yucca.cds
new ContentMatchSet(new byte?[] { 0x79, 0x75, 0x63, 0x63, 0x61, 0x2E, 0x63, 0x64, 0x73 }, "Cactus Data Shield 200"),
};
2022-03-14 11:20:11 -07:00
if (contentMatchSets != null && contentMatchSets.Any())
return MatchUtil.GetFirstMatch(file, fileContent, contentMatchSets, includeDebug);
}
return null;
}
}
}