Repository navigation
Expand file tree
/
Copy pathWriteProcessMemory Hack.cpp
More file actions
60 lines (57 loc) · 1.58 KB
/
Copy pathWriteProcessMemory Hack.cpp
File metadata and controls
60 lines (57 loc) · 1.58 KB
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
#include <iostream>
#include <windows.h>
#include <winable.h>
using namespace std;
void memoryWrite()
{
HWND hWnd = FindWindow(0, "Window Name");
if(hWnd == 0)
{
MessageBox(0, "Error cannot find window.", "Error", MB_OK|MB_ICONERROR);
}
else
{
DWORD proccess_ID;
GetWindowThreadProcessId(hWnd, &proccess_ID);
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, proccess_ID);
if(!hProcess)
{
MessageBox(0, "Could not open the process!", "Error!", MB_OK|MB_ICONERROR);
}
else
{
int newdata = 0;
std::cout << "Pleas enter the new value: ";
std::cin >> newdata;
DWORD newdatasize = sizeof(newdata);
if(WriteProcessMemory(hProcess, (LPVOID)0x235EC8, &newdata, newdatasize, NULL)) // newdatasize = 4 byte
{
MessageBox(NULL, "WriteProcessMemory worked.", "Success", MB_OK + MB_ICONINFORMATION);
}
else
{
MessageBox(NULL, "Error cannot WriteProcessMemory!", "Error", MB_OK + MB_ICONERROR);
}
CloseHandle(hProcess);
}
}
}
int main(){
string agree; // terms and conditions yes or no
cout << "You must agree to our terms and conditions first (Y/N)? ";
cin >> agree;
if(agree =="y" || agree=="Y")
{
system("CLS"); // clear the screen
memoryWrite(); // function
}
else if(agree =="n" || agree=="N")
{
MessageBox(HWND_DESKTOP,"To use this software you must agree to our terms and conditions\nYou can read our terms and conditions online from this site below\n\nhttps://termsofuse.com\n","Error",MB_ICONINFORMATION| MB_OK);
}
else
{
cout << "Incorrect choice, pleas try again!" << endl;
}
return 0;
}