-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWPMFF.cpp
More file actions
33 lines (24 loc) · 900 Bytes
/
WPMFF.cpp
File metadata and controls
33 lines (24 loc) · 900 Bytes
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
#include <windows.h>
#include <iostream>
int main() {
DWORD baseAddress = 0x54E6C634;
// DWORD offset = 0xA7;
// DWORD ptrAddress = 0x5123C634;
int newValue = 331;
HWND hWnd = FindWindow(0, "STARFOX64 - Project64 Version 1.6");
if (hWnd == 0) {
std::cout << "Cannot find window." << std::endl;
}
DWORD pId;
GetWindowThreadProcessId(hWnd, &pId);
HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pId);
if(pId == NULL){
std::cout << "Can not get process by ID " << std::endl;
}else{
WriteProcessMemory(hProc, (LPVOID)baseAddress, &newValue, sizeof(newValue), 0);
std::cout << "Done. " << &baseAddress << std::endl;
int readtest= 0;
ReadProcessMemory(hProc, (void*)baseAddress, &readtest, sizeof(int), 0);
std::cout << "Value is: " << readtest << std::endl;
}
}