-
Notifications
You must be signed in to change notification settings - Fork 0
/
ExtraForm.vb
148 lines (120 loc) · 5.72 KB
/
ExtraForm.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
Imports System.IO
Imports System.Text
Imports Executable_Decryptor_UI.PS5_Payload_Sender
Public Class ExtraForm
Private Sub BtnSave_Click(sender As Object, e As EventArgs) Handles BtnSave.Click
Dim portnumber As Integer, payload As String = ""
If Not String.IsNullOrEmpty(Me.PayloadTxtbox.Text) Then
payload = Me.PayloadTxtbox.Text
End If
If Not Integer.TryParse(PayloadportTxtbox.Text, portnumber) Then
' Parsing Unsuccessful, use the parsed value
MessageBox.Show("Portnumber not Changed !! " & vbNewLine & "Invalid Number")
Exit Sub
End If
My.Settings.Payload = payload
My.Settings.PayloadPort = portnumber
My.Settings.Save()
MessageBox.Show("Values Updated!! ")
showsettingvalues()
End Sub
Private Sub ExtraForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
showsettingvalues
End Sub
Private Sub showsettingvalues()
PayloadportTxtbox.Text = My.Settings.PayloadPort
PayloadTxtbox.Text = My.Settings.Payload.ToString
IpTextBox.Text = My.Settings.PS5IP.ToString
Dim pythonscript As String = My.Settings.PyScript.ToString
If Not String.IsNullOrEmpty(pythonscript) Then
TxtPython.Text = pythonscript
Else
TxtPython.Text = "make_fself_python3-1.py"
End If
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim selectedFolder As String = BrowseFolder()
If Not String.IsNullOrEmpty(selectedFolder) Then
statlabel.Text = selectedFolder
Dim Sd As String = VerifyDirectoryfiles(selectedFolder)
MessageBox.Show(Sd, "Executables Verification", MessageBoxButtons.OK, MessageBoxIcon.None)
End If
End Sub
Function VerifyDirectoryfiles(folderpath As String) As String
Dim Rtext As New StringBuilder()
Dim fileExtensions As String() = {".sprx", ".prx", ".bin"}
Dim kilobytesToRead As Integer = 2
' Check if the directory exists
Console.WriteLine("directory exists")
' Get all files with specified extensions
For Each fileExtension In fileExtensions
Dim files = Directory.GetFiles(folderpath, "*" & fileExtension, SearchOption.AllDirectories)
For Each filePath In files
' Read and check the content
Dim Fname As String = Path.GetFileName(filePath)
If FileContainsElfString(filePath) Then
Rtext.AppendLine(Fname & " - Valid")
Else
Rtext.AppendLine(Fname & " - inValid")
End If
'If Execute(filePath) Then
' writelog($"File {filePath} has the ELF string in the first 3 letters.")
'Else
' writelog($"File {filePath} does not have the ELF string in the first 3 letters.")
'End If
Next
Next
' Form1.CMDView.AppendText("Executables have been decrypted! You may proceed to replace them.")
Return Rtext.ToString
End Function
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim fpload As String = BrowseForFile("Binary and ELF Files|*.bin;*.elf|Binary Files (*.bin)|*.bin|ELF Files (*.elf)|*.elf|All Files|*.*")
If Not String.IsNullOrEmpty(fpload) Then
Me.statlabel.Text = fpload
Dim psip As String = Me.IpTextBox.Text
Dim portnum As Integer = CInt(Me.PayloadportTxtbox.Text)
Dim psender As New PayloadV2()
Dim isConnected As Boolean = psender.Connect2PS5(psip, portnum)
If isConnected Then
Try
Application.DoEvents()
' Specify the path to your test.bin payload
'Dim payloadPath As String = "C:\path\to\test.bin"
' Send the payload
psender.SendPayload(fpload)
' Disconnect after sending
psender.DisconnectPayload()
MessageBox.Show("Payload sent successfully!")
Catch ex As Exception
MessageBox.Show("Error while sending payload: " & ex.Message)
Exit Sub
End Try
Else
MessageBox.Show("IP Not Found !!" & vbNewLine & $"{psip}:{portnum}", "Host Not Found")
End If
End If
Me.statlabel.Text = "Idle...zzz"
End Sub
Function BrowseForFile(Ifilter As String) As String
Dim openFileDialog As New OpenFileDialog()
'"Binary and ELF Files|*.bin;*.elf|Binary Files (*.bin)|*.bin|ELF Files (*.elf)|*.elf|All Files|*.*"
openFileDialog.Filter = Ifilter
If openFileDialog.ShowDialog() = DialogResult.OK Then
Return openFileDialog.FileName
Else
Return String.Empty
End If
End Function
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Dim dfile As String = BrowseForFile("Binary and ELF Files|*.bin;*.elf|Binary Files (*.bin)|*.bin|ELF Files (*.elf)|*.elf|All Files|*.*")
If Not String.IsNullOrEmpty(dfile) Then
PayloadTxtbox.Text = dfile
End If
End Sub
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
Dim dfile As String = BrowseForFile("Python Files (*.py)|*.py|All Files|*.*")
If Not String.IsNullOrEmpty(dfile) Then
TxtPython.Text = dfile
End If
End Sub
End Class