-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Code simplification. Change pPlayer variable type from DWORD to size_t.
- Loading branch information
1 parent
2fe8465
commit 89a36a6
Showing
1 changed file
with
10 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,33 @@ | ||
#include <iostream> | ||
#include <Windows.h> | ||
|
||
using namespace std; | ||
|
||
int main() | ||
{ | ||
HANDLE handle = NULL; | ||
|
||
while (handle == NULL) | ||
{ | ||
printf("Searching for game process"); | ||
Sleep(900); | ||
printf("."); | ||
Sleep(900); | ||
printf("."); | ||
Sleep(900); | ||
printf("."); | ||
Sleep(900); | ||
HWND hwnd = FindWindowA(0, ("Cuphead")); | ||
DWORD processID; | ||
GetWindowThreadProcessId(hwnd, &processID); | ||
handle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, processID); | ||
system("cls"); | ||
Sleep(1); | ||
} | ||
|
||
system("cls"); | ||
printf("Process found!"); | ||
|
||
DWORD pPlayer = 0; | ||
BYTE invictible = 1; | ||
BYTE invincibility = 1; | ||
size_t pPlayer = 0; | ||
|
||
for (;;) | ||
{ | ||
ReadProcessMemory(handle, (LPVOID)(0x1020A13C), &pPlayer, sizeof(pPlayer), 0); | ||
ReadProcessMemory(handle, (LPVOID)(pPlayer + 0x740), &pPlayer, sizeof(pPlayer), 0); | ||
ReadProcessMemory(handle, (LPVOID)(pPlayer + 0x34), &pPlayer, sizeof(pPlayer), 0); | ||
ReadProcessMemory(handle, (LPVOID)(pPlayer + 0x8), &pPlayer, sizeof(pPlayer), 0); | ||
ReadProcessMemory(handle, (LPVOID)(pPlayer + 0x18), &pPlayer, sizeof(pPlayer), 0); | ||
WriteProcessMemory(handle, (LPVOID)(pPlayer + 0x6C), &invictible, sizeof(invictible), 0); | ||
Sleep(5000); | ||
ReadProcessMemory(handle, (LPVOID)(0x1020A13C), &pPlayer, sizeof(int), 0); | ||
ReadProcessMemory(handle, (LPVOID)(pPlayer + 0x740), &pPlayer, sizeof(int), 0); | ||
ReadProcessMemory(handle, (LPVOID)(pPlayer + 0x34), &pPlayer, sizeof(int), 0); | ||
ReadProcessMemory(handle, (LPVOID)(pPlayer + 0x8), &pPlayer, sizeof(int), 0); | ||
ReadProcessMemory(handle, (LPVOID)(pPlayer + 0x18), &pPlayer, sizeof(int), 0); | ||
WriteProcessMemory(handle, (LPVOID)(pPlayer + 0x6C), &invincibility, sizeof(invincibility), 0); | ||
Sleep(1); | ||
} | ||
return 0; | ||
} |