Sign in to follow this  
Followers 0
TrueNoob

Need Help with starting a package sniffer

1 post in this topic

Hi,

I have been trying to write a au3 script that can connect to an already established tcp connection and to receive a copy of the packages that are being send across that connection like with winpcap. My knowledge in networking programming is very limited to none.

Right now I am having a problem trying to get tcplisten to work. I keep on getting the 10049 error and I don't know how to fix it.

#include <GUIConstants.au3>

Dim $IPADDRESS = "64.151.91.149"

Dim $PORT = 30000

TCPStartUp()

$MainSocket = TCPListen($IPADDRESS, $PORT)

If @error = 1 Then

MsgBox(0, "Error", "IP is incorrect", 1)

ElseIf @error = 2 Then

MsgBox(0, "Error", "Port is incorrect", 1)

Else

MsgBox(0, "Error", @error, 1)

EndIf

; If the Socket creation fails, exit.

If $MainSocket = -1 Then

;MsgBox(0, "Error", "Failed to create a socket", 1)

Exit

EndIf

...

the program runs fine with an ip that isn't already established but if the ip is already established I would get the 10049 error...

I think I am approaching this problem the wrong way... It would be awesome if you could give me an example or describe how I can accomplish it.

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  
Followers 0