Folgende Warnungen sind aufgetreten:
Warning [2] preg_match_all(): The /e modifier is no longer supported, use preg_replace_callback instead - Line: 1007 - File: inc/highlighter.php PHP 7.4.33 (Linux)
File Line Function
[PHP]   errorHandler->error
/inc/highlighter.php 1007 preg_match_all
/inc/highlighter.php 112 generic_highlight
/inc/highlighter.php 48 generic_c_highlight
/inc/plugins/coolcode.php 133 cpp_highlight
/inc/plugins/coolcode.php 61 coolcode_run
/inc/class_plugins.php 139 coolcode_end
/inc/class_parser.php 232 pluginSystem->run_hooks
/printthread.php 184 postParser->parse_message
Warning [2] Invalid argument supplied for foreach() - Line: 1008 - File: inc/highlighter.php PHP 7.4.33 (Linux)
File Line Function
/inc/highlighter.php 1008 errorHandler->error
/inc/highlighter.php 112 generic_highlight
/inc/highlighter.php 48 generic_c_highlight
/inc/plugins/coolcode.php 133 cpp_highlight
/inc/plugins/coolcode.php 61 coolcode_run
/inc/class_plugins.php 139 coolcode_end
/inc/class_parser.php 232 pluginSystem->run_hooks
/printthread.php 184 postParser->parse_message



Home of Gamehacking - Archiv
[C++] External ScanPattern/WritePattern - Druckversion

+- Home of Gamehacking - Archiv (http://archiv-homeofgamehacking.de)
+-- Forum: Coding (http://archiv-homeofgamehacking.de/forumdisplay.php?fid=15)
+--- Forum: C, C#, C++, Visual C++ (http://archiv-homeofgamehacking.de/forumdisplay.php?fid=18)
+--- Thema: [C++] External ScanPattern/WritePattern (/showthread.php?tid=1249)



[C++] External ScanPattern/WritePattern - Acubra - 03.11.2012

Hey,
mir ist aufgefallen das ich die Scan/WritePattern Funktion aus meiner Trainerbase noch nicht released hab. Die Funktion ist relativ simple und kann nicht mit Wildcards umgehen, doch das kann man sehr einfach implementieren.

C++ Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
lpStartAddress = dwBaseAddress; //Start Address
	lpEndAddress = lpStartAddress + dwScanLength;

	//Calculate allocsize
	lpAllocSize = lpEndAddress - lpStartAddress;
	//Allocate memory
	AllocAddress = VirtualAlloc(0, lpAllocSize, MEM_COMMIT, PAGE_EXECUTE_READWRITE);

	//Read whole code and store it in Allocaddress
	ReadProcessMemory(hProcess, (LPVOID)lpStartAddress, AllocAddress, lpAllocSize, 0);
	int i = 0, j = 0;
        //i suck at coding ;X
	__asm
	{
			push eax
			mov eax, AllocAddress
			mov pointer, eax
			pop eax
	}

	while (i != dwScanLength)
	{
		if (pointer[i] == szOrigCode[j])
		{
			if (j+1 == nOrigCode)
			{
				//Calculate beginning of the byte sequence
				i++;
				i = i - nOrigCode;
				lpStartAddress += i;
				//Patch memory
				if((WriteProcessMemory(hProcess, (LPVOID)lpStartAddress, (LPCVOID)szModCode, nOrigCode, 0)) == 0)
				{
					//Oh noes, WPM error.
					PlaySoundFromResource(IDR_ERROR);
					MessageBox(NULL, _T("Failed to write to process memory.."), szErrorTitle, NULL);
					return 0;
				}
				else //Everything went fine.
				{
					PlaySoundFromResource(IDR_KILLEDXLIVE); //Activated sound.
					return 1;
				}
			}
			lpStartAddress += i;
			//std::cout << "Found one matching byte at %x" << lpStartAddress;
			lpStartAddress = dwBaseAddress;
			i++; //increase counter
			j++;
		}
		else
		{

			j = 0;
			i++;
		}

	}
	PlaySoundFromResource(IDR_ERROR);
	MessageBox(NULL, _T("Failed to find pattern!"), szErrorTitle, NULL);
	//Function failed
	return 0;