- Joined
- Sep 27, 2006
- Messages
- 558
- Reaction score
- 90
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: