2021-03-21 14:30:37 -07:00
|
|
|
|
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;
|
2021-03-21 14:30:37 -07:00
|
|
|
|
|
2023-03-09 23:19:27 -05:00
|
|
|
|
namespace BinaryObjectScanner.Protection
|
2019-09-27 23:52:24 -07:00
|
|
|
|
{
|
2021-02-26 01:26:49 -08:00
|
|
|
|
public class PSXAntiModchip : IContentCheck
|
2019-09-27 23:52:24 -07:00
|
|
|
|
{
|
2022-03-08 22:33:39 -08:00
|
|
|
|
// TODO: Figure out PSX binary header so this can be checked explicitly.
|
|
|
|
|
|
// For now, this means that the CheckContents check is redundant for external
|
|
|
|
|
|
// use through other programs
|
2021-02-26 01:26:49 -08:00
|
|
|
|
/// <inheritdoc/>
|
2022-05-01 17:17:15 -07:00
|
|
|
|
public string CheckContents(string file, byte[] fileContent, bool includeDebug)
|
2019-09-27 23:52:24 -07:00
|
|
|
|
{
|
2021-09-01 23:12:16 -07:00
|
|
|
|
// TODO: Detect Red Hand protection
|
2022-03-08 22:33:39 -08:00
|
|
|
|
var contentMatchSets = new List<ContentMatchSet>
|
2021-07-17 23:40:16 -07:00
|
|
|
|
{
|
|
|
|
|
|
// SOFTWARE TERMINATED\nCONSOLE MAY HAVE BEEN MODIFIED\n CALL 1-888-780-7690
|
|
|
|
|
|
new ContentMatchSet(new byte?[]
|
|
|
|
|
|
{
|
|
|
|
|
|
0x20, 0x20, 0x20, 0x20, 0x20, 0x53, 0x4F, 0x46,
|
|
|
|
|
|
0x54, 0x57, 0x41, 0x52, 0x45, 0x20, 0x54, 0x45,
|
|
|
|
|
|
0x52, 0x4D, 0x49, 0x4E, 0x41, 0x54, 0x45, 0x44,
|
|
|
|
|
|
0x5C, 0x6E, 0x43, 0x4F, 0x4E, 0x53, 0x4F, 0x4C,
|
|
|
|
|
|
0x45, 0x20, 0x4D, 0x41, 0x59, 0x20, 0x48, 0x41,
|
|
|
|
|
|
0x56, 0x45, 0x20, 0x42, 0x45, 0x45, 0x4E, 0x20,
|
|
|
|
|
|
0x4D, 0x4F, 0x44, 0x49, 0x46, 0x49, 0x45, 0x44,
|
|
|
|
|
|
0x5C, 0x6E, 0x20, 0x20, 0x20, 0x20, 0x20, 0x43,
|
|
|
|
|
|
0x41, 0x4C, 0x4C, 0x20, 0x31, 0x2D, 0x38, 0x38,
|
|
|
|
|
|
0x38, 0x2D, 0x37, 0x38, 0x30, 0x2D, 0x37, 0x36,
|
|
|
|
|
|
0x39, 0x30
|
|
|
|
|
|
}, "PlayStation Anti-modchip (English)"),
|
|
|
|
|
|
|
|
|
|
|
|
// 強制終了しました。\n本体が改造されている\nおそれがあります。
|
|
|
|
|
|
new ContentMatchSet(new byte?[]
|
|
|
|
|
|
{
|
|
|
|
|
|
0x5F, 0x37, 0x52, 0x36, 0x7D, 0x42, 0x4E, 0x86,
|
|
|
|
|
|
0x30, 0x57, 0x30, 0x7E, 0x30, 0x57, 0x30, 0x5F,
|
|
|
|
|
|
0x30, 0x02, 0x5C, 0x6E, 0x67, 0x2C, 0x4F, 0x53,
|
|
|
|
|
|
0x30, 0x4C, 0x65, 0x39, 0x90, 0x20, 0x30, 0x55,
|
|
|
|
|
|
0x30, 0x8C, 0x30, 0x66, 0x30, 0x44, 0x30, 0x8B,
|
|
|
|
|
|
0x5C, 0x6E, 0x30, 0x4A, 0x30, 0x5D, 0x30, 0x8C,
|
|
|
|
|
|
0x30, 0x4C, 0x30, 0x42, 0x30, 0x8A, 0x30, 0x7E,
|
|
|
|
|
|
0x30, 0x59, 0x30, 0x02
|
|
|
|
|
|
}, "PlayStation Anti-modchip (Japanese)"),
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2022-03-08 22:33:39 -08:00
|
|
|
|
return MatchUtil.GetFirstMatch(file, fileContent, contentMatchSets, includeDebug);
|
2021-09-01 23:12:16 -07:00
|
|
|
|
}
|
2019-09-27 23:52:24 -07:00
|
|
|
|
}
|
|
|
|
|
|
}
|