View difference between Paste ID: JtpyiTL1 and v7Jrb5qb
SHOW: | | - or go back to the newest paste.
1
/*
2
-----------------------------------------
3
* Game hacking QTS ( Quickie Tip Series ) 
4-
* no. 27 - Automatic pointer checking
4+
* no. 28 - Printing to console in a dll
5
-----------------------------------------
6-
* Author: SEGnosis 	- GHAnon.net
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 H_USERDETOUR
24+
25-
#define H_USERDETOUR
25+
DWORD WINAPI StartUp(LPVOID lpvParam)
26
{
27
	AllocConsole(); // Allocate a new console
28
	AttachConsole(GetCurrentProcessId()); // Attach it to our current process
29
	freopen("CON", "w", stdout); // Reopen it for writing
30
31-
#include <Windows.h>
31+
	printf("Hello World!\n");
32
33
	return 0;
34
}
35
36
37-
struct S_Auto_Pointer
37+
BOOL WINAPI DllMain(HMODULE hInstance, DWORD dwReason, LPVOID lpvReserved)
38
{
39-
	DWORD* dwpClass;
39+
	switch(dwReason)
40-
	DWORD* dwpOffset;
40+
41-
	DWORD  dwOffsetAmount;
41+
		case DLL_PROCESS_ATTACH:
42
			CreateThread(0, 0, &StartUp, 0, 0, 0);
43-
	char* szpModule;
43+
		break;
44-
	DWORD dwBaseOffset;
44+
45-
};
45+
46
	return TRUE;
47
}
48
49
50
//----------------------------------//