Register for your free account! | Forgot your password?

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

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

Advertisement



Client crash at login packet ...

Discussion on Client crash at login packet ... within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
abdeen's Avatar
 
elite*gold: 0
Join Date: Mar 2010
Posts: 475
Received Thanks: 14
Exclamation Client crash at login packet ...

Hey people as title says and i am sure it's will be stupid question but i failed at this point ...

i am working on Redux source 5065 i am changed log-in way to this :

PHP Code:
#region Receive Data
        
private unsafe void Auth_OnReceive(ISocketWrapper arg2byte[] arg1)
        {
            if (
arg1.Length == 52)
            {
                
AuthState player arg2.Connector as AuthState;
                
player.Cryptographer.Decrypt(arg1arg1arg1.Length);
                
player.Info = new Authentication();
                
player.Info.Deserialize(arg1);
                
player.Account = new Database.AccountTable(player.Info.Username);
                
Forward Fw = new Forward();
                if (
player.Info.Password == player.Account.Password)
                {
                    if (
player.Account.State == Database.AccountTable.AccountState.Banned)
                        
Fw.Type = (uint)Forward.ForwardType.Banned;
                    else
                        
Fw.Type Forward.ForwardType.Ready;
                }
                else
                {
                    
Fw.Type Forward.ForwardType.InvalidInfo;
                }
                if (
Fw.Type != Forward.ForwardType.InvalidInfo)
                {

                    
Fw.Identifier Forward.Incrementer.Next;
                    
ServerBase.Kernel.AwaitingPool.Add(Fw.Identifierplayer.Account);
                }
                
Fw.IP "127.0.0.1";
                
Fw.Port 5816;
                
player.Send(Fw);
            }
            else
            {
                
arg2.Socket.Disconnect(false);
            }
                        
        }
        
#endregion 
and here is Forward packet class :

PHP Code:
    public class Forward Interfaces.IPacket
    
{
        public static 
ServerBase.Counter Incrementer;
        public 
enum ForwardType byte Ready 2InvalidInfo 1Banned }
        
byte[] Buffer;
        public 
Forward()
        {
            
Buffer = new byte[32];
            
Network.Writer.WriteUInt16(320Buffer);
            
Network.Writer.WriteUInt16(10552Buffer);
        }
        public 
uint Identifier
        
{
            
get
            
{
                return 
BitConverter.ToUInt32(Buffer4);
            }
            
set
            
{
                
Network.Writer.WriteUInt32(value4Buffer);
            }
        }
        public 
ForwardType Type
        
{
            
get
            
{
                return (
ForwardType)(byte)BitConverter.ToUInt32(Buffer8);
            }
            
set
            
{
                
Network.Writer.WriteUInt32((byte)value8Buffer);
            }
        }
        public 
string IP
        
{
            
get
            
{
                return 
Encoding.ASCII.GetString(Buffer1216);
            }
            
set
            
{
                
Network.Writer.WriteString(value12Buffer);
            }
        }
        public 
ushort Port
        
{
            
get
            
{
                return 
BitConverter.ToUInt16(Buffer28);
            }
            
set
            
{
                
Network.Writer.WriteUInt16(value28Buffer);
            }
        }
        public 
void Deserialize(byte[] buffer)
        {
            
//no implementation
        
}
        public 
byte[] ToArray()
        {
            return 
Buffer;
        }
    } 
and my problem i am facing is if the entered info is incorrect i get invalid info message , but if its correct or banned i get the client crashed.

it's only crash when it receive the type is ready or banned from the source , but if its invalid info type its show me the message successfully
abdeen is offline  
Old 08/12/2014, 14:19   #2
 
Super Aids's Avatar
 
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 946
Most likely a cryptography issue.
Super Aids is offline  
Old 08/12/2014, 14:35   #3
 
abdeen's Avatar
 
elite*gold: 0
Join Date: Mar 2010
Posts: 475
Received Thanks: 14
Quote:
Originally Posted by Super Aids View Post
Most likely a cryptography issue.
here the AuthState.cs class :

and you can see i it's encrypt the packet before it be sent

PHP Code:
public class AuthState 
    
{
        
#region Variables
        
public ISocketWrapper Socket get; private set; }
        public 
AuthCryptography Cryptographer get; private set; }
        public 
Database.AccountTable Account;
        public 
Packets.Login.Authentication Info;
        private 
byte[] SendBuffer;
        public const 
int BaseSendBufferSize 512;
        
#endregion
        #region Constructor
        
public AuthState(ISocketWrapper client)
        {
            
Socket client;
            
Cryptographer = new AuthCryptography();
            
SendBuffer = new byte[BaseSendBufferSize];
        }
        
#endregion
        #region Methods
        
public void Send(Interfaces.IPacket buffer)
        {
            
Send(buffer.ToArray());
        }
        public 
void Send(byte[] buffer)
        {
            
Cryptographer.Encrypt(bufferbufferbuffer.Length);
            
Socket.Send(buffer);
        }

        public 
void Disconnect()
        {
            if(
Socket.Alive)
                
Socket.Disconnect();
        }
        
#endregion
    

and this code shows that the packet decrypted before i use it :

PHP Code:
#region Receive Data
        
private unsafe void Auth_OnReceive(ISocketWrapper arg2byte[] arg1)
        {
            if (
arg1.Length == 52)
            {
                
AuthState player arg2.Connector as AuthState;
                
player.Cryptographer.Decrypt(arg1arg1arg1.Length);
                
player.Info = new Authentication();
                
player.Info.Deserialize(arg1);
                
player.Account = new Database.AccountTable(player.Info.Username);
                
Forward Fw = new Forward();
                if (
player.Info.Password == player.Account.Password)
                {
                    if (
player.Account.State == Database.AccountTable.AccountState.Banned)
                        
Fw.Type = (uint)Forward.ForwardType.Banned;
                    else
                        
Fw.Type Forward.ForwardType.Ready;
                }
                else
                {
                    
Fw.Type Forward.ForwardType.InvalidInfo;
                }
                if (
Fw.Type != Forward.ForwardType.InvalidInfo)
                {

                    
Fw.Identifier Forward.Incrementer.Next;
                    
ServerBase.Kernel.AwaitingPool.Add(Fw.Identifierplayer.Account);
                }
                
Fw.IP "127.0.0.1";
                
Fw.Port 5816;
                
player.Send(Fw);
            }
            else
            {
                
arg2.Socket.Disconnect(false);
            }
                        
        }
        
#endregion 
and at least here is AuthCryptography.cs :

PHP Code:
public class AuthCryptography 
    
{
        private 
ushort InCounter;
        private 
ushort OutCounter;

        public 
void Decrypt(byte[] Inbyte[] Outint Length)
        {
            
lock (this)
            {
                for (
int i 0Lengthi++)
                {
                    
Out[i] = (byte)(In[i] ^ 0xab);
                    
Out[i] = (byte)((Out[i] << 4) | (Out[i] >> 4));
                    
Out[i] = (byte)(Key2[this.InCounter >> 8] ^ Out[i]);
                    
Out[i] = (byte)(Key1[this.InCounter 0xff] ^ Out[i]);
                    
this.InCounter = (ushort)(this.InCounter 1);
                }
            }
        }

        public 
unsafe void Encrypt(byteInbyte[] Outint Length)
        {
            
lock (this)
            {
                for (
int i 0Lengthi++)
                {
                    
Out[i] = (byte)(In[i] ^ 0xab);
                    
Out[i] = (byte)((Out[i] << 4) | (Out[i] >> 4));
                    
Out[i] = (byte)(Key2[this.OutCounter >> 8] ^ Out[i]);
                    
Out[i] = (byte)(Key1[this.OutCounter 0xff] ^ Out[i]);
                    
this.OutCounter = (ushort)(this.OutCounter 1);
                }
            }
        }

        public 
void Encrypt(byte[] Inbyte[] Outint Length)
        {
            
lock (this)
            {
                for (
int i 0Lengthi++)
                {
                    
Out[i] = (byte)(In[i] ^ 0xab);
                    
Out[i] = (byte)((Out[i] << 4) | (Out[i] >> 4));
                    
Out[i] = (byte)(Key2[this.OutCounter >> 8] ^ Out[i]);
                    
Out[i] = (byte)(Key1[this.OutCounter 0xff] ^ Out[i]);
                    
this.OutCounter = (ushort)(this.OutCounter 1);
                }
            }
        } 
        
        
#region  Key 1
        
public static byte[] Key1 = new byte[] { 
            
0x9d0x900x830x8a0xd11400xe70xf60x25400xeb1300x991000x8f0x2e
            
0x2d0x400xd32500xe10xbc0xb72300xb50xd80x3b0xf20xa90x940x5f30
            
0xbd2400x230x6a0xf10xec0x870xd60x450x880x8b0x620xb90xc40x2f14
            
0x4d1600x730xda10x1c0x570xc60xd50x380xdb2100xc90xf40xff0xfe
            
0xdd800xc30x4a0x110x4c0x270xb60x650xe80x2b0x420xd90x240xcf0xee
            
0x6d00x130xba0x210x7c0xf70xa60xf50x980x7b0xb20xe90x540x9f0xde
            
0xfd0xb00x630x2a0x310xac0xc71500x850x480xcb0x220xf90x840x6f0xce
            
0x8d0x600xb30x9a0x412200x970x860x150xf80x1b0x9291800x3f190
            
0x1d0x103100x51120x670x760xa50xa80x6b20x190xe4150xae
            
0xad0xc00x530x7a0x61600x370x660x350x580xbb0x720x29200xdf0x9e
            
0x3d0x700xa30xea0x710x6c70x560xc58110xe20x390x440xaf0x8e
            
0xcd0x200xf3900x810x9c0xd7700x550xb80x5b0x520x490x740x7f0x7e
            
0x5d0xd00x430xca0x910xcc0xa70x360xe50x680xab0xc20x590xa40x4f110
            
0xed0x800x930x3a0xa10xfc0x770x260x750x180xfb500x690xd40x1f0x5e
            
0x7d0x300xe31700xb10x2c0x470x1652000x4b0xa20x7940xef0x4e
            
130xe00x330x1a0xc10x5c0x1760x951200x9b0x120x890x340xbf0x3e
         
};
        
#endregion
        #region Key 2
        
public static byte[] Key2 = new byte[] { 
            
0x620x4f0xe80x150xde0xeb40x910x1a0xc70xe00x4d0x160xe30x7c0x49
            
2100x3f0xd80x850x4e0xdb0xf410x8a0xb70xd00xbd0x860xd30x6c0xb9
            
0x420x2f2000xf51900xcb0xe40x712500xa70xc00x2d0xf60xc30x5c0x29
            
0xb20x1f0xb80x650x2e0xbb0xd40xe10x6a0x970xb00x9d0x660xb30x4c0x99
            
0x22150xa80xd50x9e0xab0xc40x510xda0x87160130xd60xa3609
            
0x920xff0x980x45140x9b1800xc10x4a0x770x900x7d700x930x2c0x79
            
20xef0x880xb50x7e0x8b0xa40x310xba0x670x800xed0xb60x830x1c0xe9
            
0x720xdf1200x250xee0x7b0x940xa10x2a0x570x700x5d0x260x73120x59
            
0xe20xcf0x680x950x5e0x6b0x840x110x9a0x470x600xcd1500x630xfc0xc9
            
0x520xbf0x5850xce0x5b0x740x81100x37800x3d60x530xec0x39
            
0xc20xaf0x480x750x3e0x4b1000xf10x7a0x270x400xad0x760x432200xa9
            
500x9f0x380xe50xae0x3b0x540x610xea0x170x300x1d2300x330xcc0x19
            
0xa20x8f400x55300x2b0x440xd19070x200x8d0x560x230xbc0x89
            
0x120x7f0x180xc50x8e0x1b0x340x410xca0xf70x100xfd0xc60x130xac0xf9
            
1300x6f80x350xfe110x240xb10x3a0xe700x6d0x3630x9c0x69
            
0xf20x5f0xf80xa51100xfb200x211700xd72400xdd0xa60xf31400xd9
         
};

        
#endregion
    

so where is my issue in the codes ??
abdeen is offline  
Old 08/12/2014, 14:44   #4
 
elite*gold: 0
Join Date: Apr 2011
Posts: 93
Received Thanks: 20
Fw.IP = "127.0.0.1"; make it your hamachi ip or 192.168.1.xx ip client will crash if you try to connect it to 127.0.0.1
kakamankoko is offline  
Thanks
1 User
Old 08/12/2014, 16:47   #5
 
abdeen's Avatar
 
elite*gold: 0
Join Date: Mar 2010
Posts: 475
Received Thanks: 14
Quote:
Originally Posted by kakamankoko View Post
Fw.IP = "127.0.0.1"; make it your hamachi ip or 192.168.1.xx ip client will crash if you try to connect it to 127.0.0.1
Thanks a lot its fixed now after i changed the ip to default gateway ip ...
abdeen is offline  
Reply

Tags
5065, 5065 client, login issue


Similar Threads Similar Threads
Client crash after login
08/08/2012 - SRO Private Server - 2 Replies
When i start my Client, login with my id/pw and enter the captcha code client crash ! i dont get any error or smt else ! what could it be ?
Client Crash on login screen
09/15/2011 - SRO Private Server - 50 Replies
So guys, I saw that many people are with this error, so I opened the topic All files are running, Global Manager, Download Server, Gateway, Farm manager, Agent server, Sr_shard, Sr_gameserver. After that I changed the ip media.pk2 with media patcher. Ip 127.0.0.1 Port: 32002. Start the launcher, the client began. At the login screen as the client closes a normal error (before login) http://i52.tinypic.com/23j0bki.png So anyone know how to fix?
New Login Packet for Client 5089+
10/31/2010 - CO2 Programming - 6 Replies
Does anybody have the new login packet structure for client 5089+? For example, if I use an older client and send the following login information using the CO client: username : test password : test I receive the following encrypted packet (packet length is 52 bytes): 0x17 0x84 0x04 0x65 0xD7 0x13 0xC4 0xA5 0xDF 0x0F 0x33 0xA5 0x14 0xCB 0x75 0x6F 0x5F 0x89 0xB0 0x22 0xD5 0x64 0x7A 0x36
client crash be login
10/03/2010 - SRO Private Server - 1 Replies
hello English (not so good) i have a problem, i use db bot wenn i conect (use no dc) after 10 conects crash the client, please hekp me hallo Deutsch ich habe ein problem ich benutze den db bot wenn ich conecte (benutze no dc) stürzt der client noch so 10 conects ab, bitte hilft mir
ZSZC Client Crash @LogIn
06/25/2010 - SRO Private Server - 3 Replies
Some People write Threats with the Theme: My ZSZC Crashes @ Login/ Before i see my Char ->By the Message "...Requesting user confirmation...". I tried: -Sro-Db Bot v0.8/0.9a/0.9b/0.9c/1.0/1.0Beta -I tried with normal Client/ and sometimes with Bot. I have installed 2x times ZSZC in different Folders, when i try the "normal" all work, but when i try with: -AutoLogin/Process Patcher/+a kind of Bot/something others...



All times are GMT +2. The time now is 16:43.


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.