Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #12  
Old 05-07-2008, 05:13 AM
mcox05
Fire Beetle
 
Join Date: Dec 2006
Posts: 21
Default

Quote:
Originally Posted by AndMetal View Post
I'm not 100% sure, but I think this is what you're looking for:

common/EQPacket.cpp:
Code:
  390 void EQProtocolPacket::ChatDecode(unsigned char *buffer, int size, int DecodeKey)
  391 {
  392 	if (buffer[1]!=0x01 && buffer[0]!=0x02 && buffer[0]!=0x1d) {
  393 		int Key=DecodeKey;
  394 		unsigned char *test=(unsigned char *)malloc(size);
  395 		buffer+=2;
  396 		size-=2;
  397 
  398         	int i;
  399 		for (i = 0 ; i+4 <= size ; i+=4)
  400 		{
  401 			int pt = (*(int*)&buffer[i])^(Key);
  402 			Key = (*(int*)&buffer[i]);
  403 			*(int*)&test[i]=pt;
  404 		}
  405 		unsigned char KC=Key&0xFF;
  406 		for ( ; i < size ; i++)
  407 		{
  408 			test[i]=buffer[i]^KC;
  409 		}
  410 		memcpy(buffer,test,size);
  411 		free(test);
  412 	}
  413 }
You are amazing my friend ... the ironic thing is that I just found this about 20 minutes ago. Seems that the answer to my question only leaves me with more questions since I have only programmed in Java/C#.

Question: It's using a decode key which, at a glance, isn't a predefined constant. What is the decode key they are using ... does it change constantly or do they have a constant being applied to the method call?

Anyways, thanks for the help. Great work!
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 04:30 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3