Clean up StarForce; add notes

This commit is contained in:
Matt Nadareski
2021-09-10 22:15:49 -07:00
parent 09854b469e
commit 9e73d8762e

View File

@@ -45,41 +45,7 @@ namespace BurnOutSharp.ProtectionType
0x64, 0x00, 0x20, 0x00, 0x4d, 0x00, 0x6f, 0x00,
0x64, 0x00, 0x75, 0x00, 0x6c, 0x00, 0x65, 0x00
}, start: sectionAddr, end: sectionEnd),
"StarForce 5"),
// TODO: Confirm that these additonal checks do anything
// new ContentMatchSet(new List<ContentMatch>
// {
// // P + (char)0x00 + r + (char)0x00 + o + (char)0x00 + t + (char)0x00 + e + (char)0x00 + c + (char)0x00 + t + (char)0x00 + i + (char)0x00 + o + (char)0x00 + n + (char)0x00 + + (char)0x00 + T + (char)0x00 + e + (char)0x00 + c + (char)0x00 + h + (char)0x00 + n + (char)0x00 + o + (char)0x00 + l + (char)0x00 + o + (char)0x00 + g + (char)0x00 + y + (char)0x00
// new ContentMatch(new byte?[]
// {
// 0x50, 0x00, 0x72, 0x00, 0x6F, 0x00, 0x74, 0x00,
// 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x69, 0x00,
// 0x6F, 0x00, 0x6E, 0x00, 0x20, 0x00, 0x54, 0x00,
// 0x65, 0x00, 0x63, 0x00, 0x68, 0x00, 0x6E, 0x00,
// 0x6F, 0x00, 0x6C, 0x00, 0x6F, 0x00, 0x67, 0x00,
// 0x79, 0x00
// }, start: sectionAddr, end: sectionEnd),
// // // PSA_GetDiscLabel
// // new ContentMatch(new byte?[]
// // {
// // 0x50, 0x53, 0x41, 0x5F, 0x47, 0x65, 0x74, 0x44,
// // 0x69, 0x73, 0x63, 0x4C, 0x61, 0x62, 0x65, 0x6C
// // }, start: sectionAddr, end: sectionEnd),
// // (c) Protection Technology
// // new ContentMatch(new byte?[]
// // {
// // 0x28, 0x63, 0x29, 0x20, 0x50, 0x72, 0x6F, 0x74,
// // 0x65, 0x63, 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x54,
// // 0x65, 0x63, 0x68, 0x6E, 0x6F, 0x6C, 0x6F, 0x67,
// // 0x79
// // }, start: sectionAddr, end: sectionEnd),
// // TradeName
// new ContentMatch(new byte?[] { 0x54, 0x72, 0x61, 0x64, 0x65, 0x4E, 0x61, 0x6D, 0x65 }, start: sectionAddr, end: sectionEnd),
// }, GetVersion, "StarForce"),
"StarForce 5 [Protected Module]"),
};
string match = MatchUtil.GetFirstMatch(file, fileContent, matchers, includeDebug);
@@ -126,7 +92,40 @@ namespace BurnOutSharp.ProtectionType
// return MatchUtil.GetFirstMatch(path, matchers, any: true);
return null;
}
// This section contains extraneous checks in the .rsrc section that have not been confirmed
// new ContentMatchSet(new List<ContentMatch>
// {
// // P + (char)0x00 + r + (char)0x00 + o + (char)0x00 + t + (char)0x00 + e + (char)0x00 + c + (char)0x00 + t + (char)0x00 + i + (char)0x00 + o + (char)0x00 + n + (char)0x00 + + (char)0x00 + T + (char)0x00 + e + (char)0x00 + c + (char)0x00 + h + (char)0x00 + n + (char)0x00 + o + (char)0x00 + l + (char)0x00 + o + (char)0x00 + g + (char)0x00 + y + (char)0x00
// new ContentMatch(new byte?[]
// {
// 0x50, 0x00, 0x72, 0x00, 0x6F, 0x00, 0x74, 0x00,
// 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x69, 0x00,
// 0x6F, 0x00, 0x6E, 0x00, 0x20, 0x00, 0x54, 0x00,
// 0x65, 0x00, 0x63, 0x00, 0x68, 0x00, 0x6E, 0x00,
// 0x6F, 0x00, 0x6C, 0x00, 0x6F, 0x00, 0x67, 0x00,
// 0x79, 0x00
// }, start: sectionAddr, end: sectionEnd),
// // // PSA_GetDiscLabel
// // new ContentMatch(new byte?[]
// // {
// // 0x50, 0x53, 0x41, 0x5F, 0x47, 0x65, 0x74, 0x44,
// // 0x69, 0x73, 0x63, 0x4C, 0x61, 0x62, 0x65, 0x6C
// // }, start: sectionAddr, end: sectionEnd),
// // (c) Protection Technology
// // new ContentMatch(new byte?[]
// // {
// // 0x28, 0x63, 0x29, 0x20, 0x50, 0x72, 0x6F, 0x74,
// // 0x65, 0x63, 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x54,
// // 0x65, 0x63, 0x68, 0x6E, 0x6F, 0x6C, 0x6F, 0x67,
// // 0x79
// // }, start: sectionAddr, end: sectionEnd),
// // TradeName
// new ContentMatch(new byte?[] { 0x54, 0x72, 0x61, 0x64, 0x65, 0x4E, 0x61, 0x6D, 0x65 }, start: sectionAddr, end: sectionEnd),
// }, GetVersion, "StarForce"),
// public static string GetVersion(string file, byte[] fileContent, List<int> positions)
// {
// return $"{Utilities.GetFileVersion(fileContent)} ({fileContent.Skip(positions[1] + 22).TakeWhile(c => c != 0x00)})";