Slaiochi Posted April 3, 2007 Share Posted April 3, 2007 (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 April 3, 2007 by Slaiochi Link to comment Share on other sites More sharing options...
Shevilie Posted April 3, 2007 Share Posted April 3, 2007 Thoe two might help youhttp://www.autoitscript.com/autoit3/docs/functions/Hex.htmhttp://www.autoitscript.com/autoit3/docs/functions/Dec.htm Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit Link to comment Share on other sites More sharing options...
Slaiochi Posted April 3, 2007 Author Share Posted April 3, 2007 Those return string/decimal representations of the hex, I need to send the raw hex to the client. Link to comment Share on other sites More sharing options...
Shevilie Posted April 3, 2007 Share Posted April 3, 2007 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 Link to comment Share on other sites More sharing options...
Slaiochi Posted April 3, 2007 Author Share Posted April 3, 2007 (edited) I have had a try, that's why I'm here. 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 April 3, 2007 by Slaiochi Link to comment Share on other sites More sharing options...
rbhkamal Posted April 3, 2007 Share Posted April 3, 2007 I have had a try, that's why I'm here. 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 Link to comment Share on other sites More sharing options...
Slaiochi Posted April 4, 2007 Author Share Posted April 4, 2007 By "raw" I meant sending the hex, not a string version or a translation. Link to comment Share on other sites More sharing options...
Kickassjoe Posted April 4, 2007 Share Posted April 4, 2007 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. Link to comment Share on other sites More sharing options...
Slaiochi Posted April 4, 2007 Author Share Posted April 4, 2007 Do you know what languages can send packets in hex? I really need to get this server working, multi-threading is a must too Link to comment Share on other sites More sharing options...
jvanegmond Posted April 4, 2007 Share Posted April 4, 2007 (edited) Omg, lol.. I think I did it.. $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 April 4, 2007 by Manadar github.com/jvanegmond Link to comment Share on other sites More sharing options...
jvanegmond Posted April 4, 2007 Share Posted April 4, 2007 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... github.com/jvanegmond Link to comment Share on other sites More sharing options...
Slaiochi Posted April 4, 2007 Author Share Posted April 4, 2007 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. Link to comment Share on other sites More sharing options...
jvanegmond Posted April 4, 2007 Share Posted April 4, 2007 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? github.com/jvanegmond Link to comment Share on other sites More sharing options...
Slaiochi Posted April 4, 2007 Author Share Posted April 4, 2007 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. Link to comment Share on other sites More sharing options...
jvanegmond Posted April 4, 2007 Share Posted April 4, 2007 Good initiative. github.com/jvanegmond Link to comment Share on other sites More sharing options...
Slaiochi Posted April 4, 2007 Author Share Posted April 4, 2007 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. Link to comment Share on other sites More sharing options...
jvanegmond Posted April 4, 2007 Share Posted April 4, 2007 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. Post some packets here...Someone may have a clue which encryption it is... github.com/jvanegmond Link to comment Share on other sites More sharing options...
Slaiochi Posted April 4, 2007 Author Share Posted April 4, 2007 (edited) Give me a second, I'll post a ton. 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 April 4, 2007 by Slaiochi Link to comment Share on other sites More sharing options...
SkinnyWhiteGuy Posted April 4, 2007 Share Posted April 4, 2007 Give me a second, I'll post a ton. Attack (Space Bar) Send/Recv Packets from the Live Server.Send:AA 00 03 13 2B 92Recv: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 3BJust 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 1FAA 00 03 19 A3 D7AA 00 08 3F A4 28 76 39 25 01 3BThe 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... Link to comment Share on other sites More sharing options...
Slaiochi Posted April 4, 2007 Author Share Posted April 4, 2007 Look on page one, I already explained the construction of these packets. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now