2021-03-21 22:19:38 -07:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using BurnOutSharp.Matching;
|
|
|
|
|
|
|
|
|
|
|
|
namespace BurnOutSharp.ProtectionType
|
2019-09-27 23:52:24 -07:00
|
|
|
|
{
|
2021-02-26 01:26:49 -08:00
|
|
|
|
public class Sysiphus : IContentCheck
|
2019-09-27 23:52:24 -07:00
|
|
|
|
{
|
2021-07-17 23:40:16 -07:00
|
|
|
|
/// <inheritdoc/>
|
2021-08-25 19:37:32 -07:00
|
|
|
|
public List<ContentMatchSet> GetContentMatchSets()
|
2019-09-27 23:52:24 -07:00
|
|
|
|
{
|
2021-08-25 19:37:32 -07:00
|
|
|
|
return new List<ContentMatchSet>
|
2021-03-21 22:19:38 -07:00
|
|
|
|
{
|
2021-07-17 23:40:16 -07:00
|
|
|
|
// V SUHPISYSDVD
|
|
|
|
|
|
new ContentMatchSet(new byte?[]
|
|
|
|
|
|
{
|
|
|
|
|
|
0x56, 0x20, 0x53, 0x55, 0x48, 0x50, 0x49, 0x53,
|
|
|
|
|
|
0x59, 0x53, 0x44, 0x56, 0x44
|
|
|
|
|
|
}, GetVersion, "Sysiphus DVD"),
|
2019-09-27 23:52:24 -07:00
|
|
|
|
|
2021-07-17 23:40:16 -07:00
|
|
|
|
// V SUHPISYSDVD
|
|
|
|
|
|
new ContentMatchSet(new byte?[]
|
|
|
|
|
|
{
|
|
|
|
|
|
0x56, 0x20, 0x53, 0x55, 0x48, 0x50, 0x49, 0x53,
|
|
|
|
|
|
0x59, 0x53
|
|
|
|
|
|
}, GetVersion, "Sysiphus"),
|
|
|
|
|
|
};
|
2021-08-25 19:37:32 -07:00
|
|
|
|
}
|
2019-09-27 23:52:24 -07:00
|
|
|
|
|
2021-08-25 19:37:32 -07:00
|
|
|
|
/// <inheritdoc/>
|
2021-08-25 20:26:43 -07:00
|
|
|
|
public string CheckContents(string file, byte[] fileContent, bool includeDebug = false) => null;
|
2019-09-27 23:52:24 -07:00
|
|
|
|
|
2021-03-22 11:43:51 -07:00
|
|
|
|
public static string GetVersion(string file, byte[] fileContent, List<int> positions)
|
2019-09-27 23:52:24 -07:00
|
|
|
|
{
|
2021-03-22 11:43:51 -07:00
|
|
|
|
int index = positions[0] - 3;
|
2020-09-10 21:10:32 -07:00
|
|
|
|
char subVersion = (char)fileContent[index];
|
|
|
|
|
|
index++;
|
|
|
|
|
|
index++;
|
|
|
|
|
|
char version = (char)fileContent[index];
|
2019-09-27 23:52:24 -07:00
|
|
|
|
|
2020-09-10 21:10:32 -07:00
|
|
|
|
if (char.IsNumber(version) && char.IsNumber(subVersion))
|
|
|
|
|
|
return $"{version}.{subVersion}";
|
2021-03-22 16:25:40 -07:00
|
|
|
|
|
|
|
|
|
|
return string.Empty;
|
2019-09-27 23:52:24 -07:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|