PDA

Click to See Complete Forum and Search --> : [Resolved] winsock packet


dddmaster
Jan 5th, 2006, 04:46 PM
Hello , i have a question about visual basic 6 , i´ve written a programm wich makes a mmorpg connects through it , as like a proxy. But i want it to display the packets as like winsock packet sniffer or editor do ( google: "winsock packet editor" ) .
Can any1 tell me how i could do that?
I already tried to display every data as string , but if i do that the proxy doesnt work anymore and it doesnt display it right ( wpe displays it as some hex values oO )

Pino
Jan 6th, 2006, 09:23 AM
Welcome to the forums!

Interesting, I have tried looking into monitoring my network traffic in the past with out much succes, Packet Sniffing doenst allways work too well because the data you will pick up will be encrypted, hex or un-readable.

What is it you are trying to achieve?

dddmaster
Jan 6th, 2006, 09:41 AM
im working togehter with some friends on a ragnarok online private server and i want to create some automatics for the client , like auto item usage and such stuff , i also have a list of wich packet is wich and i have tried with wpe and such stuff... now i want it to do automaticaly with vb6 but i cant make it >< ( at least showing the packets while i recieve them would help )

The basic Code of the proxy:

Private Sub Form_Load()
Winsock1.LocalPort = 6900
Winsock1.Listen
Winsock2.RemotePort = 6901
Winsock2.RemoteHostIP = "127.0.0.1" 'for testing , the server runs at my own pc
End Sub

Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
Winsock1.Close
Winsock1.Accept requestID
Winsock2.Connect
End Sub

Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Winsock1.GetData Data
'somewhere here i have to get the packet ,
'but if i set the variable-type of data to something ,
'the proxy doesnt work anymore
Winsock2.SendData Data
End Sub

Private Sub Winsock2_DataArrival(ByVal bytesTotal As Long)
Winsock2.GetData Data
'same as above
Winsock1.SendData Data
End Sub

Pino
Jan 6th, 2006, 09:46 AM
I'm not 100% with this stuff, but i'll try and get in touch with somone who will know more about the proxys etc :)

Pino

dddmaster
Jan 9th, 2006, 08:12 AM
uhm did u find out anything what could me help yet?

dddmaster
Jan 19th, 2006, 12:56 PM
sry 4 double post , but i made it :P
if any1 cares , here my code

Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
While Not connected ' boolean variable , is true if winsock2 is connected
DoEvents
Wend
Dim data() As Byte
Winsock1.GetData data ' get the data as Byte into data array
Dim x As Integer
x = 0
While x < bytesTotal
List1.AddItem "send " & x & ":" & Hex(data(x)) & "/" & data(x) ' go trough the array and add every element to list as decimal and hex
x = x + 1
Wend
Winsock2.SendData data ' send data through winsock2 , its a proxy :P
End Sub



The same thing goes with winsock2 data arrival...
With that u can also edit the data . Ragnarok connects to a login server and gets the ip of the character server from it , i managed to change the "packet" and made it connect to my localhost through another poxy :P