Rename position flag -> debug flag

This commit is contained in:
Matt Nadareski
2021-08-24 15:19:23 -07:00
parent a2a0e5c2ee
commit 43845cf722
62 changed files with 136 additions and 137 deletions

View File

@@ -90,7 +90,7 @@ namespace BurnOutSharp.FileType
// Iterate through all content checks
Parallel.ForEach(contentCheckClasses, contentCheckClass =>
{
string protection = contentCheckClass.CheckContents(file, fileContent, scanner.IncludePosition);
string protection = contentCheckClass.CheckContents(file, fileContent, scanner.IncludeDebug);
// If we have a valid content check based on settings
if (!contentCheckClass.GetType().Namespace.ToLowerInvariant().Contains("packertype") || scanner.ScanPackers)

View File

@@ -9,8 +9,8 @@
/// </summary>
/// <param name="file">File to check for protection indicators</param>
/// <param name="fileContent">Byte array representing the file contents</param>
/// <param name="includePosition">True to include positional data, false otherwise</param>
/// <param name="includeDebug">True to include debug data, false otherwise</param>
/// <returns>String containing any protections found in the file</returns>
string CheckContents(string file, byte[] fileContent, bool includePosition);
string CheckContents(string file, byte[] fileContent, bool includeDebug);
}
}

View File

@@ -17,15 +17,15 @@ namespace BurnOutSharp.Matching
/// <param name="file">File to check for matches</param>
/// <param name="fileContent">Byte array representing the file contents</param>
/// <param name="matchers">Enumerable of ContentMatchSets to be run on the file</param>
/// <param name="includePosition">True to include positional data, false otherwise</param>
/// <param name="includeDebug">True to include positional data, false otherwise</param>
/// <returns>List of strings representing the matched protections, null or empty otherwise</returns>
public static ConcurrentQueue<string> GetAllMatches(
string file,
byte[] fileContent,
IEnumerable<ContentMatchSet> matchers,
bool includePosition = false)
bool includeDebug = false)
{
return FindAllMatches(file, fileContent, matchers, includePosition, false);
return FindAllMatches(file, fileContent, matchers, includeDebug, false);
}
/// <summary>
@@ -34,15 +34,15 @@ namespace BurnOutSharp.Matching
/// <param name="file">File to check for matches</param>
/// <param name="fileContent">Byte array representing the file contents</param>
/// <param name="matchers">Enumerable of ContentMatchSets to be run on the file</param>
/// <param name="includePosition">True to include positional data, false otherwise</param>
/// <param name="includeDebug">True to include positional data, false otherwise</param>
/// <returns>String representing the matched protection, null otherwise</returns>
public static string GetFirstMatch(
string file,
byte[] fileContent,
IEnumerable<ContentMatchSet> matchers,
bool includePosition = false)
bool includeDebug = false)
{
var contentMatches = FindAllMatches(file, fileContent, matchers, includePosition, true);
var contentMatches = FindAllMatches(file, fileContent, matchers, includeDebug, true);
if (contentMatches == null || !contentMatches.Any())
return null;
@@ -55,14 +55,14 @@ namespace BurnOutSharp.Matching
/// <param name="file">File to check for matches</param>
/// <param name="fileContent">Byte array representing the file contents</param>
/// <param name="matchers">Enumerable of ContentMatchSets to be run on the file</param>
/// <param name="includePosition">True to include positional data, false otherwise</param>
/// <param name="includeDebug">True to include positional data, false otherwise</param>
/// <param name="stopAfterFirst">True to stop after the first match, false otherwise</param>
/// <returns>List of strings representing the matched protections, null or empty otherwise</returns>
private static ConcurrentQueue<string> FindAllMatches(
string file,
byte[] fileContent,
IEnumerable<ContentMatchSet> matchers,
bool includePosition,
bool includeDebug,
bool stopAfterFirst)
{
// If there's no mappings, we can't match
@@ -86,7 +86,7 @@ namespace BurnOutSharp.Matching
// If we there is no version method, just return the protection name
if (matcher.GetVersion == null)
{
matchedProtections.Enqueue((matcher.ProtectionName ?? "Unknown Protection") + (includePosition ? $" (Index {positionsString})" : string.Empty));
matchedProtections.Enqueue((matcher.ProtectionName ?? "Unknown Protection") + (includeDebug ? $" (Index {positionsString})" : string.Empty));
}
// Otherwise, invoke the version method
@@ -97,7 +97,7 @@ namespace BurnOutSharp.Matching
if (version == null)
continue;
matchedProtections.Enqueue($"{matcher.ProtectionName ?? "Unknown Protection"} {version}".TrimEnd() + (includePosition ? $" (Index {positionsString})" : string.Empty));
matchedProtections.Enqueue($"{matcher.ProtectionName ?? "Unknown Protection"} {version}".TrimEnd() + (includeDebug ? $" (Index {positionsString})" : string.Empty));
}
// If we're stopping after the first protection, bail out here

View File

@@ -7,7 +7,7 @@ namespace BurnOutSharp.PackerType
public class AdvancedInstaller : IContentCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -22,7 +22,7 @@ namespace BurnOutSharp.PackerType
}, "Caphyon Advanced Installer"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
}
}

View File

@@ -6,7 +6,7 @@ namespace BurnOutSharp.PackerType
public class Armadillo : IContentCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -17,7 +17,7 @@ namespace BurnOutSharp.PackerType
new ContentMatchSet(new byte?[] { 0x41, 0x52, 0x4D, 0x44, 0x45, 0x42, 0x55, 0x47 }, "Armadillo"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
}
}

View File

@@ -13,7 +13,7 @@ namespace BurnOutSharp.PackerType
public bool ShouldScan(byte[] magic) => true;
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -30,7 +30,7 @@ namespace BurnOutSharp.PackerType
}, end: 200), "CExe"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
/// <inheritdoc/>

View File

@@ -6,7 +6,7 @@ namespace BurnOutSharp.PackerType
public class EXEStealth : IContentCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -21,7 +21,7 @@ namespace BurnOutSharp.PackerType
}, "EXE Stealth"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
}
}

View File

@@ -14,7 +14,7 @@ namespace BurnOutSharp.PackerType
public bool ShouldScan(byte[] magic) => true;
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -33,7 +33,7 @@ namespace BurnOutSharp.PackerType
"Inno Setup"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
/// <inheritdoc/>

View File

@@ -11,7 +11,7 @@ namespace BurnOutSharp.PackerType
public bool ShouldScan(byte[] magic) => true;
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -23,7 +23,7 @@ namespace BurnOutSharp.PackerType
"Installer VISE"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
// TODO: Add Installer VISE extraction

View File

@@ -8,7 +8,7 @@ namespace BurnOutSharp.PackerType
public class IntelInstallationFramework : IContentCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var fvinfo = Utilities.GetFileVersionInfo(file);
@@ -56,7 +56,7 @@ namespace BurnOutSharp.PackerType
}, Utilities.GetFileVersion, "Intel Installation Framework"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
}
}

View File

@@ -13,7 +13,7 @@ namespace BurnOutSharp.PackerType
public bool ShouldScan(byte[] magic) => true;
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var fvinfo = Utilities.GetFileVersionInfo(file);
@@ -67,7 +67,7 @@ namespace BurnOutSharp.PackerType
new ContentMatchSet(new byte?[] { 0x4D, 0x53, 0x43, 0x46, 0x75 }, GetVersion, "Microsoft CAB SFX"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
/// <inheritdoc/>

View File

@@ -9,7 +9,7 @@ namespace BurnOutSharp.PackerType
public class NSIS : IContentCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -29,7 +29,7 @@ namespace BurnOutSharp.PackerType
}, "NSIS"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
public static string GetVersion(string file, byte[] fileContent, List<int> positions)

View File

@@ -8,7 +8,7 @@ namespace BurnOutSharp.PackerType
public class PECompact : IContentCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
// Another possible version string for version 1 is "PECO" (50 45 43 4F)
var matchers = new List<ContentMatchSet>
@@ -27,7 +27,7 @@ namespace BurnOutSharp.PackerType
}, "PE Compact 2"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
// TODO: Improve version detection, Protection ID is able to detect ranges of versions. For example, 1.66-1.84 or 2.20-3.02.

View File

@@ -11,7 +11,7 @@ namespace BurnOutSharp.PackerType
public bool ShouldScan(byte[] magic) => true;
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -45,7 +45,7 @@ namespace BurnOutSharp.PackerType
// }, GetVersion, "Setup Factory"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
/// <inheritdoc/>

View File

@@ -7,7 +7,7 @@ namespace BurnOutSharp.PackerType
public class UPX : IContentCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -45,7 +45,7 @@ namespace BurnOutSharp.PackerType
),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
public static string GetVersion(string file, byte[] fileContent, List<int> positions)

View File

@@ -14,7 +14,7 @@ namespace BurnOutSharp.PackerType
public bool ShouldScan(byte[] magic) => true;
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -27,7 +27,7 @@ namespace BurnOutSharp.PackerType
}, "WinRAR SFX"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
public ConcurrentDictionary<string, ConcurrentQueue<string>> Scan(Scanner scanner, string file)

View File

@@ -14,7 +14,7 @@ namespace BurnOutSharp.PackerType
public bool ShouldScan(byte[] magic) => true;
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -30,7 +30,7 @@ namespace BurnOutSharp.PackerType
new ContentMatchSet(new byte?[] { 0x5F, 0x77, 0x69, 0x6E, 0x7A, 0x69, 0x70, 0x5F }, GetVersion, "WinZip SFX"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
// TODO: Find a way to generically detect 2.X versions and improve exact version detection for SFX PE versions bundled with WinZip 11+

View File

@@ -13,7 +13,7 @@ namespace BurnOutSharp.PackerType
public bool ShouldScan(byte[] magic) => true;
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -21,7 +21,7 @@ namespace BurnOutSharp.PackerType
new ContentMatchSet(new byte?[] { 0x57, 0x69, 0x73, 0x65, 0x4D, 0x61, 0x69, 0x6E }, "Wise Installation Wizard Module"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
/// <inheritdoc/>

View File

@@ -6,7 +6,7 @@ namespace BurnOutSharp.PackerType
public class dotFuscator : IContentCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -19,7 +19,7 @@ namespace BurnOutSharp.PackerType
}, "dotFuscator"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
}
}

View File

@@ -6,7 +6,7 @@ namespace BurnOutSharp.ProtectionType
public class ActiveMARK : IContentCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -22,7 +22,7 @@ namespace BurnOutSharp.ProtectionType
}, "ActiveMARK 5"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
}
}

View File

@@ -6,7 +6,7 @@ namespace BurnOutSharp.ProtectionType
public class AlphaROM : IContentCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -14,7 +14,7 @@ namespace BurnOutSharp.ProtectionType
new ContentMatchSet(new byte?[] { 0x53, 0x45, 0x54, 0x54, 0x45, 0x43 }, "Alpha-ROM"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
}
}

View File

@@ -13,7 +13,7 @@ namespace BurnOutSharp.ProtectionType
public class Bitpool : IContentCheck, IPathCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -26,7 +26,7 @@ namespace BurnOutSharp.ProtectionType
}, "Bitpool"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
/// <inheritdoc/>

View File

@@ -6,7 +6,7 @@ namespace BurnOutSharp.ProtectionType
public class CDCheck : IContentCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -21,11 +21,11 @@ namespace BurnOutSharp.ProtectionType
new ContentMatchSet(new byte?[] { 0x43, 0x44, 0x43, 0x68, 0x65, 0x63, 0x6B }, "Executable-Based CD Check"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
// These content checks are too broad to be useful
private static string CheckContentsBroad(string file, byte[] fileContent, bool includePosition = false)
private static string CheckContentsBroad(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -45,7 +45,7 @@ namespace BurnOutSharp.ProtectionType
}, "Executable-Based CD Check"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
}
}

View File

@@ -9,7 +9,7 @@ namespace BurnOutSharp.ProtectionType
public class CDCops : IContentCheck, IPathCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -24,7 +24,7 @@ namespace BurnOutSharp.ProtectionType
new ContentMatchSet(new byte?[] { 0x2E, 0x67, 0x72, 0x61, 0x6E, 0x64, 0x00 }, "CD-Cops"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
/// <inheritdoc/>

View File

@@ -6,7 +6,7 @@ namespace BurnOutSharp.ProtectionType
public class CDKey : IContentCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -21,7 +21,7 @@ namespace BurnOutSharp.ProtectionType
}, Utilities.GetFileVersion, "CD-Key / Serial"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
}
}

View File

@@ -7,7 +7,7 @@ namespace BurnOutSharp.ProtectionType
public class CDLock : IContentCheck, IPathCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -21,7 +21,7 @@ namespace BurnOutSharp.ProtectionType
}, "CD-Lock"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
/// <inheritdoc/>

View File

@@ -6,7 +6,7 @@ namespace BurnOutSharp.ProtectionType
public class CDSHiELDSE : IContentCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -14,7 +14,7 @@ namespace BurnOutSharp.ProtectionType
new ContentMatchSet(new byte?[] { 0x7E, 0x30, 0x30, 0x31, 0x37, 0x2E, 0x74, 0x6D, 0x70 }, "CDSHiELD SE"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
}
}

View File

@@ -11,7 +11,7 @@ namespace BurnOutSharp.ProtectionType
public class CactusDataShield : IContentCheck, IPathCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -25,7 +25,7 @@ namespace BurnOutSharp.ProtectionType
new ContentMatchSet(new byte?[] { 0x43, 0x44, 0x53, 0x50, 0x6C, 0x61, 0x79, 0x65, 0x72 }, "Cactus Data Shield 200"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
/// <inheritdoc/>

View File

@@ -6,7 +6,7 @@ namespace BurnOutSharp.ProtectionType
public class CengaProtectDVD : IContentCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -14,7 +14,7 @@ namespace BurnOutSharp.ProtectionType
new ContentMatchSet(new byte?[] { 0x2E, 0x63, 0x65, 0x6E, 0x65, 0x67, 0x61 }, "Cenega ProtectDVD"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
}
}

View File

@@ -6,7 +6,7 @@ namespace BurnOutSharp.ProtectionType
public class CodeLock : IContentCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
// TODO: Verify if these are OR or AND
var matchers = new List<ContentMatchSet>
@@ -25,7 +25,7 @@ namespace BurnOutSharp.ProtectionType
}, "Code Lock"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
}
}

View File

@@ -7,7 +7,7 @@ namespace BurnOutSharp.ProtectionType
public class CopyKiller : IContentCheck, IPathCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -19,7 +19,7 @@ namespace BurnOutSharp.ProtectionType
}, "CopyKiller"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
/// <inheritdoc/>

View File

@@ -8,7 +8,7 @@ namespace BurnOutSharp.ProtectionType
public class DVDCops : IContentCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -20,7 +20,7 @@ namespace BurnOutSharp.ProtectionType
}, GetVersion, "DVD-Cops"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
public static string GetVersion(string file, byte[] fileContent, List<int> positions)

View File

@@ -10,7 +10,7 @@ namespace BurnOutSharp.ProtectionType
// - Reference to `EASTL` and `EAStdC` are standard for EA products and does not indicate Cucko by itself
// - There's little information outside of PiD detection that actually knows about Cucko
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -96,7 +96,7 @@ namespace BurnOutSharp.ProtectionType
}, "EA DRM Protection"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
}
}

View File

@@ -7,7 +7,7 @@ namespace BurnOutSharp.ProtectionType
public class GFWL : IContentCheck, IPathCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -44,7 +44,7 @@ namespace BurnOutSharp.ProtectionType
}, Utilities.GetFileVersion, "Games for Windows LIVE"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
/// <inheritdoc/>

View File

@@ -7,7 +7,7 @@ namespace BurnOutSharp.ProtectionType
public class ImpulseReactor : IContentCheck, IPathCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -42,7 +42,7 @@ namespace BurnOutSharp.ProtectionType
}, "Impulse Reactor"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
/// <inheritdoc/>

View File

@@ -22,7 +22,7 @@ namespace BurnOutSharp.ProtectionType
*/
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -30,7 +30,7 @@ namespace BurnOutSharp.ProtectionType
new ContentMatchSet(new byte?[] { 0x54, 0x72, 0x69, 0x61, 0x6C, 0x00, 0x50 }, "INTENIUM Trial & Buy Protection"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
}
}

View File

@@ -8,7 +8,7 @@ namespace BurnOutSharp.ProtectionType
public class JoWooDXProt : IContentCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -34,7 +34,7 @@ namespace BurnOutSharp.ProtectionType
new ContentMatchSet(new byte?[] { 0x2E, 0x65, 0x78, 0x74, 0x20, 0x20, 0x20, 0x20 }, "JoWooD X-Prot v1"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
public static string GetVersion(string file, byte[] fileContent, List<int> positions)

View File

@@ -6,7 +6,7 @@ namespace BurnOutSharp.ProtectionType
public class KeyLock : IContentCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -18,7 +18,7 @@ namespace BurnOutSharp.ProtectionType
}, "Key-Lock (Dongle)"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
}
}

View File

@@ -11,7 +11,7 @@ namespace BurnOutSharp.ProtectionType
public class LaserLock : IContentCheck, IPathCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
// "Packed by SPEEnc V2 Asterios Parlamentas.PE"
byte?[] check = new byte?[] { 0x50, 0x61, 0x63, 0x6B, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x53, 0x50, 0x45, 0x45, 0x6E, 0x63, 0x20, 0x56, 0x32, 0x20, 0x41, 0x73, 0x74, 0x65, 0x72, 0x69, 0x6F, 0x73, 0x20, 0x50, 0x61, 0x72, 0x6C, 0x61, 0x6D, 0x65, 0x6E, 0x74, 0x61, 0x73, 0x2E, 0x50, 0x45 };
@@ -22,14 +22,14 @@ namespace BurnOutSharp.ProtectionType
bool containsCheck2 = fileContent.FirstPosition(check2, out int position2);
if (containsCheck && containsCheck2)
return $"LaserLock {GetVersion(fileContent, position2)} {GetBuild(fileContent, true)}" + (includePosition ? $" (Index {position}, {position2})" : string.Empty);
return $"LaserLock {GetVersion(fileContent, position2)} {GetBuild(fileContent, true)}" + (includeDebug ? $" (Index {position}, {position2})" : string.Empty);
else if (containsCheck && !containsCheck2)
return $"LaserLock Marathon {GetBuild(fileContent, false)}" + (includePosition ? $" (Index {position})" : string.Empty);
return $"LaserLock Marathon {GetBuild(fileContent, false)}" + (includeDebug ? $" (Index {position})" : string.Empty);
else if (!containsCheck && containsCheck2)
return $"LaserLock {GetVersion(fileContent, --position2)} {GetBuild(fileContent, false)}" + (includePosition ? $" (Index {position2})" : string.Empty);
return $"LaserLock {GetVersion(fileContent, --position2)} {GetBuild(fileContent, false)}" + (includeDebug ? $" (Index {position2})" : string.Empty);
if (file != null && string.Equals(Path.GetFileName(file), "NOMOUSE.SP", StringComparison.OrdinalIgnoreCase))
return $"LaserLock {GetVersion16Bit(fileContent)}" + (includePosition ? $" (Index 71)" : string.Empty);
return $"LaserLock {GetVersion16Bit(fileContent)}" + (includeDebug ? $" (Index 71)" : string.Empty);
var matchers = new List<ContentMatchSet>
{
@@ -59,7 +59,7 @@ namespace BurnOutSharp.ProtectionType
}, "LaserLock 5"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
/// <inheritdoc/>

View File

@@ -7,7 +7,7 @@ namespace BurnOutSharp.ProtectionType
public class MediaMaxCD3 : IContentCheck, IPathCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -22,7 +22,7 @@ namespace BurnOutSharp.ProtectionType
}, "MediaMax CD-3"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
/// <inheritdoc/>

View File

@@ -6,7 +6,7 @@ namespace BurnOutSharp.ProtectionType
public class OnlineRegistration : IContentCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -21,7 +21,7 @@ namespace BurnOutSharp.ProtectionType
}, Utilities.GetFileVersion, "Executable-Based Online Registration"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
}
}

View File

@@ -7,7 +7,7 @@ namespace BurnOutSharp.ProtectionType
public class Origin : IContentCheck, IPathCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -15,7 +15,7 @@ namespace BurnOutSharp.ProtectionType
new ContentMatchSet(new byte?[] { 0x4F, 0x00, 0x72, 0x00, 0x69, 0x00, 0x67, 0x00, 0x69, 0x00, 0x6E, 0x00, 0x53, 0x00, 0x65, 0x00, 0x74, 0x00, 0x75, 0x00, 0x70, 0x00, 0x2E, 0x00, 0x65, 0x00, 0x78, 0x00, 0x65, 0x00 }, "Origin"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
/// <inheritdoc/>

View File

@@ -8,7 +8,7 @@ namespace BurnOutSharp.ProtectionType
// TODO: Figure out PSX binary header so this can be checked explicitly
// TODO: Detect Red Hand protection
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -42,7 +42,7 @@ namespace BurnOutSharp.ProtectionType
}, "PlayStation Anti-modchip (Japanese)"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
}
}

View File

@@ -11,7 +11,7 @@ namespace BurnOutSharp.ProtectionType
public class ProtectDisc : IContentCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -22,7 +22,7 @@ namespace BurnOutSharp.ProtectionType
new ContentMatchSet(new byte?[] { 0x41, 0x43, 0x45, 0x2D, 0x50, 0x43, 0x44 }, GetVersion6till8, "ProtectDisc"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
public static string GetVersion6till8(string file, byte[] fileContent, List<int> positions)

View File

@@ -6,7 +6,7 @@ namespace BurnOutSharp.ProtectionType
public class RingPROTECH : IContentCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -18,7 +18,7 @@ namespace BurnOutSharp.ProtectionType
}, "Ring PROTECH [Check disc for physical ring]"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
}
}

View File

@@ -6,7 +6,7 @@ namespace BurnOutSharp.ProtectionType
public class SVKProtector : IContentCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -14,7 +14,7 @@ namespace BurnOutSharp.ProtectionType
new ContentMatchSet(new byte?[] { 0x3F, 0x53, 0x56, 0x4B, 0x50, 0x00, 0x00 }, "SVK Protector"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
}
}

View File

@@ -39,7 +39,7 @@ namespace BurnOutSharp.ProtectionType
};
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -81,7 +81,7 @@ namespace BurnOutSharp.ProtectionType
new ContentMatchSet(new byte?[] { 0x73, 0x74, 0x78, 0x74, 0x33, 0x37, 0x31 }, Get320to4xVersion, "SafeDisc"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
/// <inheritdoc/>

View File

@@ -7,7 +7,7 @@ namespace BurnOutSharp.ProtectionType
public class SafeLock : IContentCheck, IPathCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -15,7 +15,7 @@ namespace BurnOutSharp.ProtectionType
new ContentMatchSet(new byte?[] { 0x53, 0x61, 0x66, 0x65, 0x4C, 0x6F, 0x63, 0x6B }, "SafeLock"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
/// <inheritdoc/>

View File

@@ -9,7 +9,7 @@ namespace BurnOutSharp.ProtectionType
public class SecuROM : IContentCheck, IPathCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -53,7 +53,7 @@ namespace BurnOutSharp.ProtectionType
new ContentMatchSet(new byte?[] { 0x2E, 0x63, 0x6D, 0x73, 0x5F, 0x64, 0x00 }, "SecuROM 1-3"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
/// <inheritdoc/>

View File

@@ -8,7 +8,7 @@ namespace BurnOutSharp.ProtectionType
public class SmartE : IContentCheck, IPathCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -16,7 +16,7 @@ namespace BurnOutSharp.ProtectionType
new ContentMatchSet(new byte?[] { 0x42, 0x49, 0x54, 0x41, 0x52, 0x54, 0x53 }, "SmartE"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
/// <inheritdoc/>

View File

@@ -20,7 +20,7 @@ namespace BurnOutSharp.ProtectionType
};
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -90,7 +90,7 @@ namespace BurnOutSharp.ProtectionType
}, "SolidShield"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
/// <inheritdoc/>

View File

@@ -8,7 +8,7 @@ namespace BurnOutSharp.ProtectionType
public class StarForce : IContentCheck, IPathCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -114,7 +114,7 @@ namespace BurnOutSharp.ProtectionType
}, "StarForce 5"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
/// <inheritdoc/>

View File

@@ -6,7 +6,7 @@ namespace BurnOutSharp.ProtectionType
public class Sysiphus : IContentCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -25,7 +25,7 @@ namespace BurnOutSharp.ProtectionType
}, GetVersion, "Sysiphus"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
public static string GetVersion(string file, byte[] fileContent, List<int> positions)

View File

@@ -11,7 +11,7 @@ namespace BurnOutSharp.ProtectionType
public class Tages : IContentCheck, IPathCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -36,7 +36,7 @@ namespace BurnOutSharp.ProtectionType
new ContentMatchSet(new byte?[] { 0xE8, 0x75, 0x00, 0x00, 0x00, 0xE8 }, GetVersion, "TAGES"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
/// <inheritdoc/>

View File

@@ -6,7 +6,7 @@ namespace BurnOutSharp.ProtectionType
public class ThreePLock : IContentCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -28,7 +28,7 @@ namespace BurnOutSharp.ProtectionType
// }, "3PLock"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
}
}

View File

@@ -6,7 +6,7 @@ namespace BurnOutSharp.ProtectionType
public class ThreeTwoOneStudios : IContentCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -22,7 +22,7 @@ namespace BurnOutSharp.ProtectionType
}, "321Studios Online Activation"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
}
}

View File

@@ -12,7 +12,7 @@ namespace BurnOutSharp.ProtectionType
public class VOBProtectCDDVD : IContentCheck, IPathCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -30,7 +30,7 @@ namespace BurnOutSharp.ProtectionType
new ContentMatchSet(new byte?[] { 0x2E, 0x76, 0x6F, 0x62, 0x2E, 0x70, 0x63, 0x64 }, "VOB ProtectCD"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
/// <inheritdoc/>

View File

@@ -7,7 +7,7 @@ namespace BurnOutSharp.ProtectionType
public class WTMCDProtect : IContentCheck, IPathCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -35,7 +35,7 @@ namespace BurnOutSharp.ProtectionType
}, "WTM Protection Viewer"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
/// <inheritdoc/>

View File

@@ -12,7 +12,7 @@ namespace BurnOutSharp.ProtectionType
public class XCP : IContentCheck, IPathCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -43,7 +43,7 @@ namespace BurnOutSharp.ProtectionType
}, "XCP"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
/// <inheritdoc/>

View File

@@ -6,7 +6,7 @@ namespace BurnOutSharp.ProtectionType
public class XtremeProtector : IContentCheck
{
/// <inheritdoc/>
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false)
{
var matchers = new List<ContentMatchSet>
{
@@ -14,7 +14,7 @@ namespace BurnOutSharp.ProtectionType
new ContentMatchSet(new byte?[] { 0x58, 0x50, 0x52, 0x4F, 0x54, 0x20, 0x20, 0x20 }, "Xtreme-Protector"),
};
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includePosition);
return MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
}
}
}

View File

@@ -17,10 +17,9 @@ namespace BurnOutSharp
public IProgress<ProtectionProgress> FileProgress { get; set; } = null;
/// <summary>
/// Determines whether the byte position of found protection is included or not
/// Determines if debug information is output or not
/// </summary>
/// TODO: Change this to a more generic debug flag for broader use
public bool IncludePosition { get; set; } = false;
public bool IncludeDebug { get; set; } = false;
/// <summary>
/// Determines whether all files are scanned or just executables are

View File

@@ -17,7 +17,7 @@ namespace Test
// Create scanner for all paths
var scanner = new Scanner(p)
{
IncludePosition = true,
IncludeDebug = true,
ScanAllFiles = false,
ScanArchives = true,
ScanPackers = true,