-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathninja.cpp
More file actions
26 lines (21 loc) · 724 Bytes
/
Copy pathninja.cpp
File metadata and controls
26 lines (21 loc) · 724 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
#include <windows.h>
#include <stdio.h>
int main() {
volatile int health = 100; //That tells the compiler: “This value might change—don’t assume.”
while (true) {
// Hotkey check
if (GetAsyncKeyState(VK_DOWN) & 0x8000) {
//MessageBoxA(NULL, "HOOKED!", "Hotkey Trigger", MB_OK);
health -=5;
printf("OUCH now i have only %d life left\n", health);
fflush(stdout);
if(health < 0) break;
}
// Optional trace point
printf("Idle..health is %d.\n", health);
printf("Address of health: %p\n", (void*)&health);
fflush(stdout);
Sleep(500); // Runtime footprint
}
return 0;
}