I just started learning C++ coding today, this took me about 3 minutes. Enjoy
Xor.h
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
Strings.h
Code:
#define NxChamsOn /*SkelModelStencil 1*/XorStr<0x22,19,0x9A03721A>("\x71\x48\x41\x49\x6B\x48\x4C\x4C\x46\x78\x58\x48\x40\x4C\x59\x5D\x12\x02"+0x9A03721A).s
#define NxChamsOff /*SkelModelStencil 0*/XorStr<0xA2,19,0x1C073F31>("\xF1\xC8\xC1\xC9\xEB\xC8\xCC\xCC\xC6\xF8\xD8\xC8\xC0\xCC\xD9\xDD\x92\x83"+0x1C073F31).s
Core.cpp
Code:
#include <windows.h>
int HackOn = 0;
int HackMax = 10;
bool test = false;
#define ADDR_SBULLLETS 0x374BBF16
void WINAPIV RunConsoleCommand( const char* cmd )
{
_asm
{
PUSH cmd
MOV EAX, 0x485E10
CALL EAX
ADD ESP, 0x4
}
}
void Main (void)
{
while(1)
{
if(GetAsyncKeyState(VK_NUMPAD1)&1)
{
test = (!test);
}
if(GetAsyncKeyState(VK_NUMPAD2)&1)
{
HackOn ++;
if(HackOn == HackMax) HackOn = 0;
}
if(test){
RunConsoleCommand(ChamsOn);
}else{
RunConsoleCommand(ChamsOff);
}
}
}
DWORD WINAPI Lesson (LPVOID)
{
Main();
return 1;
}
BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )
{
DisableThreadLibraryCalls(hDll);
if ( dwReason == DLL_PROCESS_ATTACH )
{
CreateThread(NULL, NULL, Lesson, NULL, NULL, NULL);
}
return TRUE;
}
Credits:
- Flameswor10(Core.cpp/Edited by me)