-
Notifications
You must be signed in to change notification settings - Fork 2
/
DLLMain.cpp
98 lines (80 loc) · 2.08 KB
/
DLLMain.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
// Don't take credits for this ;) Joplin / Manhhao are the first uploaders ;)
//#define AYY_DEBUG
// General shit
#include "DLLMain.h"
#include "Utilities.h"
// Injection stuff
#include "INJ/ReflectiveLoader.h"
// Stuff to initialise
#include "Offsets.h"
#include "Interfaces.h"
#include "Hooks.h"
#include "RenderManager.h"
#include "Hacks.h"
#include "Menu.h"
#include "AntiAntiAim.h"
#include "Dumping.h"
// Used as part of the reflective DLL injection
extern HINSTANCE hAppInstance;
// Our DLL Instance
HINSTANCE HThisModule;
bool DoUnload;
// Our thread we use to setup everything we need
// Everything appart from code in hooks get's called from inside
// here.
int InitialThread()
{
#ifdef AYY_DEBUG
Utilities::OpenConsole("AyyWare");
#endif
// Intro banner with info
PrintMetaHeader();
//---------------------------------------------------------
// Initialise all our shit
Offsets::Initialise(); // Set our VMT offsets and do any pattern scans
Interfaces::Initialise(); // Get pointers to the valve classes
NetVar.RetrieveClasses(); // Setup our NetVar manager (thanks shad0w bby)
NetvarManager::Instance()->CreateDatabase();
Render::Initialise();
Hacks::SetupHacks();
Menu::SetupMenu();
Hooks::Initialise();
ApplyAAAHooks();
//GUI.LoadWindowState(&Menu::Window, "config.xml");
// Dumping
//Dump::DumpClassIds();
//---------------------------------------------------------
Utilities::Log("Ready");
// While our cheat is running
while (DoUnload == false)
{
Sleep(1000);
}
Hooks::UndoHooks();
Sleep(2000); // Make sure none of our hooks are running
FreeLibraryAndExitThread(HThisModule, 0);
return 0;
}
// DllMain
// Entry point for our module
BOOL WINAPI DllMain(
_In_ HINSTANCE hinstDLL,
_In_ DWORD fdwReason,
_In_ LPVOID lpvReserved
)
{
switch (fdwReason)
{
case DLL_QUERY_HMODULE:
if (lpvReserved != NULL)
*(HMODULE *)lpvReserved = hAppInstance;
break;
case DLL_PROCESS_ATTACH:
HThisModule = hinstDLL;
CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)InitialThread, NULL, NULL, NULL);
break;
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}