Update Cenega ProtectDVD (#221)

* Add new export check for Cenega ProtectDVD.

* Update notes and add link to DRML.
This commit is contained in:
TheRogueArchivist
2022-12-30 10:54:44 -07:00
committed by GitHub
parent 3ebb3822dd
commit cc1ad3e690

View File

@@ -1,4 +1,5 @@
using System.Collections.Concurrent;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using BurnOutSharp.Interfaces;
using BurnOutSharp.Matching;
@@ -9,6 +10,7 @@ namespace BurnOutSharp.ProtectionType
/// <summary>
/// Cenega ProtectDVD is a protection seemingly created by the publisher Cenega for use with their games.
/// Games using this protection aren't able to be run from an ISO file, and presumably use DMI as a protection feature.
/// <see href="https://github.com/TheRogueArchivist/DRML/blob/main/entries/Cenega_ProtectDVD.md"/>
/// </summary>
public class CengaProtectDVD : IPathCheck, IPortableExecutableCheck
{
@@ -20,12 +22,21 @@ namespace BurnOutSharp.ProtectionType
if (sections == null)
return null;
// Get the .cenega section, if it exists. Seems to be found in the protected game executable (Redump entry 31422).
// Get the export directory table
if (pex.ExportTable?.ExportDirectoryTable != null)
{
// Found in "cenega.dll" in IA item "speed-pack".
bool match = pex.ExportTable.ExportDirectoryTable.Name?.Equals("ProtectDVD.dll", StringComparison.OrdinalIgnoreCase) == true;
if (match)
return "Cenega ProtectDVD";
}
// Get the .cenega section, if it exists. Seems to be found in the protected game executable ("game.exe" in Redump entry 31422 and "Classic Car Racing.exe" in IA item "speed-pack").
bool cenegaSection = pex.ContainsSection(".cenega", exact: true);
if (cenegaSection)
return "Cenega ProtectDVD";
// Get the .cenega0 through .cenega2 sections, if they exists. Found in cenega.dll (Redump entry 31422).
// Get the .cenega0 through .cenega2 sections, if they exists. Found in "cenega.dll" in Redump entry 31422 and IA item "speed-pack".
cenegaSection = pex.ContainsSection(".cenega0", exact: true);
if (cenegaSection)
return "Cenega ProtectDVD";
@@ -47,7 +58,7 @@ namespace BurnOutSharp.ProtectionType
var matchers = new List<PathMatchSet>
{
// Seems likely to be present in most, if not all discs protected with Cenega ProtectDVD, but unable to confirm due to only having a small sample size.
// References the existence of a "ProtectDVD.dll", which has not yet been located (Redump entry 31422).
// Found in Redump entry 31422 and IA item "speed-pack".
new PathMatchSet(new PathMatch("cenega.dll", useEndsWith: true), "Cenega ProtectDVD"),
};
@@ -60,7 +71,7 @@ namespace BurnOutSharp.ProtectionType
var matchers = new List<PathMatchSet>
{
// Seems likely to be present in most, if not all discs protected with Cenega ProtectDVD, but unable to confirm due to only having a small sample size.
// References the existence of a "ProtectDVD.dll", which has not yet been located (Redump entry 31422).
// Found in Redump entry 31422 and IA item "speed-pack".
new PathMatchSet(new PathMatch("cenega.dll", useEndsWith: true), "Cenega ProtectDVD"),
};