[ Pobierz całość w formacie PDF ]

End Sub
Public Sub log(Text As String)
On Error GoTo erred
txtLog.Text = txtLog.Text & Text & vbCrLf
txtLog.SelStart = Len(txtLog.Text)
Exit Sub
erred:
txtLog.Text = ""
txtLog.Text = txtLog.Text & Text & vbCrLf
txtLog.SelStart = Len(txtLog.Text)
End Sub
134 D:\KISIU\PDFy\Chudy\KsiÄ…\ki\Hack wars doc\hack wars tom 2 [ PL ]\hack wars tom 2 [ PL ]\01b.doc
Rozdział 1. f& 135
f& Zabezpieczanie portów i usług
f&
f&
Private Sub Inet2_Close()
log "0>INET EVENT: CLOSED CONNECTION"
Inet.Close
cmdListen_Click
cmdListen_Click
End Sub
Private Sub Inet2_DataArrival(ByVal bytesTotal As Long)
On Error GoTo erred
Dim sData As String
Dim bData2() As Byte
If opTCP.Value Then
Inet2.PeekData sData, vbString
Inet2.GetData bData2(), vbArray + vbByte
Inet.SendData bData2()
Else
Inet2.GetData sData
Inet.SendData sData
End If
log "O>" & sData
Exit Sub
erred:
Inet.Close
Inet2.Close
cmdListen_Click
cmdListen_Click
End Sub
Private Sub Inet2_Error(ByVal Number As Integer, Description As
String, ByVal Scode
As Long, ByVal Source As String, ByVal HelpFile As String, ByVal
HelpContext As
Long, CancelDisplay As Boolean)
log "O>INET ERROR: " & Number & " = " & Description
End Sub
Private Sub txtLocalPort_Change()
txtRemotePort.Text = txtLocalPort.Text
End Sub
' Moduł wspólny
Public Declare Function ShellExecute Lib "shell32.dll" Alias
"ShellExecuteA" (ByVal
hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String,
ByVal
lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As
Long) As Long
Public Const INIFILE = "TIGERGUARD.INI"
Public Const CR = vbCrLf
Public MAX_PORTS As Integer
Public ANTI_FLOOD_COUNT As Integer
Public ANTI_FLOOD_ACTION As Integer
Public BEEPONCONNECT As String * 1
Public Type PORTENTRY
PORTNAME As String * 255
PORTNUMBER As Long
End Type
Public Function APPPATH() As String
If Right(App.Path, 1) "\" Then
D:\KISIU\PDFy\Chudy\KsiÄ…\ki\Hack wars doc\hack wars tom 2 [ PL ]\hack wars tom 2 [ PL ]\01b.doc 135
136 Hack Wars. Tom 2. Na tropie hakerów
APPPATH = App.Path & "\"
Else
APPPATH = App.Path
End If
End Function
Public Function DOESINIEXIST() As Boolean
If Dir(APPPATH & INIFILE) = "" Then
DOESINIEXIST = False
Else
DOESINIEXIST = True
End If
End Function
Public Sub LoadINISettings()
Dim strTempVal As String
strTempVal = ReadINI(APPPATH & INIFILE, "GENERAL", "MAXPORTS")
If strTempVal "" Then
If IsNumeric(strTempVal) = True Then
If strTempVal >= 1 Then
MAX_PORTS = strTempVal
GoTo INIVAL2
Else
GoTo bad_max_port
End If
GoTo bad_max_port
End If
GoTo bad_max_port
End If
INIVAL2:
strTempVal = ReadINI(APPPATH & INIFILE, "GENERAL", "ANTIFLOODCOUNT")
If strTempVal "" Then
If IsNumeric(strTempVal) = True Then
If strTempVal >= 1 Then
ANTI_FLOOD_COUNT = strTempVal
GoTo INIVAL3
Else
GoTo bad_flood_count
End If
GoTo bad_flood_count
End If
GoTo bad_flood_count
End If
INIVAL3:
strTempVal = ReadINI(APPPATH & INIFILE, "GENERAL", "ANTIFLOODACTION")
If strTempVal "" Then
If IsNumeric(strTempVal) = True Then
If strTempVal >= 1 Then
ANTI_FLOOD_ACTION = strTempVal
Exit Sub
Else
GoTo bad_flood_count
End If
GoTo bad_flood_count
End If
GoTo bad_flood_count
End If
BEEPONCONNECT = ReadINI(APPPATH & INIFILE, "GENERAL", "BEEP")
Exit Sub
bad_max_port:
136 D:\KISIU\PDFy\Chudy\KsiÄ…\ki\Hack wars doc\hack wars tom 2 [ PL ]\hack wars tom 2 [ PL ]\01b.doc
Rozdział 1. f& 137
f& Zabezpieczanie portów i usług
f&
f&
MsgBox "Invalid Maximum Policies entry in INI file. Please re-
install." & CR &
CR & "Using Default of 40", vbExclamation, "Error!"
MAX_PORTS = 40
Exit Sub
bad_flood_count:
MsgBox "Invalid Denial of Service in INI file. Please re-
install." & CR & CR &
"Using Default of 100", vbExclamation, "Error!"
ANTI_FLOOD_COUNT = 100
Exit Sub
bad_flood_action:
MsgBox "Invalid Denial of Service entry in INI file. Please re-
install." & CR &
CR & "Using default (Reset Port)", vbExclamation, "Error!"
ANTI_FLOOD_ACTION = 1
Exit Sub
End Sub
Public Sub SaveINISettings()
Dim strINIFILE As String
Dim strTmpVal As String
strINIFILE = APPPATH & INIFILE
strTmpVal = MAX_PORTS
WriteINI strINIFILE, "GENERAL", "MAXPORTS", strTmpVal
strTmpVal = ANTI_FLOOD_ACTION
WriteINI strINIFILE, "GENERAL", "AntiFloodAction", strTmpVal
strTmpVal = ANTI_FLOOD_COUNT
WriteINI strINIFILE, "GENERAL", "AntiFloodCount", strTmpVal
If frmMain.chkAntiFlood.Value = vbChecked Then
WriteINI strINIFILE, "GENERAL", "AntiFloodEnable", "1"
Else
WriteINI strINIFILE, "GENERAL", "AntiFloodEnable", "0"
End If
End Sub
' ZarzÄ…dzane plikiem INI
Declare Function WritePrivateProfileString Lib "kernel32" Alias
"WritePrivateProfileStringA" (ByVal lpApplicationName As String,
ByVal lpKeyName
As Any, ByVal lpString As Any, ByVal lpFileName As String) As
Long
Declare Function GetPrivateProfileString Lib "kernel32" Alias
"GetPrivateProfileStringA" (ByVal lpApplicationName As String,
ByVal lpKeyName As
Any, ByVal lpDefault As String, ByVal lpReturnedString As String,
ByVal nSize
As Long, ByVal lpFileName As String) As Long
Public Ret As String
Public Sub WriteINI(FileName As String, Section As String, Key As
String, Text As
1 String)
WritePrivateProfileString Section, Key, Text, FileName
End Sub
Public Function ReadINI(FileName As String, Section As String, Key As
String)
Ret = Space$(255)
RetLen = GetPrivateProfileString(Section, Key, "", Ret, Len(Ret),
FileName)
D:\KISIU\PDFy\Chudy\KsiÄ…\ki\Hack wars doc\hack wars tom 2 [ PL ]\hack wars tom 2 [ PL ]\01b.doc 137
138 Hack Wars. Tom 2. Na tropie hakerów
Ret = Left$(Ret, RetLen)
ReadINI = Ret
End Function
' Wspólne okna dialogowe
Private Declare Function GetSaveFileName Lib "comdlg32.dll" Alias
"GetSaveFileNameA" (pOpenfilename As OPENFILENAME) As Long
Private Declare Function GetOpenFileName Lib "comdlg32.dll" Alias
"GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long
Private Filename As OPENFILENAME
Private Type OPENFILENAME
lStructSize As Long
hwndOwner As Long
hInstance As Long
lpstrFilter As String
lpstrCustomFilter As String
nMaxCustFilter As Long
nFilterIndex As Long
lpstrFile As String
nMaxFile As Long
lpstrFileTitle As String
nMaxFileTitle As Long
lpstrInitialDir As String
lpstrTitle As String
flags As Long
nFileOffset As Integer
nFileExtension As Integer
lpstrDefExt As String
lCustData As Long [ Pobierz całość w formacie PDF ]

  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • kudrzwi.xlx.pl