-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWiiU_OTP.vb
209 lines (171 loc) · 6.25 KB
/
WiiU_OTP.vb
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
Imports System.IO
Imports System.Text
Public Class WiiU_OTP
'Wii keys
Private _Wii_Sha1 As String
Public ReadOnly Property Wii_Sha1() As String
Get
Return _Wii_Sha1
End Get
End Property
Private _Wii_common_key As String
Public ReadOnly Property Wii_common_key() As String
Get
Return _Wii_common_key
End Get
End Property
Private _wii_ng_id As String
Public ReadOnly Property wii_ng_id() As String
Get
Return _wii_ng_id
End Get
End Property
Private _wii_ng_priv_key As String
Public ReadOnly Property wii_ng_priv_key() As String
Get
Return _wii_ng_priv_key
End Get
End Property
Private _wii_nand_hmac As String
Public ReadOnly Property wii_nand_hmac() As String
Get
Return _wii_nand_hmac
End Get
End Property
Private _wii_nand_key As String
Public ReadOnly Property wii_nand_key() As String
Get
Return _wii_nand_key
End Get
End Property
Private _wii_rng_key As String
Public ReadOnly Property wii_rng_key() As String
Get
Return _wii_rng_key
End Get
End Property
Private _wii_root_cert_ms_id_0x00000002 As String
Public ReadOnly Property wii_root_cert_ms_id_0x00000002() As String
Get
Return _wii_root_cert_ms_id_0x00000002
End Get
End Property
Private _wii_root_cert_ms_id_0x00000001 As String
Public ReadOnly Property wii_root_cert_ms_id_0x00000001() As String
Get
Return _wii_root_cert_ms_id_0x00000001
End Get
End Property
Private _wii_root_cert_ng_key_id As String
Public ReadOnly Property wii_root_cert_ng_key_id() As String
Get
Return _wii_root_cert_ng_key_id
End Get
End Property
Private _wii_root_cert_ng_signature As String
Public ReadOnly Property wii_root_cert_ng_signature() As String
Get
Return _wii_root_cert_ng_signature
End Get
End Property
'WiiU keys
Private _wiiu_starbuck_ancast_key As String
Public ReadOnly Property wiiu_starbuck_ancast_key() As String
Get
Return _wiiu_starbuck_ancast_key
End Get
End Property
Private _vwii_common_key As String
Public ReadOnly Property vwii_common_key() As String
Get
Return _vwii_common_key
End Get
End Property
Private _wiiu_common_key As String
Public ReadOnly Property wiiu_common_key() As String
Get
Return _wiiu_common_key
End Get
End Property
Private _usb_storage_key_seed_encryption_key As String
Public ReadOnly Property usb_storage_key_seed_encryption_key() As String
Get
Return _usb_storage_key_seed_encryption_key
End Get
End Property
Private _encrypt_decrypt_shdd_key As String
Public ReadOnly Property encrypt_decrypt_shdd_key() As String
Get
Return _encrypt_decrypt_shdd_key
End Get
End Property
Private _encryption_key_for_drh_wlan_data As String
Public ReadOnly Property encryption_key_for_drh_wlan_data() As String
Get
Return _encryption_key_for_drh_wlan_data
End Get
End Property
Private _encrypt_decrypt_ssl_rsa_key As String
Public ReadOnly Property encrypt_decrypt_ssl_rsa_key() As String
Get
Return _encrypt_decrypt_ssl_rsa_key
End Get
End Property
Private _otp_version_and_revision As String
Public ReadOnly Property otp_version_and_revision() As String
Get
Return _otp_version_and_revision
End Get
End Property
Private _otp_date_code As String
Public ReadOnly Property otp_date_code() As String
Get
Return _otp_date_code
End Get
End Property
Public Sub New(ByVal Filename As String)
Using er = New BinaryReader(File.OpenRead(Filename))
_Wii_Sha1 = Bytes_To_String(er.ReadBytes(20))
er.BaseStream.Position = &H14
_Wii_common_key = Bytes_To_String(er.ReadBytes(16))
er.BaseStream.Position = &H24
_wii_ng_id = Bytes_To_String(er.ReadBytes(4))
_wii_ng_priv_key = Bytes_To_String(er.ReadBytes(29))
er.BaseStream.Position = &H44
_wii_nand_hmac = Bytes_To_String(er.ReadBytes(20))
er.BaseStream.Position = &H58
_wii_nand_key = Bytes_To_String(er.ReadBytes(16))
er.BaseStream.Position = &H68
_wii_rng_key = Bytes_To_String(er.ReadBytes(16))
er.BaseStream.Position = &H300
_wii_root_cert_ms_id_0x00000002 = Bytes_To_String(er.ReadBytes(4))
_wii_root_cert_ms_id_0x00000001 = Bytes_To_String(er.ReadBytes(4))
_wii_root_cert_ng_key_id = Bytes_To_String(er.ReadBytes(4))
_wii_root_cert_ng_signature = Bytes_To_String(er.ReadBytes(60))
er.BaseStream.Position = &H120
_encrypt_decrypt_ssl_rsa_key = Bytes_To_String(er.ReadBytes(60))
er.BaseStream.Position = &H90
_wiiu_starbuck_ancast_key = Bytes_To_String(er.ReadBytes(16))
er.BaseStream.Position = &HD0
_vwii_common_key = Bytes_To_String(er.ReadBytes(16))
er.BaseStream.Position = &HE0
_wiiu_common_key = Bytes_To_String(er.ReadBytes(16))
er.BaseStream.Position = &H130
_usb_storage_key_seed_encryption_key = Bytes_To_String(er.ReadBytes(16))
er.BaseStream.Position = &H190
_encrypt_decrypt_shdd_key = Bytes_To_String(er.ReadBytes(16))
er.BaseStream.Position = &H1A0
_encryption_key_for_drh_wlan_data = Bytes_To_String(er.ReadBytes(16))
er.BaseStream.Position = &H3E4
_otp_version_and_revision = Bytes_To_String(er.ReadBytes(4))
_otp_date_code = Bytes_To_String(er.ReadBytes(4))
End Using
End Sub
Private Function Bytes_To_String(ByVal bytes_Input As Byte()) As String
Dim strTemp As New StringBuilder(bytes_Input.Length * 2)
For Each b As Byte In bytes_Input
strTemp.Append(b.ToString("X02"))
Next
Return strTemp.ToString()
End Function
End Class