-
Notifications
You must be signed in to change notification settings - Fork 1
/
IdentifyIPSW.vb
409 lines (364 loc) · 15.2 KB
/
IdentifyIPSW.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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
Imports System.Security.Cryptography
Imports System.IO
Imports System.Text
Imports System.Threading
Imports System.Windows.Forms
Imports System.Management
Public Class IdentifyIPSW
Public MD51 As Boolean = False
Public ipswhash As String
Private WithEvents get_MD5 As System.ComponentModel.BackgroundWorker
Public Sub get_MD5_hash(ByVal sender As Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles get_MD5.DoWork
'MD5 hash provider for computing the hash of the file
Dim md5 As New MD5CryptoServiceProvider()
'open the file
Dim stream As New FileStream(ipsw, FileMode.Open, FileAccess.Read, FileShare.Read, 8192)
'calculate the files hash
md5.ComputeHash(stream)
'close our stream
stream.Close()
'byte array of files hash
Dim hash As Byte() = md5.Hash
'string builder to hold the results
Dim sb As New StringBuilder()
'loop through each byte in the byte array
For Each b As Byte In hash
'format each byte into the proper value and append
'current value to return value
sb.Append(String.Format("{0:X2}", b))
Next
'return the MD5 hash of the file
ipswhash = sb.ToString.ToLower
End Sub
Private Sub get_md5_RunWorkerCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles get_MD5.RunWorkerCompleted
MDIMain.MenuStrip1.Enabled = True
Back.Enabled = True
If ipswhash = "cf6d93fffdc60dcca487a80004d250fa" Then
IPSWVersion = "3.2.2"
IPSWvers.Text = "3.2.2 IPSW Verified!"
ihelper.Text = "iPad"
ihelper.Left = (Me.Width / 2) - (ihelper.Width / 2)
iPhoneModel = "iPad"
Status.Show()
Status.Image = My.Resources.reflectionImage2
statuslabelgood.Show()
Statuslabelbad.Hide()
Button1.Enabled = False
Button1.Text = "Done!"
arrow.Image = My.Resources.Arrow
arrow.Enabled = True
PictureBox1.Image = My.Resources.ipad
UseComexsAwesomeKernelExploit = True
RootFSsize = 1024
' iDevWARN.Show()
' iDevWARN.BringToFront()
ElseIf ipswhash = "8cc589baad3c80dd8324c37d7dc00750" Then
IPSWVersion = "4.1"
IPSWvers.Text = "4.1 IPSW Verified!"
ihelper.Text = "iPhone 3G"
ihelper.Left = (Me.Width / 2) - (ihelper.Width / 2)
iPhoneModel = "iPhone 3G"
Status.Show()
Status.Image = My.Resources.reflectionImage2
statuslabelgood.Show()
Statuslabelbad.Hide()
Button1.Enabled = False
Button1.Text = "Done!"
arrow.Image = My.Resources.Arrow
arrow.Enabled = True
PictureBox1.Image = My.Resources.iPhone3G
UseComexsAwesomeKernelExploit = True
This3GSisold = True
ThisiPodisMB = True
RootFSsize = 800
ElseIf ipswhash = "9f8a1978f053ec96926e535bb57ac171" Then
IPSWVersion = "4.1"
IPSWvers.Text = "4.1 IPSW Verified!"
ihelper.Text = "iPod Touch 2G"
ihelper.Left = (Me.Width / 2) - (ihelper.Width / 2)
iPhoneModel = "iPod Touch 2G"
Status.Show()
Status.Image = My.Resources.reflectionImage2
statuslabelgood.Show()
Statuslabelbad.Hide()
Button1.Enabled = False
Button1.Text = "Done!"
arrow.Image = My.Resources.Arrow
arrow.Enabled = True
PictureBox1.Image = My.Resources.iPod2G
UseComexsAwesomeKernelExploit = True
'iDevWARN.Show()
'iDevWARN.BringToFront()
RootFSsize = 800
ElseIf ipswhash = "f3877c6f309730ee31297a06c7a9e82c" Then
IPSWVersion = "4.1"
IPSWvers.Text = "4.1 IPSW Verified!"
ihelper.Text = "iPod Touch 3G"
ihelper.Left = (Me.Width / 2) - (ihelper.Width / 2)
iPhoneModel = "iPod Touch 3G"
Status.Show()
Status.Image = My.Resources.reflectionImage2
statuslabelgood.Show()
Statuslabelbad.Hide()
Button1.Enabled = False
Button1.Text = "Done!"
arrow.Image = My.Resources.Arrow
arrow.Enabled = True
PictureBox1.Image = My.Resources.ipt3
UseComexsAwesomeKernelExploit = True
'iDevWARN.Show()
'iDevWARN.BringToFront()
RootFSsize = 820
ElseIf ipswhash = "2e634d16d0e01ef70070c9a289e488ca" Then
IPSWVersion = "4.1"
IPSWvers.Text = "4.1 (8B117) IPSW Verified!"
ihelper.Text = "iPod Touch 4"
ihelper.Left = (Me.Width / 2) - (ihelper.Width / 2)
iPhoneModel = "iPod Touch 4"
Status.Show()
Status.Image = My.Resources.reflectionImage2
statuslabelgood.Show()
Statuslabelbad.Hide()
Button1.Enabled = False
Button1.Text = "Done!"
arrow.Image = My.Resources.Arrow
arrow.Enabled = True
PictureBox1.Image = My.Resources.ipt4
UseComexsAwesomeKernelExploit = True
'iDevWARN.Show()
'iDevWARN.BringToFront()
RootFSsize = 820
ElseIf ipswhash = "0564fcd3f53dd6262b9eb636b7fbe540" Then
IPSWVersion = "4.1-2"
IPSWvers.Text = "4.1 (8B118) IPSW Verified!"
ihelper.Text = "iPod Touch 4"
ihelper.Left = (Me.Width / 2) - (ihelper.Width / 2)
iPhoneModel = "iPod Touch 4"
Status.Show()
Status.Image = My.Resources.reflectionImage2
statuslabelgood.Show()
Statuslabelbad.Hide()
Button1.Enabled = False
Button1.Text = "Done!"
arrow.Image = My.Resources.Arrow
arrow.Enabled = True
PictureBox1.Image = My.Resources.ipt4
UseComexsAwesomeKernelExploit = True
'iDevWARN.Show()
'iDevWARN.BringToFront()
RootFSsize = 820
ElseIf ipswhash = "e07bee3c03e7a18e5d75fcaa23db17b5" Then
IPSWVersion = "4.1"
IPSWvers.Text = "4.1 IPSW Verified!"
ihelper.Text = "iPhone 3GS"
ihelper.Left = (Me.Width / 2) - (ihelper.Width / 2)
iPhoneModel = "iPhone 3GS"
Status.Show()
Status.Image = My.Resources.reflectionImage2
statuslabelgood.Show()
Statuslabelbad.Hide()
Button1.Enabled = False
Button1.Text = "Done!"
arrow.Image = My.Resources.Arrow
arrow.Enabled = True
PictureBox1.Image = My.Resources.iPhone3GS
UseComexsAwesomeKernelExploit = True
'iDevWARN.Show()
'iDevWARN.BringToFront()
RootFSsize = 820
ElseIf ipswhash = "ac3031a7b5c013d6a09952b691985878" Then
IPSWVersion = "4.1"
IPSWvers.Text = "4.1 IPSW Verified!"
ihelper.Text = "iPhone 4"
ihelper.Left = (Me.Width / 2) - (ihelper.Width / 2)
iPhoneModel = "iPhone 4"
Status.Show()
Status.Image = My.Resources.reflectionImage2
statuslabelgood.Show()
Statuslabelbad.Hide()
Button1.Enabled = False
Button1.Text = "Done!"
arrow.Image = My.Resources.Arrow
arrow.Enabled = True
PictureBox1.Image = My.Resources.i4
UseComexsAwesomeKernelExploit = True
'iDevWARN.Show()
'iDevWARN.BringToFront()
RootFSsize = 850
ElseIf ipswhash = "35c8ab4b7e70ab0e47e2f5981e52ba55" Then
IPSWVersion = "4.1"
IPSWvers.Text = "4.1 IPSW Verified!"
ihelper.Text = "Apple TV 2"
ihelper.Left = (Me.Width / 2) - (ihelper.Width / 2)
iPhoneModel = "Apple TV 2"
Status.Show()
Status.Image = My.Resources.reflectionImage2
statuslabelgood.Show()
Statuslabelbad.Hide()
Button1.Enabled = False
Button1.Text = "Done!"
arrow.Image = My.Resources.Arrow
arrow.Enabled = True
PictureBox1.Image = My.Resources.atv2
UseComexsAwesomeKernelExploit = True
RootFSsize = 800
'iDevWARN.Show()
'iDevWARN.BringToFront()
Else
Status.Show()
Status.Image = My.Resources.X
Statuslabelbad.Show()
statuslabelgood.Hide()
Label1.Visible = True
PictureBox2.Visible = False
End If
Button1.Visible = True
Label2.Visible = False
PictureBox2.Visible = False
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
Status.Hide()
Statuslabelbad.Hide()
iDevLoaded = False
ipsw = ""
ipsw = FileOpenDialog("*.ipsw", "Desktop")
If ipsw <> "" Then
'save form position for progress form
'
ProgressTop = MDIMain.Top
ProgressLeft = MDIMain.Left
Back.Enabled = False
MDIMain.MenuStrip1.Enabled = False
get_MD5 = New System.ComponentModel.BackgroundWorker
get_MD5.WorkerReportsProgress = True
get_MD5.WorkerSupportsCancellation = True
get_MD5.RunWorkerAsync()
Label2.Visible = True
Label1.Visible = False
Button1.Visible = False
PictureBox2.Visible = True
'ipswhash = getFilesMD5Hash(ipsw)
End If
Catch Ex As Exception
MsgBox(Err.Description)
End Try
End Sub
Private Sub eForm4_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
MDIMain.MenuStrip1.Enabled = True
PictureBox2.Visible = False
Label2.Visible = False
Button1.Visible = True
Label1.Visible = True
iPhoneModel = ""
IPSWvers.Text = ""
Status.Hide()
Statuslabelbad.Hide()
statuslabelgood.Hide()
ihelper.Left = (Me.Width / 2) - (ihelper.Width / 2)
End Sub
Public Function getFilesMD5Hash(ByVal file As String) As String
'MD5 hash provider for computing the hash of the file
Dim md5 As New MD5CryptoServiceProvider()
'open the file
Dim stream As New FileStream(file, FileMode.Open, FileAccess.Read, FileShare.Read, 8192)
'calculate the files hash
md5.ComputeHash(stream)
'close our stream
stream.Close()
'byte array of files hash
Dim hash As Byte() = md5.Hash
'string builder to hold the results
Dim sb As New StringBuilder()
'loop through each byte in the byte array
For Each b As Byte In hash
'format each byte into the proper value and append
'current value to return value
sb.Append(String.Format("{0:X2}", b))
Next
'return the MD5 hash of the file
Return sb.ToString.ToLower()
iDevLoaded = True
End Function
Private Function FileOpenDialog(ByVal strExtension As String, ByVal strInitDir As String) As String
Dim oFileDialog As New System.Windows.Forms.OpenFileDialog()
Dim strfilter As String = BuildFilter(strExtension)
FileOpenDialog = ""
With oFileDialog
.Filter = "iPhone/iPod Software File (*.ipsw) |*.ipsw;"
.DefaultExt = strExtension
.InitialDirectory = strInitDir
.ShowDialog()
If Windows.Forms.DialogResult.OK Then
FileOpenDialog = .FileName
ElseIf Windows.Forms.DialogResult.Cancel Then
End If
End With
End Function
Private Function BuildFilter(ByVal strExtension As String) As String
BuildFilter = ""
If strExtension.PadLeft(1) <> "." Then
BuildFilter = "(*." & strExtension & ")|" & "*." & strExtension
ElseIf strExtension.PadLeft(1) = "." Then
BuildFilter = "(*" & strExtension & ")|" & "*" & strExtension
End If
End Function
Private Sub logo2_MouseEnter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles logo2.MouseEnter
logo2.Image = My.Resources.Flakeselect
End Sub
Private Sub logo2_MouseLeave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles logo2.MouseLeave
logo2.Image = My.Resources.Flake
End Sub
Private Sub AboutToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
About.ShowDialog()
End Sub
Private Sub arrow_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Expert.MdiParent = MDIMain
Expert.Show()
Me.Close()
End Sub
Private Sub ihelper_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ihelper.TextChanged
ihelper.Left = (Me.Width / 2) - (ihelper.Width / 2)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Expert.MdiParent = MDIMain
Expert.Show()
Me.Close()
End Sub
Private Sub Back_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Back.Click
Form1.MdiParent = MDIMain
Form1.Show()
Form1.Enabled = True
Me.Dispose()
End Sub
Private Sub Back_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Back.MouseDown
Back.Image = My.Resources.CancelClicked
End Sub
Private Sub Back_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles Back.MouseEnter
Back.Image = My.Resources.CancelClicked
End Sub
Private Sub Back_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles Back.MouseLeave
Back.Image = My.Resources.Cancel
End Sub
Private Sub Back_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Back.MouseUp
Back.Image = My.Resources.Cancel
End Sub
Private Sub arrow_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles arrow.Click
PartitionSize = RootFSsize
Form2.MdiParent = MDIMain
Form2.Show()
Me.Close()
End Sub
Private Sub arrow_MouseEnter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles arrow.MouseEnter
arrow.Image = My.Resources.Arrowhilite
End Sub
Private Sub arrow_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles arrow.MouseDown
arrow.Image = My.Resources.arrowpress
End Sub
Private Sub arrow_MouseLeave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles arrow.MouseLeave
arrow.Image = My.Resources.Arrow
End Sub
Private Sub arrow_MouseUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles arrow.MouseUp
arrow.Image = My.Resources.Arrowhilite
End Sub
End Class