Jump to content
Sign in to follow this  
AceLoc

Packet sender.

Recommended Posts

HotKeySet("^{F2}", "_Quit")
TCPStartUp ()

$g_IP = InputBox("Internet Protocol (IP):", "IP:", "", "", 100, 10)
$g_Port = InputBox("TCP Port:", "Port:", "", "", 100, 10)
Dim $szIPADDRESS = $g_IP
Dim $nPORT = $g_Port
Dim $ConnectedSocket = -1
Dim $szData = GeneratePacket(8)

$ConnectedSocket = TCPConnect ($szIPADDRESS, $nPORT)

While 1
    TCPSend ($ConnectedSocket, $szData)
    If Not @error Then
        ;MsgBox(0, "Succeed:", "Packet Sended")
    Else
        MsgBox(0, "Error:", "Unable To Sent Packet")
        ExitLoop
    EndIf
WEnd

Func GeneratePacket($bits)
    Local $packet
    For $x = 0 To $bits
        $packet &= Random(0, 1, 1)
    Next
    Return $packet
EndFunc   ;==>GeneratePacket

Func _Quit()
    Exit
EndFunc   ;==>_Quit

Is it possible to increase the size of those packets? :lmao:

Thnk :ph34r:

Edited by AceLoc

[quote name='AceLoc']I gots new sunglasses there cool.[/quote]

Share this post


Link to post
Share on other sites

HotKeySet("^{F2}", "_Quit")
TCPStartUp ()

$g_IP = InputBox("Internet Protocol (IP):", "IP:", "", "", 100, 10)
$g_Port = InputBox("TCP Port:", "Port:", "", "", 100, 10)
$g_Size = InputBox("Size (in Bits):", "Size:", "", "", 100, 10)
Dim $szIPADDRESS = $g_IP
Dim $nPORT = $g_Port
Dim $ConnectedSocket = -1
Dim $szData = GeneratePacket($g_Size)

$ConnectedSocket = TCPConnect ($szIPADDRESS, $nPORT)

While 1
    TCPSend ($ConnectedSocket, $szData)
    If Not @error Then
        ;MsgBox(0, "Succeed:", "Packet Sended")
    Else
        MsgBox(0, "Error:", "Unable To Sent Packet")
        ExitLoop
    EndIf
WEnd

Func GeneratePacket($bits)
    Local $packet
    For $x = 0 To $bits
        $packet &= Random(0, 1, 1)
    Next
    Return $packet
EndFunc   ;==>GeneratePacket

Func _Quit()
    Exit
EndFunc   ;==>_Quit

so this will work fine? :lmao:


[quote name='AceLoc']I gots new sunglasses there cool.[/quote]

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  

×
×
  • Create New...