D
DZHZH2000
Unregistered / Unconfirmed
GUEST, unregistred user!
如下这一段静态数组定义不必翻译)
const static BYTE tg_mima[256]=
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xbe, 0x84, 0xe1, 0x6c, 0xd6, 0xae, 0x52, 0x90, 0x49, 0xf1, 0xf1, 0xbb, 0xe9, 0xeb, 0xb3, 0xa6,
0xdb, 0x87, 0x0c, 0x99, 0x5e, 0x0d, 0x1c, 0x06, 0xb7, 0x47, 0xde, 0xb3, 0x12, 0x4d, 0xc8, 0x43,
0xbb, 0x8b, 0xa6, 0x1f, 0x03, 0x7d, 0x09, 0x38, 0x25, 0x1f, 0xd4, 0xcb, 0xfc, 0x96, 0xf5, 0x3b,
0x13, 0x0d, 0x89, 0x0a, 0x1c, 0xdb, 0xae, 0x32, 0x20, 0x9a, 0xee, 0x78, 0x36, 0xfd, 0x12, 0x32,
0xf6, 0x9e, 0x49, 0xdc, 0xad, 0x4f, 0x14, 0xf2, 0x44, 0x40, 0xd0, 0xc4, 0x30, 0xb7, 0x32, 0x3b,
0xa1, 0x22, 0xf6, 0x22, 0x91, 0x9d, 0xe1, 0x8b, 0x1f, 0xda, 0xb0, 0xca, 0x99, 0x02, 0xb9, 0x9d,
0x49, 0x2c, 0x7e, 0xc5, 0xd5, 0xe9, 0xb2, 0xea, 0xc9, 0xcc, 0x53, 0xbf, 0x67, 0xd6, 0xbf, 0x14,
0xd6, 0x7e, 0x2d, 0xdc, 0x66, 0xef, 0x57, 0x49, 0x61, 0xff, 0x69, 0x61, 0xcd, 0xd1, 0x1e, 0x16,
0x72, 0x72, 0xe6, 0x1d, 0xf0, 0x84, 0x4f, 0x4a, 0x77, 0x02, 0xd7, 0xe8, 0x39, 0x2c, 0x53, 0xcb,
0xc9, 0x12, 0x1e, 0x33, 0x74, 0x9e, 0x0c, 0xf4, 0xd5, 0xd4, 0x9f, 0xd4, 0x59, 0x7e, 0x35, 0xcf,
0x32, 0x22, 0xf4, 0x90, 0x2d, 0x48, 0x8f, 0x75, 0xe6, 0x1d, 0x2a, 0xe5, 0xf7, 0x2b, 0x78, 0x81,
0x87, 0x44, 0x0e, 0x5f, 0x50, 0x00, 0x61, 0x8d, 0xbe, 0x7b, 0x05, 0x15, 0x07, 0x3b, 0x33, 0x82,
0x1f, 0x18, 0x70, 0x92, 0xda, 0x64, 0x54, 0xce, 0xb1, 0x85, 0x3e, 0x69, 0x15, 0x46, 0x6a, 0x04,
0x96, 0x73, 0x0e, 0xd9, 0x16, 0x2f, 0x67, 0x68, 0xd4, 0x4a, 0x4a, 0xd0, 0x57, 0x68, 0x76, 0x16
};
以上的可以不必翻译
void Encrypt(char* pBuffer, DWORD dwBufferLength)
{
// Ëæ»úÉú³ÉÒ»¸ö´óÓÚ0x20µÄÒò×Ó
char tmpSnd[256];
BYTE m_xor=rand()%256;
DWORD pos, n;
memset(tmpSnd, '/0', 256);
if(m_xor<0x20)m_xor+=0x20;
// &Atilde;&Uuml;&Icirc;&Auml;&micro;&Uacute;&Ograve;&raquo;&cedil;&ouml;×&Ouml;&frac12;&Uacute;&Icirc;&ordf;&frac34;&Oslash;&Otilde;óXOR&micro;&Auml;&AElig;&eth;&Ecirc;&frac14;&Icirc;&raquo;&Ouml;&Atilde;
tmpSnd[0] = m_xor;
// &Atilde;&Uuml;&Icirc;&Auml;&AElig;&auml;&Euml;&ucirc;×&Ouml;&frac12;&Uacute;&Ograve;&Agrave;&acute;&Icirc;XOR&frac34;&Oslash;&Otilde;ó&Auml;&Uacute;&Egrave;&Yacute;
for(n=0;
n<dwBufferLength-1;
n++)
{
//&frac14;&AElig;&Ecirc;&yacute;&AElig;÷&Otilde;&Ucirc;&raquo;&Oslash;&Ecirc;±&Ocirc;&frac12;&sup1;&yacute;&Ccedil;°0x20&cedil;&ouml;×&Ouml;&frac12;&Uacute;
pos = n+m_xor;
pos %= 256;
if( pos<0x20 ) pos+=0x20;
tmpSnd[n+1] = *(pBuffer+n) ^ (tg_mima[pos]&0x1F);
}
// ×&icirc;&ordm;ó&Ograve;&raquo;&cedil;&ouml;×&Ouml;&frac12;&Uacute;'/r'&sup2;&raquo;±&auml;
tmpSnd[n+1] = *(pBuffer+n);
strcpy(pBuffer, tmpSnd);
}
void Decrypt(char* pBuffer, DWORD dwBufferLength)
{
int len, m, pos;
BYTE m_xor;
if(pBuffer[strlen(pBuffer)-1]=='/r')pBuffer[strlen(pBuffer)-1] = '/0';
len = (int)strlen(pBuffer);
m_xor = *pBuffer;
for( m=1;
m<len;
m++ )
{
pos = m-1+m_xor;
pos %= 256;
if( pos<0x20 ) pos+=0x20;
*(pBuffer+m) ^= (tg_mima[pos]&0x1F);
}
strcpy(pBuffer, pBuffer+1);
strcat(pBuffer, "/r");
}
const static BYTE tg_mima[256]=
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xbe, 0x84, 0xe1, 0x6c, 0xd6, 0xae, 0x52, 0x90, 0x49, 0xf1, 0xf1, 0xbb, 0xe9, 0xeb, 0xb3, 0xa6,
0xdb, 0x87, 0x0c, 0x99, 0x5e, 0x0d, 0x1c, 0x06, 0xb7, 0x47, 0xde, 0xb3, 0x12, 0x4d, 0xc8, 0x43,
0xbb, 0x8b, 0xa6, 0x1f, 0x03, 0x7d, 0x09, 0x38, 0x25, 0x1f, 0xd4, 0xcb, 0xfc, 0x96, 0xf5, 0x3b,
0x13, 0x0d, 0x89, 0x0a, 0x1c, 0xdb, 0xae, 0x32, 0x20, 0x9a, 0xee, 0x78, 0x36, 0xfd, 0x12, 0x32,
0xf6, 0x9e, 0x49, 0xdc, 0xad, 0x4f, 0x14, 0xf2, 0x44, 0x40, 0xd0, 0xc4, 0x30, 0xb7, 0x32, 0x3b,
0xa1, 0x22, 0xf6, 0x22, 0x91, 0x9d, 0xe1, 0x8b, 0x1f, 0xda, 0xb0, 0xca, 0x99, 0x02, 0xb9, 0x9d,
0x49, 0x2c, 0x7e, 0xc5, 0xd5, 0xe9, 0xb2, 0xea, 0xc9, 0xcc, 0x53, 0xbf, 0x67, 0xd6, 0xbf, 0x14,
0xd6, 0x7e, 0x2d, 0xdc, 0x66, 0xef, 0x57, 0x49, 0x61, 0xff, 0x69, 0x61, 0xcd, 0xd1, 0x1e, 0x16,
0x72, 0x72, 0xe6, 0x1d, 0xf0, 0x84, 0x4f, 0x4a, 0x77, 0x02, 0xd7, 0xe8, 0x39, 0x2c, 0x53, 0xcb,
0xc9, 0x12, 0x1e, 0x33, 0x74, 0x9e, 0x0c, 0xf4, 0xd5, 0xd4, 0x9f, 0xd4, 0x59, 0x7e, 0x35, 0xcf,
0x32, 0x22, 0xf4, 0x90, 0x2d, 0x48, 0x8f, 0x75, 0xe6, 0x1d, 0x2a, 0xe5, 0xf7, 0x2b, 0x78, 0x81,
0x87, 0x44, 0x0e, 0x5f, 0x50, 0x00, 0x61, 0x8d, 0xbe, 0x7b, 0x05, 0x15, 0x07, 0x3b, 0x33, 0x82,
0x1f, 0x18, 0x70, 0x92, 0xda, 0x64, 0x54, 0xce, 0xb1, 0x85, 0x3e, 0x69, 0x15, 0x46, 0x6a, 0x04,
0x96, 0x73, 0x0e, 0xd9, 0x16, 0x2f, 0x67, 0x68, 0xd4, 0x4a, 0x4a, 0xd0, 0x57, 0x68, 0x76, 0x16
};
以上的可以不必翻译
void Encrypt(char* pBuffer, DWORD dwBufferLength)
{
// &Euml;&aelig;&raquo;ú&Eacute;ú&sup3;&Eacute;&Ograve;&raquo;&cedil;&ouml;&acute;ó&Oacute;&Uacute;0x20&micro;&Auml;&Ograve;ò×&Oacute;
char tmpSnd[256];
BYTE m_xor=rand()%256;
DWORD pos, n;
memset(tmpSnd, '/0', 256);
if(m_xor<0x20)m_xor+=0x20;
// &Atilde;&Uuml;&Icirc;&Auml;&micro;&Uacute;&Ograve;&raquo;&cedil;&ouml;×&Ouml;&frac12;&Uacute;&Icirc;&ordf;&frac34;&Oslash;&Otilde;óXOR&micro;&Auml;&AElig;&eth;&Ecirc;&frac14;&Icirc;&raquo;&Ouml;&Atilde;
tmpSnd[0] = m_xor;
// &Atilde;&Uuml;&Icirc;&Auml;&AElig;&auml;&Euml;&ucirc;×&Ouml;&frac12;&Uacute;&Ograve;&Agrave;&acute;&Icirc;XOR&frac34;&Oslash;&Otilde;ó&Auml;&Uacute;&Egrave;&Yacute;
for(n=0;
n<dwBufferLength-1;
n++)
{
//&frac14;&AElig;&Ecirc;&yacute;&AElig;÷&Otilde;&Ucirc;&raquo;&Oslash;&Ecirc;±&Ocirc;&frac12;&sup1;&yacute;&Ccedil;°0x20&cedil;&ouml;×&Ouml;&frac12;&Uacute;
pos = n+m_xor;
pos %= 256;
if( pos<0x20 ) pos+=0x20;
tmpSnd[n+1] = *(pBuffer+n) ^ (tg_mima[pos]&0x1F);
}
// ×&icirc;&ordm;ó&Ograve;&raquo;&cedil;&ouml;×&Ouml;&frac12;&Uacute;'/r'&sup2;&raquo;±&auml;
tmpSnd[n+1] = *(pBuffer+n);
strcpy(pBuffer, tmpSnd);
}
void Decrypt(char* pBuffer, DWORD dwBufferLength)
{
int len, m, pos;
BYTE m_xor;
if(pBuffer[strlen(pBuffer)-1]=='/r')pBuffer[strlen(pBuffer)-1] = '/0';
len = (int)strlen(pBuffer);
m_xor = *pBuffer;
for( m=1;
m<len;
m++ )
{
pos = m-1+m_xor;
pos %= 256;
if( pos<0x20 ) pos+=0x20;
*(pBuffer+m) ^= (tg_mima[pos]&0x1F);
}
strcpy(pBuffer, pBuffer+1);
strcat(pBuffer, "/r");
}