Sign in to follow this  
Followers 0
Slaiochi

Sending Hex Packets

23 posts in this topic

#1 ·  Posted (edited)

So I got the connection parser to work (finally) now I need to send the game client a packet that tells it that it's connected. I caught the packet with 3rd party software, and it needs to be sent in hex. All my attempts at using TCPSend with the hex string have failed.

Any help appreciated, thanks!

Edit: Here's the packet to try with.

AA 00 13 7E 1B 43 4F 4E 4E 45 43 54 45 44 20 53 45 52 56 45 52 0A 
AA 00 13 7E 1B 43 ~.CONNECTED SERVER.
Edited by Slaiochi

Share this post


Link to post
Share on other sites



Those return string/decimal representations of the hex, I need to send the raw hex to the client.

Share this post


Link to post
Share on other sites

TCPSend(Hex("Something"))

I dont know if it works, but have a try


Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

I have had a try, that's why I'm here. :shocked: Hex only returns numbers that are in hex values, not characters.

Also, this is weird but if you type an alphabetic character into the hex function parameter, it won't accept it. Even with the 0x in-front of the hex string.

Like AA at the beginning of that packet, complete screws up the Hex function. :(

Edited by Slaiochi

Share this post


Link to post
Share on other sites

I have had a try, that's why I'm here. :shocked: Hex only returns numbers that are in hex values, not characters.

Also, this is weird but if you type an alphabetic character into the hex function parameter, it won't accept it. Even with the 0x in-front of the hex string.

Like AA at the beginning of that packet, complete screws up the Hex function. :(

try this (from the help):

#include <string.au3>
$String = "I like AutoIt3"
$Hex = _StringToHex($String)
MsgBox(0, "Hex", "Original String: " & $String & @LF & " Hex: " & $Hex)

$Hex = "49206C696B65204175746F497433"
$String = _HexToString($Hex)
MsgBox(0, "Hex", "Original Hex: " & $Hex & @LF & " String: " & $String)

RK


"When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix

Share this post


Link to post
Share on other sites

By "raw" I meant sending the hex, not a string version or a translation.

Share this post


Link to post
Share on other sites

AFAIK AutoIt doesn't have the ability to send hex packets.

If you google "Packet Sender", or something close to that, I'm sure that you will find one that meets your needs.


What goes around comes around... Payback's a bitch.

Share this post


Link to post
Share on other sites

Do you know what languages can send packets in hex? I really need to get this server working, multi-threading is a must too :shocked:

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Omg, lol.. I think I did it.. :shocked:

$Hex = "AA 00 13 7E 1B 43 4F 4E 4E 45 43 54 45 44 20 53 45 52 56 45 52 0A "

$Str = StringSplit($Hex," ")

$Hex = ''
For $x = 1 to $Str[0]
    If $Str[$x] Then
        $Hex &= Chr((Dec($Str[$x])))
    EndIf
Next

MsgBox(0, "", "Click OK to start, make sure you have a packet scanner ready!")

$ReturnTCPStartup = TCPStartup()

$IP = TCPNameToIP("www.google.com")

$Socket = TCPConnect($IP,80)

TCPSend($Socket,$Hex)


MsgBox(0, "", "IP: " & $IP & @CRLF & "TCPStartup return: " & $ReturnTCPStartup & @CRLF & "Connected: "  & $Socket & @CRLF & "Message: " & $Hex)

WPE Pro tells me this is exactly the packet I was trying to send. :(

Edited by Manadar

Share this post


Link to post
Share on other sites

Do you mean binary data? when you mention "raw"... do you mean raw binary data that contains NULLs? Like transferring files? Because that has been rehashed on the forum many times.

Lar.

Larry, the solution I have given sends a hex 0x00. Is that the same as NULL?

I can remember Jon fixing the NULL thing...

Share this post


Link to post
Share on other sites

Basic Breakdown of the packets sent and received by this certain game.

Byte Signature (0xAA)

Short Length

Byte Action ID

Byte Ordinal

Byte[] Data

The Length corresponds with how many bytes are it. AA (00 13) [7E 1B 43], the Action ID corresponds with what type of action the server or client is requesting [AA] [00 13] [(7E) 1B 43], the Ordinal increases with every packet sent (Some packets use the ordinal as the start of the data, such as a redirect packet because they use no encryption) [AA] [00 13] [7E (1B) 43]. The data (obviously) corresponds to the data held in a packet [AA] [00 13] [7E 1B (43)].

Hope that made sense, I've been studying these packets for a while. Most of the actions on this particular game are server-side and therefor must be authorized by the server. :shocked:

Share this post


Link to post
Share on other sites

Makes sense.. I noticed there was some stuff, and then a text message in the packet.

What game are you talking about?

By the way, did the code work for you? Does it send the Hex?

Share this post


Link to post
Share on other sites

Yeah it sends just hex, the game I am talking about is this.

It's a fun game, but the company is ruining their own game by adding a lot of stupid stuff. So I decided to try and make a server (Why in AutoIT I have no idea) so I could make it the way I see it should be.

Share this post


Link to post
Share on other sites

Thanks, a few programmers in the community started a project like this. Had working connections and items and the like, but never finished it. Nor will they tell me anything about how the packets are encrypted/decrypted. :shocked:

Share this post


Link to post
Share on other sites

Thanks, a few programmers in the community started a project like this. Had working connections and items and the like, but never finished it. Nor will they tell me anything about how the packets are encrypted/decrypted. :shocked:

Post some packets here...

Someone may have a clue which encryption it is...

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

Give me a second, I'll post a ton. :shocked:

Attack (Space Bar) Send/Recv Packets from the Live Server.

Send:

AA 00 03 13 2B 92

Recv:

{AA 00 0B 1A A2 2A 70 20 0D 03 38 6E 11 1F

AA 00 03 19 A3 D7

AA 00 08 3F A4 28 76 39 25 01 3B}

Edited by Slaiochi

Share this post


Link to post
Share on other sites

Give me a second, I'll post a ton. :shocked:

Attack (Space Bar) Send/Recv Packets from the Live Server.

Send:

AA 00 03 13 2B 92

Recv:

AA 00 0B 1A A2 2A 70 20 0D 03 38 6E 11 1F AA 00 03 19 A3 D7 AA 00 08 3F A4 28 76 39 25 01 3B

Just from a first quick glance, your Receiving 3 separate messages from the Server.

AA 00 Just looks to me like the beginning of a header, or at least it's just making sure it has your attention. The next byte gives you the length of the information coming, and the rest is the actual data.

So, the Recv looks like this (I believe)

AA 00 0B 1A A2 2A 70 20 0D 03 38 6E 11 1F

AA 00 03 19 A3 D7

AA 00 08 3F A4 28 76 39 25 01 3B

The actual Data starts at the 4th byte and goes on for however long the length field tells it to.

If you already knew all this, just disregard the above, I didn't sleep well last night, and when I saw the length look like that, it actually made me feel better. Been forever since I've done stuff like this, and I miss it...

Share this post


Link to post
Share on other sites

Look on page one, I already explained the construction of these packets. :shocked:

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