• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

[DEV] Latale New Packet Encryption...

Joined
Sep 27, 2006
Messages
557
Reaction score
88
This is the decrypted side of latale packet encryption... oppiste is just adding the 4 byte header... have any questions feel free to ask...


Code:
void CCrypt::Decrypt(unsigned char* buffer, unsigned size )
{
	// check data correctness
	if ( !buffer )
		return;
	if ( size < 4 )
		return;

	unsigned char * decBuffer = new unsigned char[ size - 4 ];

	unsigned m = size - 4;

	// copy data from the decBuffer to Buffer  
	memcpy( decBuffer, buffer + 4, sizeof( unsigned char ) * m );

	const char unknown_key[] = "qmfaktnpgjs";
        unsigned char unknown_key2[sizeof(unknown_key)];
        std::copy(unknown_key, unknown_key + sizeof(unknown_key), unknown_key2);

	if ( decBuffer == NULL)
		return;
        if ( m < 4 )
		return;
	
	for (unsigned i = 0; i < m; i++)
	{
		if ( decBuffer[i] != 0)
		{
			decBuffer[ i ] = unknown_key2[i % 0xB] ^ decBuffer[i];
		}
	}
	
	// swap buffers
	delete [] buffer;
	buffer = decBuffer;
	size = m;
}
 
Last edited:
Newbie Spellweaver
Joined
Apr 5, 2011
Messages
9
Reaction score
3
this works as far as i know any questions just ask away...

Question Number 1

what exactly are we looking at?

Question 2

Will it help create a latale server?

(P.S. im not a coder)
 
Back
Top