Server Side Handshake Packet

08/11/2012 03:09 sarkoplata#1
Hello,
I am trying to make some kind of gateway server for silkroad. It's not exactly a gateway server, a part of it. It will work until 0xA101 (Serverlist packet.)
I know the structure of gateway packets. But thanks to drew, i've never been busy with handshake (0x5000) packet. But now i have to find out how its made. I know the structure (thanks to lesderid, see: [Only registered and activated users can see links. Click Here To Register...]). But i do not know what i should write for following:

Code:
[BYTE][8]   Initial Blowfish Key
[DWORD]	Security Count Seed
[DWORD]	Security CRC Seed
[DWORD]	Additional Seed (1)
[DWORD]	Additional Seed (2)
[DWORD]	Additional Seed (3)
[DWORD]	Additional Seed (4)
[DWORD]	Additional Seed (5) 

[BYTE][8]	New Blowfish Key Base
I tried a static value, (capturing as normal GatewayServer does and send it) but the client falls. On every connection the blowfish is different. I wanna know how its built.

And something strange, I checked some open-source emulator codes. None of them ever cared of handshake! How they supposed to work, i did not understand :)

Thanks! :)
08/11/2012 06:51 pushedx#2
My C# [Only registered and activated users can see links. Click Here To Register...] implements both client and server sides of the entire protocol. You can take a look at my [Only registered and activated users can see links. Click Here To Register...] for an example of how a GatewayServer could be setup. You would need to do more packet checks, since that was a simple example showing the image code, but the base is there.

For the technical details on everything, you can take a look at my "[Only registered and activated users can see links. Click Here To Register...]" article. That version was not updated with a few mistakes (such as 0x7FF vs 0x7FFF), but it's ok since the code is done in the C# API.
08/11/2012 12:20 Schickl#3
You can disable encryption and thus that handshake by sending the 5000 packet with one byte set to 1 as content

Then you don't need to worry about handling encrypted packets and that stuff
08/11/2012 15:20 sarkoplata#4
Quote:
Originally Posted by pushedx View Post
My C# [Only registered and activated users can see links. Click Here To Register...] implements both client and server sides of the entire protocol. You can take a look at my [Only registered and activated users can see links. Click Here To Register...] for an example of how a GatewayServer could be setup. You would need to do more packet checks, since that was a simple example showing the image code, but the base is there.

For the technical details on everything, you can take a look at my "[Only registered and activated users can see links. Click Here To Register...]" article. That version was not updated with a few mistakes (such as 0x7FF vs 0x7FFF), but it's ok since the code is done in the C# API.
EDIT:
Nevermind. I killed the encryption as Schickl said. Works fine!

Thanks. I've used your SilkroadSecurityApi and now I can connect and receive ServerList (0xA101) (I have coded until it yet, nothing at all) with my clientless which uses SilkroadSecurityApi aswell. But other stat tools stuck after ImageCodeServer sends the 0x2001 GatewayInfo packet. Why do you think it can be because of?
08/14/2012 14:01 pushedx#5
Depends on the stats tool and which version of ISRO they target. Old ISRO used two shorts for current/max capacity while new ISRO uses a single float for capacity ratio. That would be one thing to check.

If you aren't using ISRO, contentid 18, then some versions require other special bytes depending on which contentid it is.

Other than that, no, you'd have to check each tool to see why. Add simple logging to the program see if the tools get the packets and can't process them, or they don't get the packets in the first place.