Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <windows.h>
- #include <iostream>
- #include <tlhelp32.h>
- #include <conio.h>
- #include <stdio.h>
- using namespace std;
- #define BaseOffset 0xBAFA8
- #define Offset1 0x50
- #define Offset2 0x14
- #define Addressname "Solitaire.exe"
- bool SetDebugPrivileges();
- int main(){
- HWND hWnd;
- HANDLE handle;
- DWORD ID;
- DWORD Punkte;
- DWORD rw;
- int Points;
- DWORD baseptr;
- DWORD basepptr;
- LPCTSTR WindowName = "Solitär";
- cout << "Suche nach Prozess..." << endl;
- do{
- Sleep(1000);
- hWnd = FindWindow( NULL, WindowName);
- }while(!hWnd);
- system("cls");
- GetWindowThreadProcessId(hWnd, &ID);
- DWORD BaseAddress = (DWORD) GetModuleHandle(Addressname);
- SetDebugPrivileges();
- handle = OpenProcess(PROCESS_ALL_ACCESS, false, ID);
- ReadProcessMemory(handle, (void*) (BaseAddress + BaseOffset), &baseptr, sizeof(baseptr), &rw);
- ReadProcessMemory(handle, (void*) (baseptr+Offset1), &basepptr, sizeof(basepptr), &rw);
- ReadProcessMemory(handle, (void*) (basepptr+Offset2), &Punkte, sizeof(Points), &rw);
- cout << "du hast " << Punkte << " Punkte." << endl;
- while(true){
- cout << "Deine Punkte werden gesetzt auf: " << endl;
- cin >> Points;
- WriteProcessMemory(handle, (void*) (basepptr+Offset2), &Points, sizeof(Points), &rw);
- system("cls");
- }
- CloseHandle(handle);
- return 0;
- }
- bool SetDebugPrivileges(){
- HANDLE hToken;
- TOKEN_PRIVILEGES tokenPriv;
- tokenPriv.PrivilegeCount = 1;
- if(!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &hToken))
- return false;
- if(!LookupPrivilegeValue(NULL, SE_DEBUG_NAME, &tokenPriv.Privileges[0].Luid))
- return false;
- tokenPriv.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
- if(!AdjustTokenPrivileges(hToken, false, &tokenPriv, sizeof(TOKEN_PRIVILEGES), NULL, NULL))
- return false;
- return true;
- }
Add Comment
Please, Sign In to add comment