-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTrainer.c
114 lines (87 loc) · 5.83 KB
/
Trainer.c
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#include <windows.h>
#include <iostream>
#include <wchar.h>
#include <TlHelp32.h>
using namespace std;
int ProcessId(){
HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
if (hSnapshot) {
PROCESSENTRY32 processes;
processes.dwSize = sizeof(PROCESSENTRY32);
Process32First(hSnapshot,&processes);
do{
if(wcscmp(processes.szExeFile,L"HackSlashLoot.exe") == 0) return processes.th32ProcessID ;
}while(Process32Next(hSnapshot,&processes));
}
cout << "\n[~] Game is not started yet ,run the trainer after the game is started\n";
CloseHandle(hSnapshot);
exit(1);
return 1 ;
}
int VirtualAddress(){
HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, ProcessId());
if (hSnapshot) {
MODULEENTRY32 Module;
Module.dwSize = sizeof(MODULEENTRY32);
Module32First(hSnapshot,&Module);
do{
if(wcscmp(Module.szModule,L"HackSlashLoot.exe") == 0) {
return (int)(Module.modBaseAddr+0x7a6140);
}
}while(Module32Next(hSnapshot,&Module));
}
cout << "\n[~] Game has been closed ,restart it \n";
CloseHandle(hSnapshot);
exit(1);
return 1 ;
}
int main(){
// ████████╗██████╗ █████╗ ██╗███╗ ██╗███████╗██████╗ ██████╗ ██╗ ██╗ ██████╗ ██████╗ ███████╗ █████╗ ██╗████████╗
// ╚══██╔══╝██╔══██╗██╔══██╗██║████╗ ██║██╔════╝██╔══██╗ ██╔══██╗╚██╗ ██╔╝ ██╔══██╗╚════██╗██╔════╝██╔══██╗███║╚══██╔══╝
// ██║ ██████╔╝███████║██║██╔██╗ ██║█████╗ ██████╔╝ ██████╔╝ ╚████╔╝ ██║ ██║ █████╔╝█████╗ ███████║╚██║ ██║
// ██║ ██╔══██╗██╔══██║██║██║╚██╗██║██╔══╝ ██╔══██╗ ██╔══██╗ ╚██╔╝ ██║ ██║ ╚═══██╗██╔══╝ ██╔══██║ ██║ ██║
// ██║ ██║ ██║██║ ██║██║██║ ╚████║███████╗██║ ██║ ██████╔╝ ██║ ██████╔╝██████╔╝██║ ██║ ██║ ██║ ██║
// ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝
//
cout<<" /$$$$$$$$ /$$\n";
cout<<"|__ $$__/ |__/\n";
cout<<" | $$ /$$$$$$ /$$$$$$ /$$/$$$$$$$ /$$$$$$ /$$$$$$\n";
cout<<" | $$/$$__ $|____ $| $| $$__ $$/$$__ $$/$$__ $$\n";
cout<<" | $| $$ \\__//$$$$$$| $| $$ \\ $| $$$$$$$| $$ \\__/ \n";
cout<<" | $| $$ /$$__ $| $| $$ | $| $$_____| $$\n";
cout<<" | $| $$ | $$$$$$| $| $$ | $| $$$$$$| $$\n";
cout<<" |__|__/ \\_______|__|__/ |__/\\_______|__/\n";
cout<<" /$$ /$$$$$$$ /$$$$$$ /$$$$$$ /$$ /$$\n";
cout<<"| $$ | $$__ $$/$$__ $$/$$__ $$ /$$$$ | $$\n";
cout<<"| $$$$$$$ /$$ /$$ | $$ \\ $|__/ \\ $| $$ \\__/$$$$$$|_ $$/$$$$$$\n";
cout<<"| $$__ $| $$ | $$ | $$ | $$ /$$$$$| $$$$ |____ $$ | $|_ $$_/\n";
cout<<"| $$ \\ $| $$ | $$ | $$ | $$ |___ $| $$_/ /$$$$$$$ | $$ | $$\n";
cout<<"| $$ | $| $$ | $$ | $$ | $$/$$ \\ $| $$ /$$__ $$ | $$ | $$ /$$\n";
cout<<"| $$$$$$$| $$$$$$$ | $$$$$$$| $$$$$$| $$ | $$$$$$$/$$$$$| $$$$/\n";
cout<<"|_______/ \\____ $$ |_______/ \\______/|__/ \\_______|______/\\___/\n";
cout<<" /$$ | $$\n";
cout<<" | $$$$$$/\n";
cout<<" \\______/\n";
cout << "\n\n[~] Finding the ProcessId of the game to inject our code ";
int pid = ProcessId();
cout << "\n[~] ProcessID of the game is "<<pid;
cout << "\n[~] Hooking into our process ";
cout << "\n[~] Enjoy max Health ,Armour ,Attacks :) ";
int ptr,health,nhealth;
int max = 999 , pmax = 100 , dmax = 985;
HANDLE game = OpenProcess(PROCESS_VM_OPERATION|PROCESS_VM_READ|PROCESS_VM_WRITE,FALSE,pid);
if(game)
if(ReadProcessMemory(game,(void *)VirtualAddress(),&ptr,4,NULL))
if(ReadProcessMemory(game,(void *)(ptr+0x50),&health,4,NULL))
while(1){
WriteProcessMemory(game,(void *)(ptr+0x34),&pmax,4,NULL); // Melee Attack %
WriteProcessMemory(game,(void *)(ptr+0x38),&pmax,4,NULL); // Ranged Attack %
WriteProcessMemory(game,(void *)(ptr+0x3c),&pmax,4,NULL); // Magic Attack %
WriteProcessMemory(game,(void *)(ptr+0x40),&max,4,NULL); // Armour
WriteProcessMemory(game,(void *)(ptr+0x44),&max,4,NULL); // Melee Damage
WriteProcessMemory(game,(void *)(ptr+0x48),&max,4,NULL); // Ranged Damage
WriteProcessMemory(game,(void *)(ptr+0x4c),&dmax,4,NULL); // Magic Damage
WriteProcessMemory(game,(void *)(ptr+0x50),&max,4,NULL); // Health
}
return 0 ;
}