Jump to content
Sign in to follow this  

Need some help with packets

Recommended Posts


Hey.. I've tried to figure out how the TCP cmds works.. But i couldn't figure it out in the help file. So i'd be happy if someone just could give me a short ex. How to send lets say a packet "287537" to the server "" (Is a port needed?) And then i need to know if there's any way to find the server i'm on. I know the port but not the server.


Share this post

Link to post
Share on other sites

A modified version of the client from the AutoIt3 help file using the IP and port u gave:

; Start The TCP Services

; Set Some reusable info

Dim $szIPADDRESS = ""
Dim $nPORT = 2053

; Initialize a variable to represent a connection
Dim $ConnectedSocket = -1

;Attempt to connect to SERVER at its IP and PORT 33891
$ConnectedSocket = TCPConnect($szIPADDRESS,$nPORT)

Dim $szData

; If there is an error... show it
If @error Then
    MsgBox(4112,"Error","Unable to connect to the server")
; If there is no error loop an inputbox for data
;   to send to the SERVER.
;Loop forever asking for data to send to the SERVER
    While 1
 ; InputBox for data to transmit
        $szData = InputBox("Data for Server",@LF & @LF & "Enter data to transmit to the SERVER:")
 ; If they cancel the InputBox or leave it blank we exit our forever loop
        If @error Or $szData = "" Then ExitLoop
 ; We should have data in $szData... lets attempt to send it through our connected socket.
 ; If the send failed with @error then the socket has disconnected
        If @error Then ExitLoop


The port is needed. What do you mean "find" the server your on? If your trying to find the IP address of for example a online game, use your fire wall. If it's a good fire wall, it should list all the connections to your computer. If not, you can download a packet sniffer.


Edited by Hallman

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this