-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
64 lines (54 loc) · 1.44 KB
/
main.cpp
File metadata and controls
64 lines (54 loc) · 1.44 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include "includes.hpp"
#include "Proc.hpp"
#include "HackModule.hpp"
#include "byteArrays.hpp"
typedef unsigned int uint;
#define TEST false
int main()
{
Proc a(L"Terraria.exe");
#if TEST
std::vector<uint8_t> nop{ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 };
HackModule godModule(byteArrays::takeDamage, nop, "Godmode", a, false, '1');
while (1)
{
Sleep(1000);
}
#else
size_t add;
if (a.AOBScanUsefulRegions(byteArrays::takeDamage, add))
std::cout << std::hex << add << std::dec << std::endl;
else
std::cout << "no\n";
while (1)
{
if (_getch() == '1')
{
//research memset
uint8_t b[6]{ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 };
if (WriteProcessMemory(a.getHandle(), (void*)(add), &b, 6, NULL))
//if (a.WriteToProcessMemoryExplicit((void*)add, b, 6)) //for some reason it's crashing with the wrapper function.
std::cout << "Write godmode enable successful!\n";
else
std::cout << "Unsucessful.\n";
}
else if (_getch() == '2')
{
uint8_t b[6]{ 0x29, 0x82, 0x08, 0x04, 0x00, 0x00 }; //fix this, this shit don't write lmfao
if (WriteProcessMemory(a.getHandle(), (void*)(add), &b, 6, NULL))
//if (a.WriteToProcessMemoryExplicit((void*)(add), b, 6))
std::cout << "Write godmode disable successful!\n";
else
std::cout << "Unsucessful.\n";
}
else if (_getch() == 'n')
{
a.~Proc();
exit(0);
//break;
}
Sleep(300);
}
return 0;
#endif
}