[Workshop] Updating code to work post client V.5018

01/28/2009 22:08 © Haydz#91
What exactly is it your having problems with anyway?
01/29/2009 12:05 Hyberkill#92
im not sure what i should send... tanelipe said i should change the buffer recieved from the client right? n then resend it (after i created the server key) so i do that... but i dont recieve anything coz i havent changed the buffer at all(i resend it the way i recieve it)... (i found out what i should change but im not sure with what) So... i need to change it to something to indicate that i recieved it
01/29/2009 12:39 tanelipe#93
For server :

When you connect to the game server, you send the ServerKeyPacket to the client and you will also have to add "TQServer" to the end of the packet, last 8 bytes. Then you send the Buffer that has all these information stored (ClientIV, ServerIV, P, G, PublicKey, "TQServer") And when you do this, the next packet you get from Client is the ClientKeyPacket, you process it and do the exchange.
01/30/2009 17:59 Hyberkill#94
ill try it. Hope ill succeed :) You're so helpfull always... ty so much ! Haydz n unknownman too !!
02/02/2009 01:56 unknownone#95
Can we just ignore the troll from now on, k?

Hyberkill: Nobody is going to do it for you. You're never going to do it yourself if you're just taking shots in the dark either. The conecpt of server emulation is to analyse what an original server does, and copy it. If you lack the basic understanding of how the server and client communicate you have your hobbies mixed up.

I originally discussed using the key exchange process with a proxy for a reason: you need to use one to analyse the data that the server and client are sending, before encryption. Creating a proxy will allow you to log and interpret the information before attempting to blindly put it into a server.

Log packets. Clone packets. Send packets. That's all there is to it. Make your proxy print out marshalled packets in Hexadecimal, make your server do the same for all packets received and sent. If the ones in your server don't match those logged in your proxy, you're doing something wrong. Atleast, this way, you know WHERE you're doing something wrong.

Now, please stop trolling my thread. Go study what you need to elsewhere and come back here when you're capable.
02/02/2009 12:32 tanelipe#96
(P.S In your example where you handle the handshake reply the EncryptIV and DecryptIV are the wrong way around, well atleast it was not decrypting properly the first 4/8 bytes.)

Oh and to the others, there are couple things wrong with the ServerKeyPacket (Or ClientKeyPacket, forgot which one) re-read what unknowone said about the structure in the post on first page and you'll figure it out.
02/02/2009 20:25 Hyberkill#97
i made the buffer exactly like the one at coemuv2... n yet it still gives the exception.
02/02/2009 21:25 © Haydz#98
Quote:
Originally Posted by Hyberkill View Post
i made the buffer exactly like the one at coemuv2... n yet it still gives the exception. I just dont know what im doing wrong( with exactly i dont mean i cloned the packet n resend to my client.. i mean its packet structure is the same... with the TQServer string at the end of the Publickey n the publickey being generated automatically) I made a lill program that captures the packets in hex strings n then converts to byte array n decrypts it with your method n show it on the console. This way i checked the diferences between coemuv2 keyexchange n the server im trying to work with's exchange. I knew the program worked coz it successfully decrypted the P n G hex strings which means the rest should be decrypted n all is fine, although that exception keeps getting on my nerve. Please tell me what im doing wrong? My guess is the clientiv n serveriv


[Only registered and activated users can see links. Click Here To Register...]
So guide me through what your actually doing, tryna identify where your going wrong here...
02/02/2009 21:57 Hyberkill#99
Although the client still shows "Connecting to game server" non packet is recieved afterwards.. (i should recieve the client responce to that serverkeypacket n then handleclientkeypacket... but i dont recieve anything). Thats the problem.
02/02/2009 22:17 unknownone#100
Try subtracting 8 frrom the length field before yu write it to ServerKeyPacket. The length shouldn't include "TQServer" padding.
02/02/2009 23:05 Hyberkill#101
ty ill try.
02/03/2009 00:01 andyd123#102
Quote:
Originally Posted by Hyberkill View Post
ty ill try. I also noticed that the header of all the packets i recieve from coemuv2 is the same n diferent than the one i generate. Also their packet length is always 373 n ours keep changing coz of the random byte lengths. Would that cause any troubles? I did it. Should i subtract the junk length also? Coz it doesnt want to work still
Indeed the length is fixed at 373, simply because I set random data to always be an exact length rather then something randomly sized. Either way will work.


Setting the junk len to be 12 and using this size int will give you the correct length of the packet:

int size = 47 + P.Length + G.Length + ServerPublicKey.Length + 12 + 8 + 8;
02/03/2009 14:19 Hyberkill#103
interesting... i dont seem to get the lengths of the strings in the packet.. although unknownman's serverkey writes em to the buffer as a uint32
02/03/2009 14:26 unknownone#104
The packet you posted in that image ([Only registered and activated users can see links. Click Here To Register...])
Is correct, except the length of it (0x16A) at offset 10 should be 8 less (0x162).
02/03/2009 17:11 Hyberkill#105
did everything you guided me (ty for that) n yet it didnt work :(