-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathPK2Config.cs
87 lines (76 loc) · 2.42 KB
/
PK2Config.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
namespace SlimPK2
{
public class PK2Config
{
#region Properties
/// <summary>
/// Gets or sets the mode.
/// </summary>
/// <value>
/// The mode.
/// </value>
public PK2Mode Mode { get; set; }
/// <summary>
/// Gets or sets the key.
/// </summary>
/// <value>
/// The key.
/// </value>
public string Key { get; set; }
/// <summary>
/// Gets or sets the base key.
/// </summary>
/// <value>
/// The base key.
/// </value>
public byte[] BaseKey { get; set; }
#endregion Properties
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="PK2Config"/> class.
/// </summary>
public PK2Config() { }
/// <summary>
/// Initializes a new instance of the <see cref="PK2Config" /> class.
/// </summary>
/// <param name="mode">The mode.</param>
/// <param name="key">The key.</param>
/// <param name="baseKey">The base key.</param>
public PK2Config(PK2Mode mode, string key, byte[] baseKey)
{
Mode = mode;
Key = key;
BaseKey = baseKey;
}
/// <summary>
/// Initializes a new instance of the <see cref="PK2Config" /> class.
/// </summary>
/// <param name="mode">The mode.</param>
/// <param name="key">The key.</param>
public PK2Config(PK2Mode mode, string key)
{
Mode = mode;
Key = key;
BaseKey = new byte[] { 0x03, 0xF8, 0xE4, 0x44, 0x88, 0x99, 0x3F, 0x64, 0xFE, 0x35 };
}
/// <summary>
/// Initializes a new instance of the <see cref="PK2Config" /> class.
/// </summary>
/// <param name="mode">The mode.</param>
public PK2Config(PK2Mode mode)
{
Mode = mode;
Key = "169841";
BaseKey = new byte[] { 0x03, 0xF8, 0xE4, 0x44, 0x88, 0x99, 0x3F, 0x64, 0xFE, 0x35 };
}
/// <summary>
/// Gets the default configuration.
/// </summary>
/// <returns></returns>
public static PK2Config GetDefault()
{
return new PK2Config(PK2Mode.Index, "169841", new byte[] { 0x03, 0xF8, 0xE4, 0x44, 0x88, 0x99, 0x3F, 0x64, 0xFE, 0x35 });
}
#endregion Constructor
}
}