Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Programming
You last visited: Today at 09:51

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Server Key Exchange Packet (SKE)

Discussion on Server Key Exchange Packet (SKE) within the CO2 Programming forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Dec 2007
Posts: 108
Received Thanks: 42
Server Key Exchange Packet (SKE)

Something bizarre has happened. My private proxy which was working perfectly has developed a bug seemingly overnight.

Debugging shows that the client disconnects after my proxy sends the SKE packet. I did not alter my code so I checked the packet that the server sends me initially and was surprised to see that the server's public key (SPK) is only 126 bytes (which translates to a 63-byte BigNumber).

Now the client's public key is 128 bytes, as expected, so I'd like to know if the SPK was always 126 bytes. Strangely enough though when my proxy does send a SKE packet which is 2 bytes longer than what I received to the client, it disconnects all the same.

Code:
private void HandleServerKeyExchangePacket(byte[] packet)
{
	int keyOffset;

	using (BinaryReader br = new BinaryReader(new MemoryStream(packet)))
	{
		byte[] padding = br.ReadBytes(11);
		int realSize = br.ReadInt32(); // size - padding
		byte[] junk = br.ReadBytes(br.ReadInt32());
		this.ClientIV = br.ReadBytes(br.ReadInt32());
		this.ServerIV = br.ReadBytes(br.ReadInt32());
		this.P = Encoding.ASCII.GetString(br.ReadBytes(br.ReadInt32()));
		this.G = Encoding.ASCII.GetString(br.ReadBytes(br.ReadInt32()));				
		var keyLength = br.ReadInt32();
		keyOffset = (int)(br.BaseStream.Position);
		this.ServerPublicKey = Encoding.ASCII.GetString(br.ReadBytes(keyLength));
		var seal = Encoding.UTF7.GetString(br.ReadBytes(8));
	}

	this.ServerProxyExchange.P = BigNumber.FromHexString(P);
	this.ServerProxyExchange.G = BigNumber.FromHexString(G);
	this.ServerProxyExchange.GenerateKeys(); // generate Proxy public Key (PPK) and Secret Key (PSK)
	this.ServerProxySharedKey = ServerProxyExchange.ComputeKey(BigNumber.FromHexString(this.ServerPublicKey));

	var ppk = Encoding.ASCII.GetBytes(this.ProxyPublicKey);
	Array.Copy(ppk, 0, packet, keyOffset, ppk.Length);
	packet = this.ServerCrypto.Encrypt(packet);

	this.ServerCrypto.SetKey(this.ServerProxySharedKey);
	this.ServerCrypto.EncryptIV = this.ServerIV;
	this.ServerCrypto.DecryptIV = this.ClientIV;

	this.ClientState.Socket.Send(packet);
}
Belth is offline  
Old 01/11/2011, 03:05   #2
 
elite*gold: 0
Join Date: Jun 2006
Posts: 457
Received Thanks: 67
always 128 from what i see.
shitboi is offline  
Old 01/11/2011, 04:06   #3
 
gabrola's Avatar
 
elite*gold: 0
Join Date: Dec 2006
Posts: 1,039
Received Thanks: 1,335
TQ sometimes randomly does that on some servers, tell me which server you are trying this on.
gabrola is offline  
Thanks
1 User
Old 01/11/2011, 05:17   #4
 
elite*gold: 0
Join Date: Dec 2007
Posts: 108
Received Thanks: 42
Quote:
Originally Posted by gabrola View Post
TQ sometimes randomly does that on some servers, tell me which server you are trying this on.
Virgo

Edit:

Ok you were right it is happening on virgo and I fixed the code to create a new packet instead of just copying over the key. The randomness of the event just got to me at first.
Belth is offline  
Reply


Similar Threads Similar Threads
exchange gold to silk and exchange gold ^^
07/27/2011 - Silkroad Online Trading - 37 Replies
Liking the title, we can help you exchange gold to silk (epin-card).what's more?we can also help you exchange gold from one server to another server . contact ways: Email/MSN: [email protected] Yahoo! Messenger: [email protected] AOL AIM: [email protected] Skype:
WTS GOLD OASIS SERVER OR EXCHANGE OTHER SERVERS
02/23/2010 - Silkroad Online Trading - 4 Replies
I have 2 bil gold on Oasis server. I am looking to sell it or to trade on other servers ELDORADO / VENICE only [email protected]
MS Office Outlook Web Access @ Exchange Server 03
10/27/2006 - Technical Support - 0 Replies
I'm currently studying this program and I need someone to answer me some questions, explain functions/program internal routines and stuff. I do NOT need any lamers not knowing what they do and guessing around. I'm sure you have to be an Exchange addicted freak ... kinda. Thanks.



All times are GMT +1. The time now is 09:52.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.