Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <windows.h>
- int main()
- {
- HWND hWnd = FindWindow(0, "Calculator");
- 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 = 500;
- DWORD newdatasize = sizeof(newdata);
- while(1);
- {
- if(WriteProcessMemory(hProcess, (LPVOID)0x57C2A4, &newdata, newdatasize, NULL))
- {
- }
- else
- {
- MessageBox(NULL, "Error cannot WriteProcessMemory!", "Error", MB_OK + MB_ICONERROR);
- CloseHandle(hProcess);
- }
- CloseHandle(hProcess);
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement