Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Kal Online
You last visited: Today at 16:21

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

Advertisement



[Int] Need dump from few packets

Discussion on [Int] Need dump from few packets within the Kal Online forum part of the MMORPGs category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Aug 2009
Posts: 21
Received Thanks: 12
[Int] Need dump from few packets

Hi all!
I'm Working on standalone kal sniffer - it will not be based on client directly.
I only want to sniff packets and decode it correctly (without modification).

So... What i need?
Need few packet dumps first raw - from sniffer like wireshark and the same packets decoded by... You I know that no one give me working international server packet sniffer based on client hook but I think my request is rational.

Need only few packets started from server choose until char will be loaded.

Now i have some problems, first of all i think they changed old swordcrypt packet encoding/decoding key from 0 to 23 after that i get correct signature $2A (welcome packet) and connection packet but something is wrong... so I want compare it.

Ya I know next packets are encrypted by AES and i think i know how to bite it.

anyone help?
szopenfx is offline  
Old 01/11/2013, 03:51   #2
 
Mahatma's Avatar
 
elite*gold: 281
Join Date: Oct 2007
Posts: 6,248
Received Thanks: 887
i don't think that you will be able to work out how it's crypted just by analysing the packets sniffed by wireshark and without doing some reverse engineering / debugging the engine.exe
but well...if you want to i can give you some packets
Code:
//Connect-Packet (0x08) - crypted with xor-crypt:
connectPacket->fillBuffer("bdddddbb",0x08,appTime,clientinfo->getConnectionParam(0),clientinfo->getConnectionParam(1),clientinfo->getConnectionParam(2),clientinfo->getConnectionParam(3),1,2); //connection params are recieved by the updater (everything uncrypted)
--> recv welcome packet (0x2a) (also crypted with xor crypt)
Code:
//Version-Check (0x09) - crypted with xor+aes:
versionCheck->fillBuffer("bdbd",0x09,clientinfo->getSync(),1,version); //you need to calculate sync and version with the information you get in 0x2a packet
Code:
//Login (0x02) - crypted with xor+aes:
loginPacket->fillBuffer("bdss",0x02,clientinfo->getSync(),clientinfo->getUserName(),clientinfo->getPassword());
--> recv loginAnswer (0x2b) - crypted with xor+aes
Code:
//2nd Password(0x75) - crypted with xor+aes:
secondPasswordPacket->fillBuffer("bdbs",0x75,clientinfo->getSync(),0,clientinfo->get2ndPassword());
--> recv available chars (0x11) - crypted with xor+aes
--> recv restore charinfo (0x19) - crypted with xor+aes

xor-key and (packed) aes key are also recieved by 0x2a packet
xor-send key gets increased by every packet which is sent
xor-recv key is always the same


good luck! :-)
Mahatma is offline  
Thanks
1 User
Old 01/11/2013, 04:41   #3
 
elite*gold: 0
Join Date: Aug 2009
Posts: 21
Received Thanks: 12
so... I missed XOR that's why i get bad data - I don't have any packet data before and after encryption. If I get them then it's easy to calculate XOR key from it.
Thanks for above information it helped me a lot. Now I'm sure that packet ID's are correct and also get fresh info about bytes - very useful.
I don't have working hook on recv/send function, years ago I wrote it in Delphi but probably now it didn't work correctly and will be detected by HS. (C++ is not my lovely language) Also I don't need to calculate any data like getSync because I will read it (don't care about modification). Thanks again if someone could also send me those dumps I will be appreciated - if not I just spend more time to calculate it but who care the most important info I have now.
szopenfx is offline  
Old 01/12/2013, 05:25   #4
 
elite*gold: 0
Join Date: Aug 2009
Posts: 21
Received Thanks: 12
This is rally only XOR or something more? Tested single XOR with all 256 possible key's, XOR + swordcrypt, swordcrytp + XOR in all 64 possible key's and nothing -,-.
Swordcrypt Table was changed? My encrypt/decrypt table steel work on config.pk files.
My $08 packet to compare is based on getConnectionParam values from named shared memory and i know that it's good.
szopenfx is offline  
Old 01/12/2013, 05:44   #5
 
elite*gold: 0
Join Date: Oct 2011
Posts: 189
Received Thanks: 61
Table was changed
pleaX is offline  
Thanks
1 User
Old 01/12/2013, 16:43   #6
 
meak1's Avatar
 
elite*gold: 220
Join Date: Jun 2007
Posts: 3,768
Received Thanks: 1,126
U need the xorkey, the AESKEY and the table from the current engine.
AESKEY change after any update from KalOnline.

PHP Code:
unsigned char XORKey[]={
0xFE0xDC0xBA0x980x760x540x320x100x0F0x1E0x2D0x3C0x4B0x5A0x690x78}; 
this was my clientless login...

PHP Code:
char Packet[25];
memcpy(Packet"\x19\x00\x08\x9D\x1E\x00\x00\x39\x11\x93\x16\x89\xCE\x9E\x59\x90\xA9\xD8\x36\x00\xB7\x5C\x7E\x00\x01"25);
send(s,Packet,sizeof(Packet),0);

recv(s,buf,sizeof(buf),0);
Plen = (*(PWORD(buf)));
DecryptTable(RecvKey,(unsigned char*)buf+2,Plen-2);
Print(
'R',buf[0],buf);

if(
buf[2] == 0x2A){
SendKey=*(BYTE*)&buf[7];
RecvKey=*(BYTE*)&buf[7];
Sync=*(DWORD*)&buf[83];

_asm{
    
MOV EAXSync
    SHR EAX
0x7
    MOV ECX
EAX
    MOV EDX
EAX
    SHR EDX
0x9
    SHL EDX
0x9
    SUB EAX
EDX
    
XOR EAX0x1A85
    MOV Sync
EAX
}
printf("Sync:%x\n",Sync);
printf("KEY:%x\n",SendKey);
AcceptAddy=*(DWORD*)&buf[3];

_asm{
MOV EAX,AcceptAddy
XOR EDX,EDX
MOV ECX
,0x0ED1
DIV ECX
ADD EDX
,0x235C
mov SendLogin
,EDX
}
}
printf("Key for Serv: 0x%X\n",SendLogin);
char Packet2[12];
memcpy(Packet2"\x0C\x00\x09"3);
memcpy(Packet2+5,"\x00\x00\x01",3);
*(
DWORD*)&Packet2[3]=Sync;
*(
DWORD*)&Packet2[8]=SendLogin;
send(s,Packet2,sizeof(Packet2),0);

char Login[28];
char ID[255];
GetPrivateProfileStringA("AUTOLOGIN","ID"0ID255".\\Autologin.ini"); 
char PW[255];
 
GetPrivateProfileStringA("AUTOLOGIN","PW"0PW255".\\Autologin.ini"); 
memcpy(Login"\x1C\x00\x02",3);
*(
DWORD*)&Login[3]=Sync;
memcpy(Login+5"\x00\x00",2);
memcpy(Login+7,ID,strlen(ID));        
memcpy(Login+7+strlen(ID), "\x00",1);
memcpy(Login+7+strlen(ID)+1,PW,strlen(PW));    
memcpy(Login+7+strlen(ID)+1+strlen(PW),"\x00",1);
                
//memcpy(Login+7+sizeof(ID)+1+sizeof(PW), "\x00",1);
send(s,Login,sizeof(Login),0);

recv(s,buf,sizeof(buf),0);
Plen = (*(PWORD(buf)));
DecryptTable(RecvKey,(unsigned char*)buf+2,Plen-2);
DecryptPacketAES(buf);
Print(
'R',buf[0],buf);

if(
buf[2] == 0x2B){
    
char Login[17];
    
memcpy(Login"\x11\x00\x75",3);
    *(
DWORD*)&Login[3]=Sync;
    
memcpy(Login+5"\x00\x00\x00"3);
    
char Secrete[255];
 
GetPrivateProfileStringA("AUTOLOGIN","2PW"0Secrete255".\\Autologin.ini"); 
 
memcpy(Login+8Secrete9);
send(s,Login,sizeof(Login),0);

recv(s,buf,sizeof(buf),0);
Plen = (*(PWORD(buf)));
DecryptTable(RecvKey,(unsigned char*)buf+2,Plen-2);
DecryptPacketAES(buf);
Print(
'R',122,buf);
Sleep(2000);


DWORD charID;
if(
buf[2] == 0x11){

    
charID=*(DWORD*)&buf[9];
//    charID=*(DWORD*)&buf[40];
    
printf("Char Found!\n");
}

//LOGIN the char...
char Packet2[19];
memcpy(Packet2"\x13\x00\x0A"3);
    *(
DWORD*)&Packet2[3]=Sync;
    
memcpy(Packet2+5"\x00\x00"2);
    *(
DWORD*)&Packet2[7]=charID;
    
memcpy(Packet2+10"\x00\x00\x00\x00\x00\x00\x00\x00\x00"9);
send(s,Packet2,sizeof(Packet2),0);

char Packet3[12];
memcpy(Packet3"\x0C\x00\x0B"3);
    *(
DWORD*)&Packet3[3]=Sync;
    
memcpy(Packet3+5"\x00\x00\x01\x7A\x43\x00\x00"7);
send(s,Packet3,sizeof(Packet3),0); 
meak1 is offline  
Thanks
2 Users
Old 01/18/2013, 07:31   #7
 
elite*gold: 0
Join Date: Aug 2009
Posts: 21
Received Thanks: 12
@pleaX thanks for that info I found new tables for SwordCrypt (or dunno how call it but historical first encryption in KalOnline, also standard in priv svr)

@Mahatma I entered a bit of confusion after your post. Probably by naming this encryption - when I changed xor crypt algoritm to SwordCrypt with new tables your informations were found to be clear and correct, thx.

For full 128bit block of data is used AES - if not full there is used simple XOR encryption with 16 byte key (like @meak1 talk about) I known that long time ago but never tested, till now:P

@meak1 Thanks also go to you, maybe I use those sync and AcceptAddy, to make rally stand alone application... dunno what with HS, CRC calculation, but this is topic for another story.

so... at last...
...Probably the first working Proxy written in Delphi for international servers :P
szopenfx is offline  
Old 01/18/2013, 20:45   #8
 
meak1's Avatar
 
elite*gold: 220
Join Date: Jun 2007
Posts: 3,768
Received Thanks: 1,126
HS is rly big, got an Dll to debug at runtime
but still rly hard

Got the first HS packet working which is Sended after Login but i stopped to work on the HS packet, to hard...

But i was near the goal d;

HS sends login packet and all 10minutes an CRC packet idk, had no time for KalOnline, i mean i dont work on Kal anymore ;\
meak1 is offline  
Old 01/18/2013, 22:31   #9
 
elite*gold: 0
Join Date: Aug 2009
Posts: 21
Received Thanks: 12
I found info that HS ask for chosen random memory region from KalOnline, so I think it's almost impossible to make HS client emulator without running process or process dump.
My RE skill is quite low... so probably i will send only "ping" packets (to keep connection) and HS/CRC request to KalOnline client, rest will be handled by my program.
szopenfx is offline  
Old 01/18/2013, 22:53   #10
 
meak1's Avatar
 
elite*gold: 220
Join Date: Jun 2007
Posts: 3,768
Received Thanks: 1,126
u mean u can use clientless without beeing dc? i mean after HS ask for answer d;?
meak1 is offline  
Old 01/18/2013, 23:39   #11
 
elite*gold: 0
Join Date: Jul 2009
Posts: 61
Received Thanks: 2
Haha ur using delphi ?? Such a prehistory programm :P
huby is offline  
Reply


Similar Threads Similar Threads
[Release] +5500 Packets structure , client/packets constants
10/07/2012 - CO2 PServer Guides & Releases - 10 Replies
edit : if u know nothing about packets go to this post first explaining what is packets , and explaining a packet with details and everything http://www.elitepvpers.com/forum/co2-pserver-disc ussions-questions/2162344-packets-packets-packets. html#post19074533 i start making my very own packet structure to use them on my new proxy but i thought of ripping them from the source so yeah the following packets is ripped of trinity base source right now im just providing the packets structure...
[REQUEST] packets send list , or anyway to sniff send packets
08/10/2012 - Kal Online - 16 Replies
hey everyone , as mentioned , i wanna know if anyone got a complete send packets lists or anyway i can sniff send packets , thanks in advance
[PROBLEM]Cannot dump. No dump device defined.
07/30/2011 - Metin2 Private Server - 5 Replies
Moin, bin ja eigentlich nicht der, der bei Problemen direkt ins Forum rennt, aber seit kurzem macht FreeBSD sehr eigenartige dinge, z.s. im folgenden Bild: http://img337.imageshack.us/img337/9282/faild.png Wenn ich 3-4 mal Reboote Startet er, aber vorher auch nicht... Und jetzt kommts, das Passiert mit ALLEN SF's die ich besitze, d.h. neu machen kann ich vergessen... Kann da jemand Abhilfe schaffen?
[Packets] Wie änder ich flyff packets?
07/16/2011 - Flyff Private Server - 19 Replies
HeyHo, Ich würde sehr gerne wissen wie man die Flyff Packets ändert... ich denke mal Zahlen ändern werden nicht ausreichen oder?



All times are GMT +1. The time now is 16:21.


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.