Comment utiliser WriteProcessMemory
pour changer les munitions de mon adresse de munition actuelle? Je sais comment le lire, je ne sais pas comment l'écrire. Est SetAmmo. Je pensais que je fais tout ce qui est Wright?Comment accepter une entrée utilisateur pour une constante et utiliser writeprocessmemory?
code:
#include <iostream>
#include <math.h>
#include <conio.h>
#include <string.h>
#include <stdlib.h>
#include <Windows.h>
using namespace std;
DWORD pid;
DWORD Ammo = 0x07823C5EC;
int MyAmmo;
int SetAmmo = 1;
int main(){
HWND hwnd = FindWindowA(0, ("Garry's Mod"));
GetWindowThreadProcessId(hwnd, &pid);
HANDLE pHandle = OpenProcess(PROCESS_VM_READ, FALSE, pid);
ReadProcessMemory(pHandle, (LPVOID)Ammo, &MyAmmo, sizeof(MyAmmo), 0);
cout<<"Current Ammo = "<<MyAmmo<<endl;
WriteProcessMemory(pHandle, (LPVOID)Ammo, &SetAmmo, sizeof(SetAmmo), 0);
system("Pause");
return 0;
}
pourquoi cela ressemble vous essayez de faire un hack ? – Mischa