Jump to content
Sign in to follow this  
au3scr

Need some help with tcp.. Binary wont work

Recommended Posts

au3scr

Can someone convert this for tcp?I used tcpsend example from help but it didn.t work, I got errors.

I need to have script that sends binary tcp packets.

looks like this works, but I need someone to convert it for tcp.

;==============================================
UDPStartup()

; Open a "SOCKET"
;==============================================
$socket = UDPOpen("213.248.106.227", 4264)
If @error <> 0 Then Exit

$n=0
While 1
    Sleep(2000)
    $n = $n + 1
    $status = UDPSend($socket, Binary("0CAB149310") )
    If $status = 0 then 
        MsgBox(0, "ERROR", "Error while sending UDP message: " & @error)
        Exit
    EndIf
WEnd

Func OnAutoItExit()
    UDPCloseSocket($socket)
    UDPShutdown()
EndFunc
Edited by au3scr

Share this post


Link to post
Share on other sites
azure

Can someone convert this for tcp?I used tcpsend example from help but it didn.t work, I got errors.

I need to have script that sends binary tcp packets.

looks like this works, but I need someone to convert it for tcp.

;==============================================
UDPStartup()

; Open a "SOCKET"
;==============================================
$socket = UDPOpen("213.248.106.227", 4264)
If @error <> 0 Then Exit

$n=0
While 1
    Sleep(2000)
    $n = $n + 1
    $status = UDPSend($socket, Binary("0CAB149310") )
    If $status = 0 then 
        MsgBox(0, "ERROR", "Error while sending UDP message: " & @error)
        Exit
    EndIf
WEnd

Func OnAutoItExit()
    UDPCloseSocket($socket)
    UDPShutdown()
EndFuncoÝ÷ Ûú®¢×ºÚ"µÍÏOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOBÔÝ

BÈÜ[H ][ÝÔÓÐÒÑU ][ÝÂÏOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOBÌÍÜÛØÚÙ]HÔÛÛXÝ
    ][ÝÌLËL
É][ÝË

BYÜ    ÉÝÈ[^]ÌÍÛLÚ[HBÛY

B   ÌÍÛH ÌÍÛ
ÈB ÌÍÜÝ]ÈHÔÙ[
    ÌÍÜÛØÚÙ][J   ][ÝÌÐPMLÌL  ][ÝÊH
BY  ÌÍÜÝ]ÈH[ÙÐÞ
    ][ÝÑTÔ][ÝË ][ÝÑÜÚ[HÙ[[ÈÔYÜØYÙN   ][ÝÈ  [ÈÜB^][YÑ[[ÈÛ]]Ò]^]

BÔÛÜÙTÛØÚÙ]
    ÌÍÜÛØÚÙ]
BÔÚ]ÝÛ
B[[

?

Share this post


Link to post
Share on other sites
au3scr

tnx, buttrere is still something wrong.I dont know what but when game sends packets, SmartSniff shows me 00000000 3C 2A 00 00 00 FF FF FF FF

but when my script sends packet, SmartSniff shows 3C26000000FFFFFFFF.

How I make tis script send packets like game does so I could use script to make my char do something?

Here is picture about how game sends packet

Posted Image

And here is picture how same hing is done in my script.

Posted Image

My script

;==============================================
TCPStartup()

; Open a "SOCKET"
;==============================================
$socket = TCPConnect("213.248.106.227", 4000)
If @error <> 0 Then Exit

$n=0
While 1
    Sleep(4000)
    $n = $n + 1
    $status = TCPSend($socket, Binary("3C26000000FFFFFFFF") )
    If $status = 0 then
        MsgBox(0, "ERROR", "Error while sending TCP message: " & @error)
        Exit
    EndIf
WEnd

Func OnAutoItExit()
    TCPCloseSocket($socket)
    TCPShutdown()
EndFunc

here is little table:

Nō. Size Parameters

3c 9 [WORD skill] 00 [bYTE left (80) or right (00) skill] FF FF FF FF

it seems like I have to use WORD and BYTE but how I do it in autoit?

Look this, if it write

$status = TCPSend($socket, Binary("string lol") )

it sends packet

string lol

so binary() dont work, it dont tell autoit to handle expression ass binar data, autoit handles t as string.

Edited by au3scr

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.