Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 01:20

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

Advertisement



Client Handshake Problem

Discussion on Client Handshake Problem within the CO2 Private Server forum part of the Conquer Online 2 category.

Closed Thread
 
Old   #1
 
elite*gold: 20
Join Date: Apr 2008
Posts: 2,281
Received Thanks: 912
Client Handshake Problem

I'm having a problem with the Client Handshake and the ClientKeyPacket.

Login is fine, when I recieve the game connection I send the ServerKeyPacket:
Code:
            byte[] Junk1 = new byte[11];
            byte[] Junk2 = new byte[5];
            Xio.Random.NextBytes(Junk1);
            Xio.Random.NextBytes(Junk2);
            COPacket P = new COPacket(68 + p.Length + g.Length + pub_key.Length);
            P.WriteBytes(Junk1);
            P.WriteUInt32(Convert.ToUInt32(P.Length - 11)); 
            P.WriteUInt32(5); 
            P.WriteBytes(Junk2); 
            P.WriteUInt32(Convert.ToUInt32(ClientIV.Length));
            P.WriteBytes(ClientIV);
            P.WriteUInt32(Convert.ToUInt32(ServerIV.Length));
            P.WriteBytes(ServerIV);
            P.WriteUInt32(Convert.ToUInt32(p.Length));
            P.WriteString(p);
            P.WriteUInt32(Convert.ToUInt32(g.Length));
            P.WriteString(g);
            P.WriteUInt32(Convert.ToUInt32(pub_key.Length));
            P.WriteString(pub_key);
            P.WriteString("TQServer");
            return P.Packet;
I'm supposed to get the ClientKeyPacket back from the client right?
Cause after I sent that I just get a blank packet and the client disconnects >.<

I'm using a 5095 client to test since it's the only one I have.

Any ideas?

EDIT:
Before it says Client Handshake Reply should be the dump of the received packet, but it's blank so it dumps nothing.
The error is caused because the packet is blank..
kinshi88 is offline  
Old 05/15/2010, 02:09   #2


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,125
Received Thanks: 2,518
If it helps this is how i used to do it:

Code:
        public static OutgoingPacket HandShakePacket(cnt Conn, string g, string p, string pub_key)
        {
            int Size = 47 + p.Length + g.Length + pub_key.Length + 12 + 8 + 8;
            Async_GameServer.MainBuff.Buff = new byte[Size];
            fixed (byte* lpBuffer = Async_GameServer.MainBuff.Buff)
            {
                *((uint*)(lpBuffer + 0)) = 3932315834;
                *((uint*)(lpBuffer + 4)) = 2592193404;
                *((byte*)(lpBuffer + 8)) = 69;
                *((ushort*)(lpBuffer + 9)) = 35628;
                *((uint*)(lpBuffer + 11)) = (uint)(Size - 11);
                *((uint*)(lpBuffer + 15)) = 10;
                *((uint*)(lpBuffer + 19)) = 4143858738;
                *((uint*)(lpBuffer + 23)) = 3801427934;
                *((ushort*)(lpBuffer + 27)) = 41236;
                *((uint*)(lpBuffer + 29)) = 8; // client_bf_data.length
                *((uint*)(lpBuffer + 41)) = 8; // server_bf_data.length

                *((int*)(lpBuffer + 53)) = p.Length;
                ushort Offset = 57;
                for (int i = 0; i < p.Length; i++)
                {
                    *((byte*)(lpBuffer + Offset)) = (byte)p[i];
                    Offset++;
                }
                *((int*)(lpBuffer + Offset)) = g.Length;
                Offset += 4;
                for (int i = 0; i < g.Length; i++)
                {
                    *((byte*)(lpBuffer + Offset)) = (byte)g[i];
                    Offset++;
                }
                *((int*)(lpBuffer + Offset)) = pub_key.Length;
                Offset += 4;
                for (int i = 0; i < pub_key.Length; i++)
                {
                    *((byte*)(lpBuffer + Offset)) = (byte)pub_key[i];
                    Offset++;
                }
                Offset += 2;
                string amend = "TQServer";
                for (int i = 0; i < amend.Length; i++)
                {
                    *((byte*)(lpBuffer + Offset)) = (byte)amend[i];
                    Offset++;
                }
            }
            OutgoingPacket OGP = new OutgoingPacket(Conn, Async_GameServer.MainBuff.Buff);
            Async_GameServer.MainBuff.ClearBuffer();
            return OGP;
        }
Ive noticed that between pub_key and TQServer theres a 2 byte filler on mine, although mines not exactly a correct structure lol.

The 5165 server source doesnt have that 2 byte filler on it however.

The next packet you receive does not have a fixed type or length, so you need to watch out for that.
Korvacs is offline  
Thanks
1 User
Old 05/15/2010, 03:07   #3
 
elite*gold: 20
Join Date: Apr 2008
Posts: 2,281
Received Thanks: 912
Alright, so I pretty much copy/pasted yours and it worked =P
My class for building packets must be ****** or something...
I shall fix that now!
Thank you very much!
kinshi88 is offline  
Old 05/15/2010, 18:45   #4
 
Unidentified's Avatar
 
elite*gold: 0
Join Date: May 2010
Posts: 3
Received Thanks: 0
Quote:
Originally Posted by kinshi88 View Post
Alright, so I pretty much copy/pasted yours and it worked =P
My class for building packets must be ****** or something...
I shall fix that now!
Thank you very much!
Don't tell me you couldn't figure out by reading a .NET exception? What happened to this forum
Unidentified is offline  
Old 05/15/2010, 19:15   #5


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,125
Received Thanks: 2,518
Quote:
Originally Posted by Unidentified View Post
Don't tell me you couldn't figure out by reading a .NET exception? What happened to this forum
...You didnt reallly read what he said did you?

The reason for the exception was because the client was replying to his handshake packet with a blank packet, and his problem was that his handshake packet was not being correctly made and the client was not responding correctly.

So the problem was not the exception, the exception is a result of the problem. The exception had nothing to do with the problem in this case.

Korvacs is offline  
Old 05/15/2010, 19:20   #6
 
Unidentified's Avatar
 
elite*gold: 0
Join Date: May 2010
Posts: 3
Received Thanks: 0
Quote:
Originally Posted by Korvacs View Post
...You didnt reallly read what he said did you?

The reason for the exception was because the client was replying to his handshake packet with a blank packet, and his problem was that his handshake packet was not being correctly made and the client was not responding correctly.

So the problem was not the exception, the exception is a result of the problem. The exception had nothing to do with the problem in this case.

I guess .NET offers the oppurtinity to use breakpointing, both ways he should of debugged the problem before posting. And there is no argueing in that.
Unidentified is offline  
Old 05/15/2010, 22:57   #7
 
elite*gold: 20
Join Date: Apr 2008
Posts: 2,281
Received Thanks: 912
Ugh, yes I knew exactly what the problem was, as I said in my post.
But I wasn't sure if it was the ServerKeyPacket's structure or my Packet builder.
So plz, gtfo =D
kinshi88 is offline  
Thanks
1 User
Old 05/15/2010, 23:34   #8
 
Unidentified's Avatar
 
elite*gold: 0
Join Date: May 2010
Posts: 3
Received Thanks: 0
Quote:
Originally Posted by kinshi88 View Post
Ugh, yes I knew exactly what the problem was, as I said in my post.
But I wasn't sure if it was the ServerKeyPacket's structure or my Packet builder.
So plz, gtfo =D
Again, you could debug it yourself hardly dumping the packet eh?
Unidentified is offline  
Old 05/15/2010, 23:42   #9
 
ImmuneOne's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 754
Received Thanks: 544
Quote:
Originally Posted by Unidentified View Post
Again, you could debug it yourself hardly dumping the packet eh?
Drop the attidude.

Quote:
Originally Posted by kinshi88 View Post
Ugh, yes I knew exactly what the problem was, as I said in my post.
But I wasn't sure if it was the ServerKeyPacket's structure or my Packet builder.
So plz, gtfo =D
Watch your words.

Now both rest your case, no matter who-ever 'started' violating the rules can result to an infraction.
ImmuneOne is offline  
Old 05/16/2010, 11:35   #10


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,125
Received Thanks: 2,518
Quote:
Originally Posted by Unidentified View Post
Again, you could debug it yourself hardly dumping the packet eh?
Its impossible to debug an issue with a packet structure, either you get it right or you get it wrong.

Your new here, i suggest that you if you want to have a go at people who have contributed here, that you gain some respect first, otherwise your not going to get anyway.

Closed.
Korvacs is offline  
Thanks
2 Users
Closed Thread


Similar Threads Similar Threads
Client Problem
05/08/2010 - Metin2 Private Server - 0 Replies
Guten Abend alle zusammen, Ich habe ein problem. Ich habe mir den Modifield Client geladen und bekomme nen fehler Kostenloser Bilder Upload Service - Gratis Bilder hochladen / uploaden ohne Anmeldung kann mir da einer helfen??
Problem bei client DL...
05/02/2010 - Metin2 - 27 Replies
So wollts wieder nach langer zeit installieren....So...zu meine Problem^^wenn ich auf download klicke kommt der normale Setup-Download....den starte ich dann, dann steht dort aber kurz ein kleines Schild: Kontaktiere den Download-Cluster, das sich sofort wieder schliesst. Dann kommt leider das hier zum Vorschein: http://www.imagebanana.com/img/tw465qes/thumb/Unb enannt.jpg wenn ich auf Weiter drück passiert auch nix>.< Und der Bit-Torrent, den ich übrigens extra wegen diesem Problem...
client problem
05/01/2010 - Metin2 Private Server - 7 Replies
hey com ich habe ein problem mit meinen client wenn ich den client starten will kommt sowas Directupload.net - Dqizavq5l.jpg pls um hilfe danke im vorraus MFG Maxi348
CSro Mbot Handshake Error !!
02/08/2010 - Silkroad Online - 1 Replies
hey guys i have problem ... i start Client by Mbot and Client go on and i write ID and PW and i click " Conect" and i got HANDSHAKE ERROR ;( .... (fatal error) http://img137.imageshack.us/i/handshake.png/ WTF?? pelase help me :(:(..... i Last.Yesterday i can log with Mbot only 1 times in 1:00 i night and after i have lagg and i made Relog and again HANDSHAKE ERROR :(.... wtf ?
Problem with client - Invalid Client
12/12/2009 - Dekaron - 1 Replies
So after neb's bypass was released I used it and it was working fine. Just recently, I was messing around with csv editing for mass spawns (unpacked datas, edited .csvs, etc). Before I could even test if it worked, it gave me a "invalid client - please reinstall" after character selection. -I have used CRC bypass from neb's bypass and it didn't work -I then used just normal without CRC and it didnt work -Used my legit client and it didn't work Any thoughts? Or should I re-edit all...



All times are GMT +2. The time now is 01:20.


Powered by vBulletin®
Copyright ©2000 - 2024, 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 ©2024 elitepvpers All Rights Reserved.