Home > other >  Communication encryption code for help ~!!!!! ~
Communication encryption code for help ~!!!!! ~

Time:10-20

Is a game code, existing login decrypt communication code, as follows:
 void CEncode_Decode: : Encode_Decode (WORD nLen, LPBYTE lpSource, LPBYTE lpTarget, bool bSend) 
{
BYTE l_BYTE_Xor1=nLen * D_WORD_XOR1MUL l_BYTE_Xor3;

WORD l_WORD_Xor3=D_WORD_XOR3BASE nCir;
If (bSend)
{
L_BYTE_Xor1 x00aa *=0;
L_WORD_Xor3 x00bb *=0;
}
For (nCir=0; NCir{
L_BYTE_Xor3=HIBYTE (l_WORD_Xor3);
LpTarget [nCir]=lpSource [nCir] ^ l_BYTE_Xor1 ^ G_BYTE_XorTable D_XORTABLE_LENGTH] [nCir % ^ l_BYTE_Xor3;
L_WORD_Xor3 *=D_WORD_XOR3MUL;
}
}

Through the decryption code, how to write the encryption code?

CodePudding user response:

This also need to write? Is just a simple xor, direct calls again,
The input source for the first time, the target is encrypted; The target for the second time when the source input, it is the original source

CodePudding user response:

Prototype example,
 void USER: : Encode_Decode (char * lpTarget, char * lpSource, int nLen, int f)//server encryption 
{
BYTE l_BYTE_Xor1=(WORD) nLen * D_WORD_XOR1MUL, l_BYTE_Xor3;

WORD l_WORD_Xor3=D_WORD_XOR3BASE nCir;

For (nCir=0; NCir<(WORD) nLen; NCir++)
{
L_BYTE_Xor3=HIBYTE (l_WORD_Xor3);
LpTarget [nCir]=lpSource [nCir] ^ l_BYTE_Xor1 ^ key D_XORTABLE_LENGTH] [nCir % ^ l_BYTE_Xor3;
L_WORD_Xor3 *=D_WORD_XOR3MUL;
}
}
//////////login decryption
Void Encode_Decode (LPBYTE lpTarget, LPBYTE lpSource, WORD nLen)
{

//8 * 0 x009d
BYTE l_BYTE_Xor1=nLen * D_WORD_XOR1MUL l_BYTE_Xor3;
//0 x086d
WORD l_WORD_Xor3=D_WORD_XOR3BASE nCir;

For (nCir=0; NCir{
L_BYTE_Xor3=HIBYTE (l_WORD_Xor3);
LpTarget [nCir]=lpSource [nCir] ^ l_BYTE_Xor1 ^ G_BYTE_XorTable D_XORTABLE_LENGTH] [nCir % ^ l_BYTE_Xor3;
L_WORD_Xor3 *=D_WORD_XOR3MUL;
}

}

Decryption added
 if (bSend) 
{
L_BYTE_Xor1 x00aa *=0;
L_WORD_Xor3 x00bb *=0;
}

The server-side encryption what should I write this?

CodePudding user response:

reference 1st floor cutmelon response:
that still need to write? Is just a simple xor, direct calls again,
The input source for the first time, the target is encrypted; The target for the second time when the source input, out is the original source of

Directly on the server call time, landing not ah,,,

CodePudding user response:

Pray god help I see ah
  • Related