bf2forlife Posted May 29, 2008 Share Posted May 29, 2008 So always when i try to connect somewhere with TCP, my computer starts lagging, and then the program with TCP is not responding anymore. Where is the problem? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted May 29, 2008 Moderators Share Posted May 29, 2008 So always when i try to connect somewhere with TCP, my computer starts lagging, and then the program with TCP is not responding anymore. Where is the problem?Replace line 16 with $myCode = "If I showed code, I would probably get an answer I understood" Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
PsaltyDS Posted May 29, 2008 Share Posted May 29, 2008 Hi, I'm Mike Rowe, and THIS is my job... Replace line 16 with $myCode = "If I showed code, I would probably get an answer I understood" Today on Dirty Jobs, I try my hand at being an AutoIt Forum Moderator! Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
bf2forlife Posted May 30, 2008 Author Share Posted May 30, 2008 One more thing, it starts lagging when the TCPConnect($ip, $port) is before the TCPListen('127.0.0.1', $port), and when i put the TCPListen first, nothing happends. Can someone help? Link to comment Share on other sites More sharing options...
bf2forlife Posted May 31, 2008 Author Share Posted May 31, 2008 bump Link to comment Share on other sites More sharing options...
Developers Jos Posted May 31, 2008 Developers Share Posted May 31, 2008 bump Which part of "first show your code before we can help you!" didn't you understand ? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
bf2forlife Posted May 31, 2008 Author Share Posted May 31, 2008 Of course. expandcollapse popup#include <GUIConstants.au3> dim $appname = "TCP Sniffer" Opt("GUIOnEventMode", 1) GUICreate($appname, 830, 450) $Edit1 = GUICtrlCreateInput ("",8,10,813,300) $Edit2 = GUICtrlCreateInput ("To client",8,354,650,25) $Edit3 = GUICtrlCreateInput ("To server",8,410,650,25) $Button1 = GUICtrlCreateButton ("Send",670,354,150,25) $Button2 = GUICtrlCreateButton ("Send",670,410,150,25) GUISetState(@SW_SHOW) ; Start The TCP Services ;============================================== TCPStartUp() ; Set Some reusable info ;-------------------------- Dim $szIPADDRESS = "62.50.35.181" Dim $nPORT = 30001 ; Initialize a variable to represent a connection ;============================================== Dim $ConnectedSocket = -1 ;Attempt to connect to SERVER at its IP and PORT 33891 ;======================================================= $main_socket = TCPListen('127.0.0.1',30000) $clt_socket = TCPAccept($main_socket) $string = "Connected to client" & @CRLF GUICtrlSetData($Edit1, $string) $ConnectedSocket = TCPConnect($szIPADDRESS,$nPORT) $string = "Connected to server" & @CRLF GUICtrlSetData($Edit1, $string) ; 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 ; InputBox for data to transmit ; If they cancel the InputBox or leave it blank we exit our forever loop ; We should have data in $szData... lets attempt to send it through our connected socket. While 1 $Recv = TCPRecv($ConnectedSocket,1000) If $Recv Then $string &= "[ToClient]:" & Hex($Recv) & @CRLF GUICtrlSetData($Edit1, $string) EndIf $msg = GUIGetMsg() Select Case $msg = $Button2 TCPSend($ConnectedSocket,$Edit3) Case $msg = $Button1 TCPSend($main_socket,$Edit2) EndSelect $Recv = TCPRecv($clt_socket,1000) If $Recv Then $string &= "[ToServer]:" & Hex($Recv) & @CRLF GUICtrlSetData($Edit1, $string) EndIf ; If the send failed with @error then the socket has disconnected ;---------------------------------------------------------------- If @error Then ExitLoop WEnd TCPCloseSocket($ConnectedSocket) Link to comment Share on other sites More sharing options...
Kip Posted May 31, 2008 Share Posted May 31, 2008 ;Attempt to connect to SERVER at its IP and PORT 33891 ;======================================================= $main_socket = TCPListen('127.0.0.1',30000) $clt_socket = TCPAccept($main_socket) $string = "Connected to client" & @CRLF GUICtrlSetData($Edit1, $string) $ConnectedSocket = TCPConnect($szIPADDRESS,$nPORT) TCPListen and TCPAccept are only used at the server side. I assume that this is the client script since you are trying to connect to the server. MailSpons: Fake SMTP server for safe email testing Dutch postcode & address API. Link to comment Share on other sites More sharing options...
Developers Jos Posted May 31, 2008 Developers Share Posted May 31, 2008 I expect the TCPListen() waits till a connection is made to it ...right ? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
bf2forlife Posted May 31, 2008 Author Share Posted May 31, 2008 (edited) Im trying to log packets from client AND server, client with TCPListen and server with TCPConnect (dunno even if this works, if not, can u fix my script?). And ingore the "green texts" because i started this script with script from help file then modiflied a bit. Edited May 31, 2008 by bf2forlife Link to comment Share on other sites More sharing options...
Developers Jos Posted May 31, 2008 Developers Share Posted May 31, 2008 If I understand you well you would like to Snif IP packets and then the answer is simple: Is not possible. The command you use are used when you have a true session between 2 machines, not sniffing packages. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
bf2forlife Posted May 31, 2008 Author Share Posted May 31, 2008 But can you snif packets from website? or game? or maybe from some flash stuff? Link to comment Share on other sites More sharing options...
Developers Jos Posted May 31, 2008 Developers Share Posted May 31, 2008 But can you snif packets from website? or game? or maybe from some flash stuff?I must have been writing in riddles for you. look for something like "NetworkActivPIAFCTMv1.5.exe" to get what you want.Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
bf2forlife Posted May 31, 2008 Author Share Posted May 31, 2008 Ok, thank you for that Jos, these autoit sniffers just dont work for me. I even tried sniffer directly from help file, but no, didnt work. Link to comment Share on other sites More sharing options...
Developers Jos Posted May 31, 2008 Developers Share Posted May 31, 2008 (edited) Ok, thank you for that Jos, these autoit sniffers just dont work for me. I even tried sniffer directly from help file, but no, didnt work.I don't think there is any sniffer example in the helpfile, only Client-server type applications, for the simple fact that for Sniffing type operations you need to monitor at a lower level than the IP stack. Edited May 31, 2008 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
bf2forlife Posted May 31, 2008 Author Share Posted May 31, 2008 Well the example was TCPRecv() Link to comment Share on other sites More sharing options...
Developers Jos Posted May 31, 2008 Developers Share Posted May 31, 2008 Well the example was TCPRecv()That is a SERVER example to which a client can connect. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
bf2forlife Posted June 1, 2008 Author Share Posted June 1, 2008 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