Packet sent to Login (Account) server on Login state just after packet 0x0204.
Analysis show, that packet is specified only Sakray servers, and may-be a few Normal servers.
Also, This packet has two types, one for normal Client (old), and AES Encrypted type for Renewal (new).
Used only if: g_bUseCommand == 0, g_passwordEncrypt == 0, and g_serviceType == 0.
Packet seen in Wild: YES!
(ToDo: Check g_serviceType and g_serverType, thous servers use it)
Packet structure:
Code: Select all
struct PACKET_CA_LOGIN_HAN {
short PacketType;
unsigned long Version; // Usual data
unsigned char ID[24]; // Login Name
unsigned char Passwd[24]; // Password. Renewal client encrypt this using AES
unsigned char clienttype; // Usual data
char m_szIP[16]; // Adapter Address with dot's. Default Value: 111.111.111.111
unsigned char m_szMacAddr[13]; // Adapter Mac. Default Value: 111111111111
unsigned char isHanGameUser; // p.isHanGameUser = g_isGravityID; // Indicate if the Account is GM or GMHelper account
}
Code: Select all
const unsigned char AESKey_key[16] = {6, 169, 33, 64, 54, 184, 161, 91, 81, 46, 3, 213, 52, 18, 0, 6};
const unsigned char AESKey_chain[16] = {61, 175, 186, 66, 157, 158, 180, 48, 180, 34, 218, 128, 44, 159, 172, 65};
// Use these if you will have trouble Encrypting string
// const unsigned char AESKey_key[24] = {6, 169, 33, 64, 54, 184, 161, 91, 81, 46, 3, 213, 52, 18, 0, 6, 61, 175, 186, 66, 157, 158, 180, 48};
// const unsigned char AESKey_chain[24] = {61, 175, 186, 66, 157, 158, 180, 48, 180, 34, 218, 128, 44, 159, 172, 65, 1, 2, 4, 8, 16, 32, 128};
// Default call:
// AESEncrypt(password, *(p.Passwd), 24);
// Please note, that key_len = 24, so if you will have trouble, switch to [24] byte keys
void AESEncrypt(const char *in, char *out, int key_len) {
CRijndael *chiper = new CRijndael;
chiper->MakeKey(*AESKey_key, *AESKey_chain, key_len, key_len);
unsigned char result[128];
memset(&result, 0, 128);
chiper->Encrypt(in, result, key_len, 0);
memcpy(out, result, key_len);
}
void __cdecl AESDecrypt(const char *in, char *out, int key_len) {
CRijndael *chiper = new CRijndael;
chiper->MakeKey(*AESKey_key, *AESKey_chain, key_len, key_len);
unsigned char result[128];
memset(&result, 0, 128);
chiper->Decrypt(in, result, key_len, 0);
memcpy(out, result, key_len);
}