Repository navigation
Expand file tree
/
Copy pathmain.cpp
More file actions
43 lines (34 loc) · 1.57 KB
/
Copy pathmain.cpp
File metadata and controls
43 lines (34 loc) · 1.57 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
#include "utilities.hpp"
int main() {
printf("Attempting Patch...\n");
DWORD processId = GetPIDByName("GeometryDash.exe");
if (processId == 0) {
printf("Failed to find Geometry Dash!\n");
Sleep(3000);
return 1;
} else {
printf("Geometry Dash found!\n");
}
HANDLE processHandle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, processId);
MODULEINFO megaHackInfo = GetModule(processHandle, "absolllute.megahack.dll");
uintptr_t megaHackBase = reinterpret_cast<uintptr_t>(megaHackInfo.lpBaseOfDll);
if (megaHackBase == 0) {
printf("Failed to find Mega Hack!\n");
Sleep(3000);
return 1;
} else {
printf("Mega Hack found!\n");
}
printf("Patching #1\n");
LPVOID address = LPVOID(PatternScan(processHandle, megaHackBase, megaHackInfo.SizeOfImage, "74 ? 83 e9 ? 74 ? 8b 45"));
WriteBytesToProcess(processHandle, address, { 0x90, 0x90 });
printf("Patching #2\n");
LPVOID address2 = LPVOID(PatternScan(processHandle, megaHackBase, megaHackInfo.SizeOfImage, "74 ? 83 e8 ? 74 ? 83 e8 ? 74 ? 66 c7 45"));
WriteBytesToProcess(processHandle, address2, { 0x90, 0x90 });
printf("Patching #3\n");
LPVOID address3 = LPVOID(PatternScan(processHandle, megaHackBase, megaHackInfo.SizeOfImage, "74 ? 66 c7 45 ? ? ? 8d 45"));
WriteBytesToProcess(processHandle, address3, { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 });
printf("Patch Applied!\n");
Sleep(3000);
return 0;
}