Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // xxx.cpp : Definiert den Einstiegspunkt für die Konsolenanwendung.
- //
- #include "stdafx.h"
- #include <Windows.h>
- #include <iostream>
- #include <strsafe.h>
- using namespace std;
- int _tmain(int argc, _TCHAR* argv[])
- {
- long address = 0x000AA870;
- int newvalue = 200000;
- DWORD newvaluesize = sizeof(newvalue);
- HWND hWnd = FindWindow(NULL, TEXT("Solitär"));
- HANDLE pHandle;
- DWORD pid;
- if(hWnd != 0) {
- cout << "Notepad gefunden";
- GetWindowThreadProcessId(hWnd, &pid);
- pHandle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pid); // Handle beziehen
- }
- else {
- cout << "Notepad nicht gefunden";
- }
- if(pHandle !=0) {
- WriteProcessMemory(pHandle, (LPVOID)address, &newvalue, newvaluesize, 0);
- cout << "Written to memory successfully\n";
- getchar();
- }
- else {
- cout << "Couldn't get handle.\n";
- getchar();
- }
- CloseHandle(pHandle);
- getchar();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement