[AutoIT] Sending Packets Help

08/18/2011 15:09 ZeraPain#46
in your example 0E 06 is the x pos.
now you have to reverse it and change it to decimal.
with autoit it would be Dec("060E")
08/18/2011 20:50 Little Hole#47
Can anyone help to understanding the packet bytes??

09 00 21 70 62 18 01 4C 6A 0E 06 01 00 BE 02
08/18/2011 21:10 kevin_owner#48
09 00 21 70 62 18 01 4C 6A 0E 06 01 00 BE 02

is the movement packet from the C -> S this packet looks like this when you parse it:
Code:
09 00 // Packet Size. Remember the silkroad header is 6 bytes this is the data size
21 70 // Opcode
62 18 // Security bytes
01 // Movement flag 1 for groundwalk and 0 for skywalk
4C // X Section
6A // Y Section
0E 06  // X Position
01 00 // Z Position
BE 02 // Y Position
08/18/2011 22:00 Little Hole#49
Quote:
Originally Posted by kevin_owner View Post
09 00 21 70 62 18 01 4C 6A 0E 06 01 00 BE 02

Code:
62 18 // Security bytes
Thanks for reply
but i know the security bytes can be 0x0100 0x0200 0x0300 0x0400

and for the C->S non-encrypted packet security bytes must be 0x0100!!!

could u explain more how the 62 18 is the security byte?

Thank You
08/18/2011 22:17 ZeraPain#50
depends on your proxy.
08/18/2011 23:05 Little Hole#51
Quote:
Originally Posted by ZeraPain View Post
depends on your proxy.

This is the original packet structure i receive with Wire SHark !!!!
08/18/2011 23:18 ZeraPain#52
well the proxy gives you securitybytes containing e.g. 0x01 or 0x02 so that your program/bot knows if the packet was sent from the server or the client but if you sniff them with wireshark it may give you different securitybytes
08/18/2011 23:37 kevin_owner#53
There isn't a simple formula too calcuate the security bytes. You'll need to know some things which gets generated during the handshake process at the beginning of the connection.

The SilkroadSecurityApi by drew benton handles the handshake process and security bytes. so you could take a look at that.

So too generate the correct security bytes and not to forget too encrypt packets you'll need a proxy. Well the easiest solution is too use srproxy or phconnector and create a program which connects too that proxy so you can send your own packets.
10/10/2012 22:47 scameris#54
Hey Guys!

First, I would like to thank you all for creating this amassing post! It helped me to understand the way autoit works, also how to inject packets, receive them and make lots of nice tools with this knowledge!

So doing my interest to this stuff, I figure out to make small tool, for alchemy. I used codes from one done tool called Fuse-O-Mat. It works nice and simple. I also used code from DeXeee, the one to sit down the char, also inject other packets!
Big thanks for Synx7, for showing us [Only registered and activated users can see links. Click Here To Register...] link, it helped me a lot with translating binary codes!

So now, in the process of making this tool, I got stuck in few places. My idea is to create tool, that can use alchemy stones to get high % status on your item. I manage to inject packet and make simple loop. Now I am trying to build up function that would stop the scrip if result is <= to result that I was thinking to get on the tool.

First thing I started is to capture and analyze packets. From Fuse-O-Mat tool I gain this:

The packet of alchemy for + the items:

Code:
[S -> C][B150]
01
02
01
11
00 00 00 00
D8 2A 00 00
01   <<< result. its +1.
05 CA 97 52 03 00 00 00
D2 00 00 00
06
35 00 00 00 06 00 00 00
49 00 00 00 08 00 00 00
4F 00 00 00 08 00 00 00
67 00 00 00 3C 00 00 00
73 00 00 00 64 00 00 00
5B 00 00 00 78 00 00 00
01
00
02
00
01
And here is code that been done for this packet:
Code:
;If $opcode = "B150" then ;Alchemy Result
		If $opcode = $result_packet then

			$ok    = ParseByte() ;->01
			if $ok= "01" then
				$dummy = ParseByte() ;->02
				$dummy = ParseByte() ;->01
				$iPos  = ParseByte() ;->11
				$dummy = ParseDWord() ; 00 00 00 00
				$iId   = ParseDWord() ;
				Global $plus  = ParseByte() ;->01

				GUICtrlCreateListViewItem(@HOUR&":"&@MIN&":"&@SEC&" - Item is +"&$plus, $liste)
				_GUICtrlListView_Scroll($liste,0,20)
So basically its very logical, he just skip unnecessary bites and words til the place, when he gets result byte (called $plus), when use that to show result in the GUI list, so used in the interface can see result.
But my problem is, that stones give me result as qword, and it is placed in different place of the packet, so I cannot use that kind of logic to make new code... Here is example of 2 different items:
Code:
[S -> C][B151]
01
02
01
0D
00 00 00 00
66 39 00 00
05
6D 01 00 00 00 00 00 00
00 00 00 00
06
49 00 00 00 08 00 00 00
4F 00 00 00 08 00 00 00
A9 00 00 00 14 00 00 00
B5 00 00 00 0A 00 00 00
BB 00 00 00 05 00 00 00
AF 00 00 00 14 00 00 00  <<<< result of alchemy (20%), if counting from hex > ASCII, 14 = 20. And its only spot that it changes.
01
00
02
00

And here is another item, same stone!

[S -> C][B151]
01
02
01
0D
00 00 00 00
18 3A 00 00
05
AD 01 00 00 00 00 00 00
00 00 00 00
06
17 00 00 00 0A 00 00 00  <<<< result of alchemy (10%)
29 00 00 00 01 00 00 00
49 00 00 00 08 00 00 00
4F 00 00 00 08 00 00 00
A9 00 00 00 14 00 00 00
BB 00 00 00 14 00 00 00
01
00
02
01
00
D0 65 00 00 02 00 00 00
So as you can see, using same stone, but different items, result packet gives the result in different locations on every different item... I was thinking maybe I can do some kind of search command, to find the right Qword, so I can see result, and script would stop once it gets = or < result.

Can someone help me with that, and give me some ideas. So I could learn more about autoit coding, and making tools for sro! :)

Thx all!