2023-03-07 11:31:55 -05:00
|
|
|
|
using System.Collections.Generic;
|
2019-09-27 23:52:24 -07:00
|
|
|
|
using System.Linq;
|
2023-03-09 11:52:28 -05:00
|
|
|
|
using BinaryObjectScanner.Interfaces;
|
2023-03-07 16:59:14 -05:00
|
|
|
|
using BinaryObjectScanner.Matching;
|
2019-09-27 23:52:24 -07:00
|
|
|
|
|
2023-03-09 23:19:27 -05:00
|
|
|
|
namespace BinaryObjectScanner.Protection
|
2019-09-27 23:52:24 -07:00
|
|
|
|
{
|
2023-03-07 11:31:55 -05:00
|
|
|
|
public class CactusDataShield : IContentCheck
|
2019-09-27 23:52:24 -07:00
|
|
|
|
{
|
2021-08-25 19:37:32 -07:00
|
|
|
|
/// <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;
|
|
|
|
|
|
}
|
2019-09-27 23:52:24 -07:00
|
|
|
|
}
|
|
|
|
|
|
}
|