Can anyone tell me how do I encrypt a string using XOR
How they generate the strings ?
Code:
#ifndef _XOR_H
#define _XOR_H
template <int XORSTART, int BUFLEN, int XREFKILLER>
class XorStr
{
private:
XorStr();
public:
char s[ BUFLEN ];
XorStr( const char * xs );
~XorStr()
{
for ( int i = 0; i < BUFLEN; i++ ) s[ i ]=0;
}
};
template <int XORSTART, int BUFLEN, int XREFKILLER>
XorStr<XORSTART,BUFLEN,XREFKILLER>::XorStr( const char * xs )
{
int xvalue = XORSTART;
int i = 0;
for ( ; i < ( BUFLEN - 1 ); i++ )
{
s[ i ] = xs[ i - XREFKILLER ] ^ xvalue;
xvalue += 1;
xvalue %= 256;
}
s[ BUFLEN - 1 ] = 0;
}
#endif
#define EncryptedCShell /*CShell.dll*/XorStr<0x77,11,0x0026791B>("\x34\x2B\x11\x1F\x17\x10\x53\x1A\x13\xEC"+0x0026791B).s
#define EncryptedClientFx /*ClientFX.fxd*/XorStr<0x94,13,0xA00514A7>("\xD7\xF9\xFF\xF2\xF6\xED\xDC\xC3\xB2\xFB\xE6\xFB"+0xA00514A7).s
#define EncD3d9 /*D3d9.dll*/XorStr<0x88,9,0x8F034C3B>("\xCC\xBA\xEE\xB2\xA2\xE9\xE2\xE3"+0x8F034C3B).s
#define EncryptedCrossfire /*crossfire.exe*/XorStr<0xAD,14,0x3B5E9B13>("\xCE\xDC\xC0\xC3\xC2\xD4\xDA\xC6\xD0\x98\xD2\xC0\xDC"+0x3B5E9B13).s