Jump to content

Need some help with tcp.. Binary wont work


au3scr
 Share

Recommended Posts

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

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[[

?

Link to comment
Share on other sites

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
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...