Jump to content

Packet log


Recommended Posts

#include <GUIConstants.au3>
Opt("GUIOnEventMode", 1)
$Form1 = GUICreate("Packets", 1000, 700, 193, 125)
$Edit1 = GUICtrlCreateInput("", 100, 90, 780, 580)
GUISetState(@SW_SHOW)
TCPStartup()
Do
    $main_socket = TCPListen('127.0.0.1', 12312)
Until $main_socket > 0
Do
    $clt_socket = TCPAccept($main_socket)
Until $clt_socket > 0

$string &= "Connected to client" & @CRLF
GUICtrlSetData($Edit1, $string)

Do
    $svr_socket = TCPConnect("12.34.56.78",12313)
Until $svr_socket > 0

$string &= "Connected to server" & @CRLF
GUICtrlSetData($Edit1, $string)

While 1
        $Recv = TCPRecv($svr_socket,4096)
        If $Recv  Then
            $byte = TCPSend($clt_socket,$Recv)
            $string &= "[" & $byte & "B][ToClient]:" & Hex($Recv) & @CRLF
            GUICtrlSetData($Edit1, $string)
        EndIf
        
        $Recv = TCPRecv($clt_socket,4096)
        If $Recv  Then
            $byte = TCPSend($svr_socket,$Recv)
            $string &= "[" & $byte & "B][ToServer]:" & Hex($Recv) & @CRLF
            GUICtrlSetData($Edit1, $string)
        EndIf
WEnd

When i try to use this, nothing will appear in Input box. Where is the problem?

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...