#include "dll.h"
// Injection stuff "https://github.com/SimpleRealistic/styles-cheat-csgo-source/tree/master/INJ"
#include "ReflectiveLoader.h"
// Stuff to initialise
#include <Windows.h>
UCHAR szFileSys [255], szVolNameBuff [255];
DWORD dwMFL, dwSysFlags;
DWORD dwSerial;
LPCTSTR szHD = "C: \\"; // location HWID
typedef void (__ thiscall * CreateMoveFn) (void *, float, UserCmd *);
typedef void (__ thiscall * RunCommandFn) (void *, Entity *, UserCmd *, void *);
extern HINSTANCE hAppInstance;
long clientbase, enginebase;
int LBYBreakerTimer;
float lineLBY;
float lineRealAngle;
float lineFakeAngle;
int ResolverStage [65];
// Our DLL Instance
HINSTANCE HThisModule;
bool DoUnload;
Entity * local;
Entity * weapon;
CCSGOClient * client;
CBaseClass * engine;
CDrawManager * vgui;
CRenderManager * render;
CHvhManager * hvh;
CBaseClass * netvars;
CBaseClass * game;
CAimbotFrame * aimbot;
CESPManager * esp;
CESPManager * glow;
CMenu * gui;
GlobalVars * globals;
long * ents;
long * prediction;
long * move;
long * mode;
long * movehelper;
CreateMoveFn CreateMovePtr;
RunCommandFn RunCommandPtr;
inline void CreateMove (float time, UserCmd * cmd) {CreateMovePtr (mode, time, cmd); }
inline void RunCommand (Entity * player, UserCmd * cmd, void * helper) {RunCommandPtr (prediction, player, cmd, helper); }
typedef void (__ cdecl * MsgFn) (const char * msg, va_list);
void Msg (const char * msg, ...)
{
if (msg == nullptr)
return; // If no string was passed, or it was null then don't do anything
static MsgFn fn = (MsgFn) GetProcAddress (GetModuleHandle ("tier0.dll"), "Msg"); // This gets the address of export "Msg" in the dll "tier0.dll". The static keyword means it's only called once and then isn't called again (but the variable is still there)
char buffer [989];
va_list list; // Normal varargs stuff http://stackoverflow.com/questions/10482960/varargs-to-printf-all-arguments
va_start (list, msg);
wsprintf (buffer, msg, list);
va_end (list);
fn (buffer, list); // Calls the function, we got the address above.
}
long HookVirtual (long * vmt, long * fn, int index)
{
vmt = * (long **) vmt;
long origin = vmt [index];
void * adr = & vmt [index];
long prot;
VirtualProtect (& vmt [index], 4.0x40, (DWORD *) & prot);
vmt [index] = (long) fn;
VirtualProtect (& vmt [index], 4, (DWORD) prot, (DWORD *) & prot);
return origin;
}
void InitialThread ()
{
// Msg = (MsgFn) GetProcAddress (GetModuleHandleA ("tier0.dll"), "Warning");
Msg ("% s \ n", __COOL_DATE__);
clientbase = (long) GetModuleHandleA ("client.dll");
enginebase = (long) GetModuleHandleA ("engine.dll");
client = new CCSGOClient ();
engine = new CBaseClass ();
// vgui = new CDrawManager ();
hvh = new CHvhManager ();
render = new CRenderManager ();
// netvars = new CBaseClass ();
aimbot = new CAimbotFrame ();
// prediction = new PredictionManager ();
esp = new CESPManager ();
// cvars = new CvarManager ();
gui = new CMenu ();
// Msg ("% X \ n", Virtual (client-> move, 15));
// return;
globals = * (GlobalVars **) (clientbase + 0xA36E80);
CreateMovePtr = (CreateMoveFn) HookVirtual (mode, (long *) & CreateMove, 24);
RunCommandPtr = (RunCommandFn) HookVirtual (prediction, (long *) & RunCommand, 19);
// HookVirtual (client-> prediction, (long *) & InPrediction, 14);
// engine-> DrawModelPtr = (DrawModelFn) HookVirtual (engine-> render, (long *) & DrawModel, 21);
// engine-> SceneEndPtr = (SceneEndFn) HookVirtual (engine-> view, (long *) & SceneEnd, 9);
// vgui-> PaintTraversePtr = (PaintTraverseFn) HookVirtual (vgui-> panel, (long *) & PaintTraverse, 41);
// vgui-> KeyEventPtr = (KeyEventFn) HookVirtual (vgui-> enginevgui, (long *) & KeyEvent, 10);
Msg ("well we injected \ n");
}
BOOL WINAPI DllMain (HMODULE hModule, DWORD dwReason, LPVOID lpReserved)
{
switch (dwReason)
{
case DLL_PROCESS_ATTACH:
if (GetModuleHandleA ("csgo.exe"))
{
CreateThread (NULL, NULL, (LPTHREAD_START_ROUTINE) InitialThread, NULL, NULL, NULL);
}
else
{
ExitProcess (NULL);
return TRUE;
}
}
return TRUE;