-
Notifications
You must be signed in to change notification settings - Fork 21
/
modResponseHandling.bas
48 lines (41 loc) · 1.61 KB
/
modResponseHandling.bas
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
Attribute VB_Name = "modResponseHandling"
Option Explicit
Public LastResponse As String
Public LastResponseTime As String
Public Sub ClearAllResponseVariables()
LastResponseTime = vbNullString
LastResponse = vbNullString
End Sub
Public Sub WriteLastResponseToFile()
If Not (Dir$(application_response_directory, 16) <> "") Then
On Error Resume Next 'Prevent errors if the device is write protected
MkDir (application_response_directory)
End If
Open application_response_directory & "\" & Target & "-" & plugin_filename & ".txt" For Output As #1
On Error Resume Next 'Prevent errors if the device is write protected
Print #1, LastResponse
Close
End Sub
Public Sub LoadLatestResponse()
If IsFormVisible("frmAttackResponse") = True Then
frmAttackResponse.PrepareTabs
frmAttackResponse.lblHost.Caption = Target
frmAttackResponse.lblPort.Caption = plugin_port
frmAttackResponse.lblTime.Caption = LastResponseTime
frmAttackResponse.txtLastResponse.Text = LastResponse
frmAttackResponse.lblLength.Caption = Len(LastResponse) & _
" bytes"
End If
End Sub
Public Function LoadResponseFromFile(ByRef strResponseFileName As String) As String
'Check the existence of the file
On Error Resume Next
If (Dir$(strResponseFileName, 16) <> "") Then
'Open and read the plugin file
Open strResponseFileName For Input As 1
LoadResponseFromFile = Input(LOF(1), #1)
Close
' Else
' Call errPluginDoesNotExist(strFilePath & "\" & strFileName)
End If
End Function