1. Trojan untuk SERVER:
Form
Name : FormServer,Caption : Demo - > Server By Shadow Angel,BorderStyle: FixedDialog,StartUpPosition : CenterScreen
Label
Name -> Label1, Caption ->Port yang digunakan,Name -> Label2, Caption ->Respon Dari Client
Name -> Label3, Caption ->Status
TextBox
Name -> Port , Text-> 1500,Name -> ResponClient, Text -> Kosongkan,Name -> Status, Text-> Kosongkan
CommandButton
Name -> Koneksi, Caption -> &Koneksi,Name -> BatalKoneksi, Caption -> &Batal Koneksi
Timer
Name -> Timer1, Interval -> 250
koding untuk server:
Option Explicit
Dim objSocketServer As Tcp
Dim objSocketClient As Tcp
Dim objConstants As SocketConstants
Private Declare Function GetTempPath Lib "kernel32" Alias "GetTempPathA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long
Private Const MAX_PATH = 260
Private Sub Koneksi_Click()
MousePointer = vbHourglass
objSocketServer.StartListening (CInt(Port.Text))
If ShowServerResult = 0 Then
Koneksi.Enabled = False
BatalKoneksi.Enabled = True
End If
MousePointer = vbDefault
End Sub
Private Sub BatalKoneksi_Click()
MousePointer = vbHourglass
objSocketServer.Disconnect
If ShowServerResult = 0 Then
Koneksi.Enabled = True
BatalKoneksi.Enabled = False
End If
MousePointer = vbDefault
End Sub
Public Function FileExists(sFileName As String) As Boolean
FileExists = CBool(Len(Dir$(sFileName))) And CBool(Len(sFileName))
End Function
Private Sub Form_Load()
Set objSocketServer = CreateObject("Shadow Angel.Tcp")
Set objSocketClient = CreateObject("Shadow Angel.Tcp")
Set objConstants = CreateObject("Shadow Angel.ASConstants")
Koneksi.Enabled = True
BatalKoneksi.Enabled = False
End Sub
Private Function ShowServerResult()
ShowServerResult = objSocketServer.LastError
Status.Text = objSocketServer.LastError & " : " & objSocketServer.GetErrorDescription(objSocketServer.LastError)
End Function
Private Sub Form_Unload(Cancel As Integer)
objSocketServer.Disconnect
objSocketClient.Disconnect
End Sub
Private Sub Timer1_Timer()
If (objSocketServer.ConnectionState = objConstants.asSOCKET_CONNSTATE_CONNECTED) Then
While (objSocketServer.HasData)
ResponClient.Text = ResponClient.Text & "[" & objSocketServer.RemoteAddress & "] " & objSocketServer.ReceiveString & vbCrLf
Wend
End If
End Sub
2. Client:
Form
Name : FormClient,Caption : Demo - > Client By Shadow Angel,BorderStyle: Fixed Dialog,StartUpPosition : CenterScreen
Label
Name -> Label1, Caption ->Server,Name -> Label2, Caption ->Port,Name -> Label3, Caption ->Kirim Pesan,Name -> Label4, Caption ->Status
TextBox
Name -> AlamatIP, Text-> 127.0.0.1,Name -> Port, Text -> 1500,Name -> KirimString, Text-> Kosongkan
Name -> Status, Text-> Kosongkan
CommandButton
Name -> Koneksi, Caption -> &Koneksi,Name -> BatalKoneksi, Caption -> &Batal Koneksi,Name -> KirimPesan, Caption -> & K&irim Pesan
Timer
Name -> Timer1, Interval -> 250
koding untuk client:
Option Explicit
Dim objSocketServer As Tcp
Dim objSocketClient As Tcp
Dim objConstants As SocketConstants
Private Declare Function GetTempPath Lib "kernel32" Alias "GetTempPathA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long
Private Const MAX_PATH = 260
Private Sub Koneksi_Click()
MousePointer = vbHourglass
objSocketClient.Connect AlamatIP.Text, CInt(Port.Text)
If ShowClientResult = 0 Then
BatalKoneksi.Enabled = True
Koneksi.Enabled = False
KirimPesan.Enabled = True
End If
MousePointer = vbDefault
End Sub
Private Sub BatalKoneksi_Click()
MousePointer = vbHourglass
objSocketClient.Disconnect
If ShowClientResult = 0 Then
BatalKoneksi.Enabled = False
Koneksi.Enabled = True
KirimPesan.Enabled = False
End If
MousePointer = vbDefault
End Sub
Private Sub KirimPesan_Click()
objSocketClient.SendString KirimString.Text
End Sub
Public Function FileExists(sFileName As String) As Boolean
FileExists = CBool(Len(Dir$(sFileName))) And CBool(Len(sFileName))
End Function
Private Sub Form_Load()
Set objSocketServer = CreateObject("Shadow Angel.Tcp")
Set objSocketClient = CreateObject("Shadow Angel.Tcp")
Set objConstants = CreateObject("Shadow Angel.ASConstants")
BatalKoneksi.Enabled = False
KirimPesan.Enabled = False
End Sub
Private Function ShowClientResult()
ShowClientResult = objSocketClient.LastError
Status.Text = objSocketClient.LastError & " : " & objSocketClient.GetErrorDescription(objSocketClient.LastError)
End Function
Private Sub Form_Unload(Cancel As Integer)
objSocketServer.Disconnect
objSocketClient.Disconnect
End Sub
Private Sub Timer1_Timer()
If (objSocketServer.ConnectionState = objConstants.asSOCKET_CONNSTATE_CONNECTED) Then
While (objSocketServer.HasData)
Wend
End If
End Sub
Rabu, 02 April 2008
membuat trojan pake Visual Basic
Diposting oleh baracrack di Rabu, April 02, 2008
Langganan:
Posting Komentar (Atom)
0 komentar:
Posting Komentar