UwUHax/dllmain.cpp
2021-08-27 18:58:23 +07:00

46 lines
785 B
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include "hooks.h"
#include "model.h"
#include "panel.h"
#include "cmove.h"
#include "hooking.hpp"
vmt_hook* paint;
vmt_hook* engine;
vmt_hook* drawmodel;
void InitThread()
{
static bool once = false;
if (!once)
{
InitialiseInterfaces();
g_Netvarmanager.Init();
paint = new vmt_hook(pPanel);
painttraverse_original = paint->hook<paint_traverse_t>(41, hkPaintTraverse);
engine = new vmt_hook(pEngine);
org_SetViewAngles = engine->hook<SetViewAngleFn>(20, hooked_SetViewAngles);
drawmodel = new vmt_hook(pModelRender);
draw_model_original = drawmodel->hook<DrawModelExecuteFn>(19, hkDrawModelExecute);
Draw::InitFonts();
once = true;
}
}
int __stdcall DllMain(void*, int r, void*)
{
if (r == 1)
{
InitThread();
}
return 1;
}