Convert CDS to string finding

This commit is contained in:
Matt Nadareski
2022-12-09 13:09:27 -08:00
parent 85c6353cba
commit 7c243ac6ff
3 changed files with 8 additions and 16 deletions

View File

@@ -666,6 +666,7 @@ namespace BurnOutSharp.Wrappers
/// <summary>
/// Overlay data, if it exists
/// </summary>
/// TODO: Add overlay string data
private byte[] _overlayData = null;
/// <summary>

View File

@@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using BurnOutSharp.Interfaces;
using BurnOutSharp.Matching;
using BurnOutSharp.Wrappers;
namespace BurnOutSharp.PackerType
@@ -26,7 +25,6 @@ namespace BurnOutSharp.PackerType
if (nicodeSection)
return "Armadillo";
// Loop through all "extension" sections -- usually .data1 or .text1
foreach (var sectionName in pex.SectionNames.Where(s => s != null && s.EndsWith("1")))
{

View File

@@ -62,22 +62,15 @@ namespace BurnOutSharp.ProtectionType
if (sections == null)
return null;
// Get the .data/DATA section, if it exists
var dataSectionRaw = pex.GetFirstSectionData(".data") ?? pex.GetFirstSectionData("DATA");
if (dataSectionRaw != null)
// Get the .data/DATA section strings, if they exist
List<string> strs = pex.GetFirstSectionStrings(".data") ?? pex.GetFirstSectionStrings("DATA");
if (strs != null)
{
var matchers = new List<ContentMatchSet>
{
// \*.CDS
new ContentMatchSet(new byte?[] { 0x5C, 0x2A, 0x2E, 0x43, 0x44, 0x53 }, "Cactus Data Shield 200"),
// DATA.CDS
new ContentMatchSet(new byte?[] { 0x44, 0x41, 0x54, 0x41, 0x2E, 0x43, 0x44, 0x53 }, "Cactus Data Shield 200"),
};
if (strs.Any(s => s.Contains("\\*.CDS")))
return "Cactus Data Shield 200";
string match = MatchUtil.GetFirstMatch(file, dataSectionRaw, matchers, includeDebug);
if (!string.IsNullOrWhiteSpace(match))
return match;
if (strs.Any(s => s.Contains("DATA.CDS")))
return "Cactus Data Shield 200";
}
// Found in "Volumia!" by Puur (Barcode 7 43218 63282 2) (Discogs Release Code [r795427]).