This repository has been archived by the owner on Dec 18, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathMainForm.vb
108 lines (96 loc) · 4.07 KB
/
MainForm.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
Imports System.IO
Imports System.IO.File
Imports System.Net
Public Class MainForm
Dim keyorder() As Object = {System.Windows.Forms.Keys.Up, System.Windows.Forms.Keys.Up,
System.Windows.Forms.Keys.Down, System.Windows.Forms.Keys.Down,
System.Windows.Forms.Keys.Left, System.Windows.Forms.Keys.Right,
System.Windows.Forms.Keys.Left, System.Windows.Forms.Keys.Right,
System.Windows.Forms.Keys.B, System.Windows.Forms.Keys.A}
Dim index As Integer = 0
Dim sequence() As Boolean = {False, False, False, False, False, False, False, False, False, False}
Dim UpdateCheck As String = "https://pastebin.com/raw/YiPFq7qB"
Dim Web As WebClient = New WebClient()
Dim Rd As StreamReader = New StreamReader(Web.OpenRead(UpdateCheck))
Dim GBATemp As String = "https://gbatemp.net/threads/release-hactoolgui-a-very-simple-gui-for-hactool.499526/"
Dim LatestVersion As String = Rd.ReadToEnd
Dim CurrentVersion As String = "0.3a"
Public Sub New()
InitializeComponent()
Me.KeyPreview = True
End Sub
Private Sub CalculatorAboutForm_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyUp
If index < 9 And sequence(index) = False And e.KeyCode = keyorder(index) Then
sequence(index) = True
index += 1
ElseIf index = 9 And e.KeyCode = keyorder(index) Then
MsgBox("You found the first easter egg!" + vbNewLine + "Now look for the others...")
Else
index = 0
For i As Integer = 0 To sequence.Length - 1
sequence(i) = False
Next
End If
End Sub
Private Sub LaunchNCA_Click(sender As Object, e As EventArgs) Handles LaunchNCA.Click
NCAForm.Show()
End Sub
Private Sub LaunchXCI_Click(sender As Object, e As EventArgs) Handles LaunchXCI.Click
XCIForm.Show()
End Sub
Private Sub MainForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
If Exists("hactool.exe") Then
Else
MsgBox("You must put hactool.exe and its dependencies in this directory.")
Close()
End If
If Exists("easter.egg") Then
MsgBox("You found the second easter egg!" + vbNewLine + "Gotta catch 'em all!")
Else
End If
If Exists("keys.dat") Then
LaunchNCA.Enabled = True
Else
MsgBox("To use NCA extraction features, please fill in key data!")
KeyForm.Show()
End If
End Sub
Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
RomFSForm.Show()
End Sub
Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
PFS0Form.Show()
End Sub
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
HFS0Form.Show()
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
NPDMForm.Show()
End Sub
Private Sub Button8_Click(sender As Object, e As EventArgs) Handles Button8.Click
PK11Form.Show()
End Sub
Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click
PK21Form.Show()
End Sub
Private Sub Button10_Click(sender As Object, e As EventArgs) Handles Button10.Click
INI1Form.Show()
End Sub
Private Sub Button9_Click(sender As Object, e As EventArgs) Handles Button9.Click
KIP1Form.Show()
End Sub
Private Sub Label1_Click(sender As Object, e As EventArgs) Handles Label1.Click
If LatestVersion = CurrentVersion Then
Label1.Text = "HACToolGUI is up to date."
Else
Label1.Text = "Version " + LatestVersion + " is available."
End If
If Label1.Text = "HACToolGUI is up to date." Then
Else
Process.Start(GBATemp)
End If
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
KeyForm.Show()
End Sub
End Class