-
Notifications
You must be signed in to change notification settings - Fork 28
/
DFU.vb
824 lines (775 loc) · 29.2 KB
/
DFU.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
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
Imports System
Imports System.Management
Imports System.Threading
Imports System.IO
Imports System.IO.Ports
Public Class DFU
Dim TimeRemaining As Int32 = 0
Dim ExitCountDown As Boolean = False
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
MDIMain.MenuStrip1.Enabled = True
Dim Killer As String
Killer = "cmd /c taskkill /f /t /im iREB.exe"
Shell(Killer)
PictureBox4.Enabled = False
BackgroundWorker1.CancelAsync()
Call SetMdiClientBorder(False)
'extract required dll's to app folder
'If File_Exists(My.Application.Info.DirectoryPath & "\Ionic.Zip.dll") = False Then SaveToDisk("Ionic.Zip.dll", My.Application.Info.DirectoryPath & "\Ionic.Zip.dll")
'create temp folders
tempPath2 = System.Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) & "\Temp"
tempPath2 = tempPath2 & "\sn0wbreeze-iREB"
tempPath = System.Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) & "\Temp"
tempPath = tempPath & "\sn0wbreeze"
Folder_Delete(tempPath)
Folder_Delete(tempPath2)
Create_Directory(tempPath)
'Create_Directory(tempPath & "\debsCustom\private\var\root\Media\Cydia\AutoInstall")
Create_Directory(tempPath & "\debsCustom")
Create_Directory(tempPath & "\repos")
Create_Directory(tempPath2)
Form1.MdiParent = MDIMain
Credits.MdiParent = MDIMain
Form1.Show()
About.MdiParent = MDIMain
About.Show()
Form1.Enabled = False
About.BringToFront()
Me.Dispose()
End Sub
Private Sub DFU_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
MdiParent = MDIMain
KilliTunes()
ProgressBar1.Visible = False
Label1.Text = "DFU Pwner [greenpois0n]"
Label1.Left = (Me.Width / 2) - (Label1.Width / 2)
Label4.Left = (Me.Width / 2) - (Label4.Width / 2)
If PreviousModel = "Apple TV 2" Then
Call LoadATV2()
Else
atv2.Visible = False
End If
End Sub
Public Sub LoadATV2()
PictureBox1.Visible = False
Label4.Text = "Plug in your Apple TV via USB"
Label4.Left = (Me.Width / 2) - (Label4.Width / 2)
End Sub
Public Sub KilliTunes()
' Shell("cmd /c taskkill /f /t /im iTunes.exe", AppWinStyle.Hide)
' Shell("cmd /c taskkill /f /t /im iTunesHelper.exe", AppWinStyle.Hide)
End Sub
Public Sub GoGoGadgetiREB()
KilliTunes()
PictureBox6.Visible = False
ProgressBar1.Visible = True
Button2.Enabled = False
RichTextBox1.Visible = False
Label4.Text = ""
Label4.Left = (Me.Width / 2) - (Label4.Width / 2)
Label1.Text = "Running iREB..."
Label1.Left = (Me.Width / 2) - (Label1.Width / 2)
PictureBox1.Visible = True
PictureBox1.Image = My.Resources.runningireb
'Shutting Down iTunes... - Start
Dim Kill3 As String
Kill3 = "cmd /c taskkill /f /t /im iREB.exe"
'Shutting Down iTunes... - Done
'
'Calling upon the forces of iREB...
Dim GoGoGadgetLoader As String
SaveToDisk("s-irecovery.exe", tempPath2 & "\pois0n.exe")
cmdline = Quotation & tempPath2 & "\pois0n.exe" & Quotation & " -e"
ProgressBarL.RunWorkerAsync()
ExecCmd(cmdline, True)
MsgBox("Your device is now in a PWNED DFU state (black screen)." & Chr(13) & Chr(13) & "You may now launch iTunes and do SHIFT + Restore" & Chr(13) & "to the custom sn0wbreeze IPSW located on your desktop!" & Chr(13) & Chr(13) & "Note: If you get Error 2003 in iTunes after Extracting," & Chr(13) & "Just unplug/replug it in and do it again.", MsgBoxStyle.Information)
ProgressBar1.Visible = False
ProgressBar1.Value = 0
PictureBox4.Enabled = False
Call SetMdiClientBorder(False)
'extract required dll's to app folder
'If File_Exists(My.Application.Info.DirectoryPath & "\Ionic.Zip.dll") = False Then SaveToDisk("Ionic.Zip.dll", My.Application.Info.DirectoryPath & "\Ionic.Zip.dll")
iPhoneModel = ""
'create temp folders
tempPath2 = System.Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) & "\Temp"
tempPath2 = tempPath2 & "\sn0wbreeze-iREB"
tempPath = System.Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) & "\Temp"
tempPath = tempPath & "\sn0wbreeze"
Folder_Delete(tempPath)
Folder_Delete(tempPath2)
Create_Directory(tempPath)
'Create_Directory(tempPath & "\debsCustom\private\var\root\Media\Cydia\AutoInstall")
Create_Directory(tempPath & "\debsCustom")
Create_Directory(tempPath & "\repos")
Create_Directory(tempPath2)
Form1.MdiParent = MDIMain
Credits.MdiParent = MDIMain
Form1.Show()
About.MdiParent = MDIMain
About.Show()
Form1.Enabled = False
About.BringToFront()
Me.Dispose()
End Sub
Function HighlightWords(ByVal rtb As RichTextBox, ByVal sFindString As String, ByVal lColor As System.Drawing.Color) As Int32
Dim iFoundPos As Int32 'Position of first character of match
Dim iFindLength As Int32 'Length of string to find
Dim iOriginalSelStart As Int32
Dim iOriginalSelLength As Int32
Dim iMatchCount As Int32 'Number of matches
'Save the insertion points current location and length
iOriginalSelStart = rtb.SelectionStart
iOriginalSelLength = rtb.SelectionLength
'Cache the length of the string to find
iFindLength = Len(sFindString)
'Attempt to find the first match
iFoundPos = rtb.Find(sFindString, 0, RichTextBoxFinds.NoHighlight)
While iFoundPos > 0
iMatchCount = iMatchCount + 1
iFoundPos = rtb.Find("THIS SHOULD NOT RETURN ANYTHIN---3$#@$#%@$#@!$@#$#@$@!#$!@#$!@$234-AND I MEAN IT!!!#@!$!%&*()(*&^%$#@!", iFoundPos + iFindLength, RichTextBoxFinds.NoHighlight)
End While
'Restore the insertion point to its original location and length
rtb.SelectionStart = iOriginalSelStart
rtb.SelectionLength = iOriginalSelLength
'Return the number of matches
HighlightWords = iMatchCount
End Function
Public Sub DoSearch2()
BackgroundWorker1.RunWorkerAsync()
BackgroundWorker1 = New System.ComponentModel.BackgroundWorker
BackgroundWorker1.WorkerReportsProgress = True
BackgroundWorker1.WorkerSupportsCancellation = True
End Sub
Private Sub DFU_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
PictureBox4.Enabled = False
End Sub
Sub Delay(ByVal dblSecs As Double)
Const OneSec As Double = 1.0# / (1440.0# * 60.0#)
Dim dblWaitTil As Date
Now.AddSeconds(OneSec)
dblWaitTil = Now.AddSeconds(OneSec).AddSeconds(dblSecs)
Do Until Now > dblWaitTil
Application.DoEvents() ' Allow windows messages to be processed
Loop
End Sub
Private Sub PictureBox4_MouseEnter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox4.MouseEnter
PictureBox4.Image = My.Resources.start_button_over
End Sub
Private Sub PictureBox4_MouseLeave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox4.MouseLeave
PictureBox4.Image = My.Resources.start_button_black
End Sub
Public Sub ATV2DFU()
PictureBox1.Visible = False
PictureBox6.Visible = True
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
Label4.Text = "Prepare to Press Menu + Play/Pause (5)"
Label4.Left = (Me.Width / 2) - (Label4.Width / 2)
PictureBox6.Image = My.Resources.remote_self
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
Label4.Text = "Prepare to Press Menu + Play/Pause (4)"
Label4.Left = (Me.Width / 2) - (Label4.Width / 2)
PictureBox6.Image = My.Resources.remote_self
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
Label4.Text = "Prepare to Press Menu + Play/Pause (3)"
Label4.Left = (Me.Width / 2) - (Label4.Width / 2)
PictureBox6.Image = My.Resources.remote_self
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
Label4.Text = "Prepare to Press Menu + Play/Pause (2)"
Label4.Left = (Me.Width / 2) - (Label4.Width / 2)
PictureBox6.Image = My.Resources.remote_self
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
Label4.Text = "Prepare to Press Menu + Play/Pause (1)"
Label4.Left = (Me.Width / 2) - (Label4.Width / 2)
PictureBox6.Image = My.Resources.remote_self
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
Label4.Text = "Press && hold Menu + Play/Pause (7)"
Label4.Left = (Me.Width / 2) - (Label4.Width / 2)
PictureBox6.Image = My.Resources.remote_both
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
Label4.Text = "Press && hold Menu + Play/Pause (6)"
Label4.Left = (Me.Width / 2) - (Label4.Width / 2)
PictureBox6.Image = My.Resources.remote_both
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
Label4.Text = "Press && hold Menu + Play/Pause (5)"
Label4.Left = (Me.Width / 2) - (Label4.Width / 2)
PictureBox6.Image = My.Resources.remote_both
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
Label4.Text = "Press && hold Menu + Play/Pause (4)"
Label4.Left = (Me.Width / 2) - (Label4.Width / 2)
PictureBox6.Image = My.Resources.remote_both
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
Label4.Text = "Prepare to release (3)"
Label4.Left = (Me.Width / 2) - (Label4.Width / 2)
PictureBox6.Image = My.Resources.remote_both
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
Label4.Text = "Prepare to release (2)"
Label4.Left = (Me.Width / 2) - (Label4.Width / 2)
PictureBox6.Image = My.Resources.remote_both
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
Label4.Text = "Prepare to release (1)"
Label4.Left = (Me.Width / 2) - (Label4.Width / 2)
PictureBox6.Image = My.Resources.remote_both
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
Label4.Text = "Release both buttons! (10)"
Label4.Left = (Me.Width / 2) - (Label4.Width / 2)
PictureBox6.Image = My.Resources.remote_self
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
Label4.Text = "Release both buttons! (9)"
Label4.Left = (Me.Width / 2) - (Label4.Width / 2)
PictureBox6.Image = My.Resources.remote_self
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
Label4.Text = "Release both buttons! (8)"
Label4.Left = (Me.Width / 2) - (Label4.Width / 2)
PictureBox6.Image = My.Resources.remote_self
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
Label4.Text = "Release both buttons! (7)"
Label4.Left = (Me.Width / 2) - (Label4.Width / 2)
PictureBox6.Image = My.Resources.remote_self
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
Label4.Text = "Release both buttons! (6)"
Label4.Left = (Me.Width / 2) - (Label4.Width / 2)
PictureBox6.Image = My.Resources.remote_self
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
Label4.Text = "Release both buttons! (5)"
Label4.Left = (Me.Width / 2) - (Label4.Width / 2)
PictureBox6.Image = My.Resources.remote_self
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
Label4.Text = "Release both buttons! (4)"
Label4.Left = (Me.Width / 2) - (Label4.Width / 2)
PictureBox6.Image = My.Resources.remote_self
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
Label4.Text = "Release both buttons! (3)"
Label4.Left = (Me.Width / 2) - (Label4.Width / 2)
PictureBox6.Image = My.Resources.remote_self
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
Label4.Text = "Release both buttons! (2)"
Label4.Left = (Me.Width / 2) - (Label4.Width / 2)
PictureBox6.Image = My.Resources.remote_self
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
Label4.Text = "Release both buttons! (1)"
Label4.Left = (Me.Width / 2) - (Label4.Width / 2)
PictureBox6.Image = My.Resources.remote_self
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
PictureBox4.Enabled = True
PictureBox6.Image = My.Resources.X
PictureBox6.SizeMode = PictureBoxSizeMode.StretchImage
Label4.Text = "DFU Was not detected! Try again."
Label4.Left = (Me.Width / 2) - (Label4.Width / 2)
MDIMain.MenuStrip1.Enabled = True
End If
End Sub
Private Sub PictureBox4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox4.Click
MDIMain.MenuStrip1.Enabled = False
PictureBox1.Visible = False
atv2.Visible = False
SaveToDisk("wait.img3", tempPath2 & "\iPhone4.True")
PictureBox1.SizeMode = PictureBoxSizeMode.Normal
Label1.Text = "DFU Pwner [greenpois0n]"
Label1.Left = (Me.Width / 2) - (Label1.Width / 2)
PictureBox4.Enabled = False
Label2.Visible = False
Label4.Visible = True
BackgroundWorker1 = New System.ComponentModel.BackgroundWorker
BackgroundWorker1.RunWorkerAsync()
BackgroundWorker1.WorkerReportsProgress = True
BackgroundWorker1.WorkerSupportsCancellation = True
If PreviousModel = "Apple TV 2" Then
Call ATV2DFU()
Exit Sub
End If
PictureBox1.Visible = True
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
Label4.Text = "Prepare to Press Home and Power (5)"
Label4.Left = (Me.Width / 2) - (Label4.Width / 2)
PictureBox1.Image = My.Resources.dfuPrepare
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
Label4.Text = "Prepare to Press Home and Power (4)"
PictureBox1.Image = My.Resources.dfuPrepare
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
Label4.Text = "Prepare to Press Home and Power (3)"
PictureBox1.Image = My.Resources.dfuPrepare
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
Label4.Text = "Prepare to Press Home and Power (2)"
PictureBox1.Image = My.Resources.dfuPrepare
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
Label4.Text = "Prepare to Press Home and Power (1)"
PictureBox1.Image = My.Resources.dfuPrepare
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
Label4.Text = "Press and hold the Home and Power"
Label4.Left = (Me.Width / 2) - (Label4.Width / 2)
PictureBox1.Image = My.Resources.dfuTwoButtons10
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
PictureBox1.Image = My.Resources.dfuTwoButtons09
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
PictureBox1.Image = My.Resources.dfuTwoButtons08
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
PictureBox1.Image = My.Resources.dfuTwoButtons07
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
PictureBox1.Image = My.Resources.dfuTwoButtons06
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
PictureBox1.Image = My.Resources.dfuTwoButtons05
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
PictureBox1.Image = My.Resources.dfuTwoButtons04
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
PictureBox1.Image = My.Resources.dfuTwoButtons03
Label4.Text = "Prepare to release the power button"
Label4.Left = (Me.Width / 2) - (Label4.Width / 2)
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
PictureBox1.Image = My.Resources.dfuTwoButtons02
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
PictureBox1.Image = My.Resources.dfuTwoButtons01
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
PictureBox1.Image = My.Resources.dfuRelease
Label4.Text = "Release the Power button and hold the Home button"
Label4.Left = (Me.Width / 2) - (Label4.Width / 2)
Delay(2)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
Label4.Text = "Keep Holding the home button"
Label4.Left = (Me.Width / 2) - (Label4.Width / 2)
RichTextBox1.Visible = True
PictureBox1.Image = My.Resources.dfutwobuttons30
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
PictureBox1.Image = My.Resources.dfutwobuttons29
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
PictureBox1.Image = My.Resources.dfutwobuttons28
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
PictureBox1.Image = My.Resources.dfutwobuttons27
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
PictureBox1.Image = My.Resources.dfutwobuttons26
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
PictureBox1.Image = My.Resources.dfutwobuttons25
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
PictureBox1.Image = My.Resources.dfutwobuttons24
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
PictureBox1.Image = My.Resources.dfutwobuttons23
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
PictureBox1.Image = My.Resources.dfutwobuttons22
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
PictureBox1.Image = My.Resources.dfutwobuttons21
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
PictureBox1.Image = My.Resources.dfutwobuttons20
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
PictureBox1.Image = My.Resources.dfutwobuttons19
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
PictureBox1.Image = My.Resources.dfutwobuttons18
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
PictureBox1.Image = My.Resources.dfutwobuttons17
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
PictureBox1.Image = My.Resources.dfutwobuttons16
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
PictureBox1.Image = My.Resources.dfutwobuttons15
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
PictureBox1.Image = My.Resources.dfutwobuttons14
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
PictureBox1.Image = My.Resources.dfutwobuttons13
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
PictureBox1.Image = My.Resources.dfutwobuttons12
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
PictureBox1.Image = My.Resources.dfutwobuttons11
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
RichTextBox1.Visible = False
PictureBox1.Image = My.Resources.dfuOneButton10
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
PictureBox1.Image = My.Resources.dfuOneButton09
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
PictureBox1.Image = My.Resources.dfuOneButton08
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
PictureBox1.Image = My.Resources.dfuOneButton07
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
PictureBox1.Image = My.Resources.dfuOneButton06
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
PictureBox1.Image = My.Resources.dfuOneButton05
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
PictureBox1.Image = My.Resources.dfuOneButton04
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
PictureBox1.Image = My.Resources.dfuOneButton03
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
PictureBox1.Image = My.Resources.dfuOneButton02
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
PictureBox1.Image = My.Resources.dfuOneButton01
Delay(1)
End If
If File_Exists(tempPath2 & "\DFU.True") = True Then
Call GoGoGadgetiREB()
Exit Sub
Else
PictureBox4.Enabled = True
PictureBox1.Image = My.Resources.X
PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage
Label4.Text = "DFU Was not detected! Try again."
Label4.Left = (Me.Width / 2) - (Label4.Width / 2)
MDIMain.MenuStrip1.Enabled = True
End If
End Sub
Public Sub BackgroundWorker1_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
Do Until File_Exists(tempPath2 & "\DFU.True")
'Searching for DFU...
console.Text = " "
Dim searcher As New ManagementObjectSearcher( _
"root\CIMV2", _
"SELECT * FROM Win32_PnPEntity WHERE Description = 'Apple Recovery (DFU) USB Driver'")
For Each queryObj As ManagementObject In searcher.Get()
console.Text += (queryObj("Description"))
Next
If console.Text.Contains("DFU") Then
SaveToDisk("sn0w.img3", tempPath2 & "\DFU.True")
End If
Loop
End Sub
Private Sub ProgressBarL_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles ProgressBarL.DoWork
Do Until ProgressBar1.Value = 99
ProgressBar1.Invoke(CType(AddressOf Increase, MethodInvoker))
Sleep(50)
Loop
ProgressBar1.Invoke(CType(AddressOf Meh, MethodInvoker))
End Sub
Public Sub Meh()
ProgressBar1.Value = 100
End Sub
Public Sub Increase()
If ProgressBar1.Value = 100 Then
Exit Sub
End If
ProgressBar1.Value = ProgressBar1.Value + 3
End Sub
End Class