d0n Posted April 26, 2007 Share Posted April 26, 2007 Dim $IP = @IPAddress1 Dim $nPORT = 4098 Dim $IP2 = "65.209.65.21" $MainSocket = TCPListen($IP2, $nPORT) why doesn't it listen to this IP address?? this is only a part of the example code from autoit i am still trying to learn how to use TCP stuff :S Link to comment Share on other sites More sharing options...
Gabburd Posted April 26, 2007 Share Posted April 26, 2007 (edited) Assuming that the IP address listed is actually assigned to your computer and the port is not already in use, you could do the following: Dim $IP = @IPAddress1 Dim $nPORT = 4098 Dim $IP2 = "65.209.65.21" ;Using a variable such as @IPAddress2 might be better TCPStartup() $MainSocket = TCPListen($IP2, $nPORT) If $MainSocket == -1 Then MsgBox( 0, "TCP Error", "Error Listening on TCP" & @CRLF & "@error = " & @error ) Exit EndIf While 1 $Socket = TCPAccept($MainSocket) If $Socket >= 0 Then $recv = '' While $recv = '' $recv = TCPRecv($Socket, 10000) WEnd ;Do something here based on the request ConsoleWrite($recv) EndIf WEnd Edited April 26, 2007 by Gabburd Link to comment Share on other sites More sharing options...
d0n Posted April 26, 2007 Author Share Posted April 26, 2007 Ok not really sure what you mean by "assigned to your computer" but all i want to do is intercept all the incoming packets from this game to the server thing so i can read what is happening how should i go about and do that? Link to comment Share on other sites More sharing options...
Generator Posted April 26, 2007 Share Posted April 26, 2007 Ok not really sure what you mean by "assigned to your computer"but all i want to do is intercept all the incoming packets from this game to the server thing so i can read what is happeninghow should i go about and do that?Just telling most of the game packets are deeply encrypted. Link to comment Share on other sites More sharing options...
d0n Posted April 26, 2007 Author Share Posted April 26, 2007 not this one, with another progarm i can read what they are doing but i want to log it all down with autoit Link to comment Share on other sites More sharing options...
Gabburd Posted April 26, 2007 Share Posted April 26, 2007 An IP address being assigned to your computer means that if another computer sends packets to that IP Address than your computer will receive them.As for Intercepting TCP Packet's it can't be done normally, you'll have to use a dll.Check here for more info: http://www.autoitscript.com/forum/index.ph...=tcp++intercept Link to comment Share on other sites More sharing options...
d0n Posted April 26, 2007 Author Share Posted April 26, 2007 (edited) how do i know which @IPaddress(number) to pick from tho? EDIT: and not so much as to intercept but just read all the packets that are sent from that ip Edited April 26, 2007 by d0n Link to comment Share on other sites More sharing options...
Gabburd Posted April 26, 2007 Share Posted April 26, 2007 (edited) If you have more than one IP Address than you are on more than one network. Most likely you'll want to use the same one you would use to access your internet connection, unless you are on a seperate LAN or VPN in which case you'll want to use that one. Edited April 26, 2007 by Gabburd Link to comment Share on other sites More sharing options...
d0n Posted April 26, 2007 Author Share Posted April 26, 2007 Dim $IP = @IPAddress1 Dim $nPORT = 4099 Dim $IP2 = "65.209.65.21" ; Start The TCP Services ;============================================== TCPStartUp() ; Create a Listening "SOCKET". ; Using your IP Address and Port 4099. ;============================================== $MainSocket = TCPListen($IP2, $nPORT) MsgBox(0, "", $MainSocket) so i tried this but msg box gives me -1 which means something went wrong? Link to comment Share on other sites More sharing options...
Gabburd Posted April 26, 2007 Share Posted April 26, 2007 msg box gives me -1 which means something went wrong?That means that either the IP address you used is not assigned to your computer, or the port is already in use by another program.Like I said you aren't going to be able to intercept packets with TCPListen Link to comment Share on other sites More sharing options...
crashdemons Posted October 11, 2007 Share Posted October 11, 2007 ... If someone is using a Router how do you automatically detect which IP to listen on (like so many major server applications do) ? I mean sometimes (for non-router users?) the IP is @IPAddress1 other times it has to be 192.168.1.101 or some obscure private IP (that the router assigns?) So, how do I automatically find the IP that will allow me to have a listening port open to the internet - despite what form of connection the user has. (since @IPAddress1 apparently using usable in some circumstances) I am tempted to just try every @IPAddress# and attempt connections remotely somehow upon binding... But that seems out-of-the-way given Big programs do it automatically. ( I am currently using a User prompt to input an IP to match their configuration ) My Projects - WindowDarken (Darken except the active window) Yahsmosis Chat Client (Discontinued) StarShooter Game (Red alert! All hands to battlestations!) YMSG Protocol Support (Discontinued) Circular Keyboard and OSK example. (aka Iris KB) Target Screensaver Drive Toolbar Thingy Rollup Pro (Minimize-to-Titlebar & More!) 2D Launcher physics example Ascii Screenshot AutoIt3 Quine Example ("Is a Quine" is a Quine.) USB Lock (Another system keydrive - with a toast.) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now