2021-07-18 09:44:23 -07:00
using System.Collections.Concurrent ;
using System.Collections.Generic ;
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
{
2022-11-06 22:04:03 -07:00
/// <summary>
/// CD-Protector is a form of DRM that allows users to create their own copy protected discs.
/// It prevents copying via "Phantom Trax", intended to confuse dumping software, and by obfuscating a specified EXE.
/// The official website seems to be https://web.archive.org/web/20000302173822/http://surf.to/nrgcrew.
/// The author's site should be https://members.xoom.it/_XOOM/Dudez/index.htm, but no captures of this site appear to be functional.
/// Instructions on how this software can be used: https://3dnews.ru/166065
/// Download: https://www.cdmediaworld.com/hardware/cdrom/cd_utils_3.shtml#CD-Protector
/// TODO: See if any of the older versions of CD-Protector are archived, and check if they need to be detected differently.
/// </summary>
2021-02-26 00:32:09 -08:00
public class CDProtector : IPathCheck
2019-09-27 23:52:24 -07:00
{
2021-02-26 00:32:09 -08:00
/// <inheritdoc/>
2021-07-18 09:44:23 -07:00
public ConcurrentQueue < string > CheckDirectoryPath ( string path , IEnumerable < string > files )
2019-09-27 23:52:24 -07:00
{
2021-03-22 23:02:01 -07:00
var matchers = new List < PathMatchSet >
2019-09-27 23:52:24 -07:00
{
2022-11-06 22:04:03 -07:00
// These are the main files used by CD-Protector, which should all be present in every protected disc.
// "_cdp16.dll" and "_cdp32.dll" are actually renamed WAV files.
// "_cdp32.dat" is actually an archive that contains the original executable.
// Another EXE is created, with the name of the original executable. I'm not sure what this executable does, but it appears to be compressed with NeoLite.
// TODO: Invesitage if this EXE itself can be detected in any way.
new PathMatchSet ( new PathMatch ( "_cdp16.dat" , useEndsWith : true ) , "CD-Protector" ) ,
new PathMatchSet ( new PathMatch ( "_cdp16.dll" , useEndsWith : true ) , "CD-Protector" ) ,
new PathMatchSet ( new PathMatch ( "_cdp32.dat" , useEndsWith : true ) , "CD-Protector" ) ,
new PathMatchSet ( new PathMatch ( "_cdp32.dll" , useEndsWith : true ) , "CD-Protector" ) ,
// This is the "Phantom Trax" file generated by CD-Protector, intended to be burned to a protected CD as an audio track.
new PathMatchSet ( new PathMatch ( "Track#1 - Track#2 Cd-Protector.wav" , useEndsWith : true ) , "CD-Protector" ) ,
2021-03-22 23:02:01 -07:00
} ;
2021-03-19 15:41:49 -07:00
2021-03-23 13:35:12 -07:00
return MatchUtil . GetAllMatches ( files , matchers , any : true ) ;
2021-03-19 15:41:49 -07:00
}
/// <inheritdoc/>
public string CheckFilePath ( string path )
{
2021-03-22 23:02:01 -07:00
var matchers = new List < PathMatchSet >
2019-09-27 23:52:24 -07:00
{
2022-11-06 22:04:03 -07:00
// These are the main files used by CD-Protector, which should all be present in every protected disc.
// "_cdp16.dll" and "_cdp32.dll" are actually renamed WAV files.
// "_cdp32.dat" is actually an archive that contains the original executable.
// Another EXE is created, with the name of the original executable. I'm not sure what this executable does, but it appears to be compressed with NeoLite.
// TODO: Invesitage if this EXE itself can be detected in any way.
new PathMatchSet ( new PathMatch ( "_cdp16.dat" , useEndsWith : true ) , "CD-Protector" ) ,
new PathMatchSet ( new PathMatch ( "_cdp16.dll" , useEndsWith : true ) , "CD-Protector" ) ,
new PathMatchSet ( new PathMatch ( "_cdp32.dat" , useEndsWith : true ) , "CD-Protector" ) ,
new PathMatchSet ( new PathMatch ( "_cdp32.dll" , useEndsWith : true ) , "CD-Protector" ) ,
// This is the "Phantom Trax" file generated by CD-Protector, intended to be burned to a protected CD as an audio track.
new PathMatchSet ( new PathMatch ( "Track#1 - Track#2 Cd-Protector.wav" , useEndsWith : true ) , "CD-Protector" ) ,
2021-03-22 23:02:01 -07:00
} ;
return MatchUtil . GetFirstMatch ( path , matchers , any : true ) ;
2019-09-27 23:52:24 -07:00
}
}
}