View difference between Paste ID: Gw6NCXV4 and UUTDBbCt
SHOW: | | - or go back to the newest paste.
1
/*
2
-----------------------------------------
3
* Game hacking QTS ( Quickie Tip Series ) 
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-
#ifndef _XOR_H
24+
25-
#define _XOR_H
25+
BOOL CALLBACK MyEnumWindowsProc(HWND hWnd, LPARAM lParam)
26-
template <int XORSTART, int BUFLEN, int XREFKILLER>
26+
27
	RECT rect;
28-
class XorStr
28+
	
29
	DWORD* pParams;
30-
private: 
30+
31-
	XorStr();
31+
	DWORD lpdwProcessId;
32-
public: 
32+
33-
	char s[ BUFLEN ];
33+
	char szBuffer[MAX_PATH];
34
35-
	XorStr( const char * xs );
35+
	
36
	pParams = (DWORD*)lParam;
37-
	~XorStr()
37+
	GetWindowThreadProcessId(hWnd, &lpdwProcessId);
38
39-
		for ( int i = 0; i < BUFLEN; i++ ) s[ i ]=0; 
39+
	if(pParams[0] == lpdwProcessId)
40
	{
41-
};
41+
		GetClientRect(hWnd, &rect);
42
43-
template <int XORSTART, int BUFLEN, int XREFKILLER>
43+
		GetClassName(hWnd, szBuffer, sizeof(szBuffer));
44-
XorStr<XORSTART,BUFLEN,XREFKILLER>::XorStr( const char * xs )
44+
45
		if(strcmp(szBuffer, "ConsoleWindowClass") != 0 && rect.right > 1)
46-
	int xvalue = XORSTART;
46+
			pParams[1] = (DWORD)hWnd;
47-
	int i = 0;
47+
48
49-
	for ( ; i < ( BUFLEN - 1 ); i++ ) 
49+
    return TRUE;
50
}
51-
		s[ i ] = xs[ i - XREFKILLER ] ^ xvalue;
51+
52-
		xvalue += 1;
52+
HWND GetWindowByProcessId(int iProcessId, bool bWaitForHandle)
53-
		xvalue %= 256;
53+
54
	DWORD dwParams[2];
55
56-
	s[ BUFLEN - 1 ] = 0;
56+
	HWND hWndResult;
57
58-
#endif
58+
	
59
	do
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
60+
61-
// Use an online xor generator such as - http://www.tutogames.xpg.com.br/xorgen.html - Or create your own
61+
		dwParams[0] = iProcessId;
62
		dwParams[1] = NULL;
63-
// This xored string will run and decode your original string such as "aimbot-enable" at runtime and return a 
63+
64-
// string pointer for you to use
64+
		EnumWindows(MyEnumWindowsProc, (LPARAM)&dwParams);
65-
char* szAimbotOption = /*aimbot-enable*/XorStr<0xFC,13,0x9DB4EDA6>("\x8E\x9C\x9A\x9E\x72\x2C\x67\x6D\x65\x67\x6A\x62"+0x9DB4EDA6).s;
65+
66
		hWndResult = (HWND)dwParams[1];
67
68-
// If you are using C++ 11, you can use kingdeking's method of compile time encryption to for ease of use
68+
		if(hWndResult == NULL)
69-
http://www.unknowncheats.me/forum/c-and-c/113715-compile-time-string-encryption.html#post960461
69+
			Sleep(10);
70
71
	}while(hWndResult == NULL && bWaitForHandle == true);
72
73
	return hWndResult;
74
}
75
76
//----------------------------------//