-
Notifications
You must be signed in to change notification settings - Fork 46
/
GInterface.cpp
83 lines (64 loc) · 1.74 KB
/
GInterface.cpp
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
#include "GInterface.h"
void Empty() {
}
LONG NTAPI GInterface::VectoredHandler(EXCEPTION_POINTERS* ExceptionInfo)
{
if (ExceptionInfo->ExceptionRecord->ExceptionCode != 0x80000003 && ExceptionInfo->ExceptionRecord->ExceptionCode != 0xC0000094)
{
MessageBoxA(nullptr, "Fatal Exception!", to_string(ExceptionInfo->ExceptionRecord->ExceptionCode).c_str(), MB_OK);
EXCEPTION_CONTINUE_SEARCH;
}
else
{
if (ExceptionInfo->ExceptionRecord->ExceptionCode == 0xC0000094)
{
// ExceptionInfo->ContextRecord->Rip = (uint64_t)LuaCall;
ExceptionInfo->ContextRecord->Rip = (uintptr_t)Empty;
return EXCEPTION_CONTINUE_EXECUTION;
}
}
return EXCEPTION_CONTINUE_SEARCH;
}
void GInterface::WaitForReload()
{
if (Globals::Registered && !WoWObjectManager::InGame())
{
Globals::Registered = false;
}
Sleep(100);
if (!Globals::Registered && WoWObjectManager::InGame())
{
Globals::Registered = true;
Sleep(1000);
}
}
void GInterface::Init(HMODULE hModule)
{
// Console
FILE* pFile = nullptr;
AllocConsole();
freopen_s(&pFile, "CONOUT$", "w", stdout);
SetUnhandledExceptionFilter(VectoredHandler);
// Removed AntiCrashHandler
thread(Monitor, hModule).detach();
}
void GInterface::Monitor(HMODULE hModule)
{
while (!Globals::SafeToExit)
WaitForReload();
Sleep(100);
// Removed AntiCrashHandler
FreeConsole();
//menu's
Settings::bot::fishing::Enabled = false;
Settings::bot::Grinding::Enabled = false;
Settings::Drawing::Enabled = false;
Settings::Drawing::Radar::Enabled = false;
Settings::Drawing::EntityViewer::Enabled = false;
Settings::UI::Windows::Menu::GetInvItems = false;
//GameMethods::Cooldowns.clear();
Globals::LocalPlayer = nullptr;
Globals::Objects.clear();
delete Globals::Nav;
FreeLibrary(hModule);
}