View difference between Paste ID: UUTDBbCt and ybzJGuvL
SHOW: | | - or go back to the newest paste.
1
/*
2
-----------------------------------------
3
* Game hacking QTS ( Quickie Tip Series ) 
4-
* no. 30 - Finding a dll module and obtaining its size
4+
* no. 31 - Hiding your strings in your hack
5
-----------------------------------------
6
* Author: SEGnosis 	
7
* Thanks to:
8
* bitterbanana		- No known site
9
* Drunken Cheetah 	- No known site
10
* fatboy88 		- No known site
11
* Geek4Ever 		- No known site
12
* learn_more 		- www.uc-forum.com
13
* Novocaine 		- http://ilsken.net/blog/?page_id=64
14
* Philly0494 		- No known site
15
* Roverturbo 		- www.uc-forum.com
16
* SilentKarma 		- www.halocoders.com - offline
17
* Strife 		- www.uc-forum.com
18
* Wieter20 		- No known site
19
*/
20
21
22
//----------------------------------//
23
24-
// This function takes in the dll name and returns the base address
24+
#ifndef _XOR_H
25-
// It will wait until the module exists, so put it in a thread
25+
#define _XOR_H
26-
DWORD GetModuleAddress(char* szModule)
26+
template <int XORSTART, int BUFLEN, int XREFKILLER>
27
28-
	DWORD dwAddress;
28+
class XorStr
29
{
30
private: 
31-
	while(true)
31+
	XorStr();
32
public: 
33-
		dwAddress = (DWORD)GetModuleHandle(szModule);
33+
	char s[ BUFLEN ];
34
35-
		if(dwAddress != NULL)
35+
	XorStr( const char * xs );
36-
			break;
36+
37-
		else
37+
	~XorStr()
38-
			Sleep(250);
38+
39
		for ( int i = 0; i < BUFLEN; i++ ) s[ i ]=0; 
40
	}
41-
	return dwAddress;
41+
};
42
43
template <int XORSTART, int BUFLEN, int XREFKILLER>
44-
// This function takes in a module name
44+
XorStr<XORSTART,BUFLEN,XREFKILLER>::XorStr( const char * xs )
45-
// It then iterates through the modules and returns the matching module's size
45+
46-
DWORD GetModuleSize(char* module)
46+
	int xvalue = XORSTART;
47
	int i = 0;
48-
 DWORD dwSize;
48+
49
	for ( ; i < ( BUFLEN - 1 ); i++ ) 
50-
 HANDLE hSnap;
50+
51
		s[ i ] = xs[ i - XREFKILLER ] ^ xvalue;
52-
 MODULEENTRY32 xModule;
52+
		xvalue += 1;
53
		xvalue %= 256;
54
	}
55-
 hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, GetCurrentProcessId());
55+
56
	s[ BUFLEN - 1 ] = 0;
57-
 xModule.dwSize = sizeof(MODULEENTRY32);
57+
58
#endif
59-
 if (Module32First(hSnap, &xModule) != FALSE)
59+
60-
 {
60+
// You can encode your string using the xor operator so that it is just a bit more difficult for anti-cheats to find your hack
61-
	while (Module32Next(hSnap, &xModule))
61+
// Use an online xor generator such as - http://www.tutogames.xpg.com.br/xorgen.html - Or create your own
62
63-
	   if (strcmp((char*)xModule.szModule, module) == 0)
63+
// This xored string will run and decode your original string such as "aimbot-enable" at runtime and return a 
64-
	   {
64+
// string pointer for you to use
65-
		  dwSize = xModule.modBaseSize;
65+
char* szAimbotOption = /*aimbot-enable*/XorStr<0xFC,13,0x9DB4EDA6>("\x8E\x9C\x9A\x9E\x72\x2C\x67\x6D\x65\x67\x6A\x62"+0x9DB4EDA6).s;
66-
		  break;
66+
67-
	   }
67+
68
// If you are using C++ 11, you can use kingdeking's method of compile time encryption to for ease of use
69-
 }
69+
http://www.unknowncheats.me/forum/c-and-c/113715-compile-time-string-encryption.html#post960461
70
71-
 CloseHandle(hSnap);
71+