// Funtion Typedefs
typedef void(__thiscall* DrawModelEx_)(void*, void*, void*, const ModelRenderInfo_t&, matrix3x4*);
typedef void(__thiscall* PaintTraverse_)(PVOID, unsigned int, bool, bool);
typedef bool(__thiscall* InPrediction_)(PVOID);
typedef void(__stdcall *FrameStageNotifyFn)(ClientFrameStage_t);
typedef void(__thiscall* RenderViewFn)(void*, CViewSetup&, CViewSetup&, int, int);
using OverrideViewFn = void(__fastcall*)(void*, void*, CViewSetup*);
typedef float(__stdcall *oGetViewModelFOV)();
// Function Pointers to the originals
PaintTraverse_ oPaintTraverse;
DrawModelEx_ oDrawModelExecute;
FrameStageNotifyFn oFrameStageNotify;
OverrideViewFn oOverrideView;
RenderViewFn oRenderView;
// Hook function prototypes
void __fastcall PaintTraverse_Hooked(PVOID pPanels, int edx, unsigned int vguiPanel, bool forceRepaint, bool allowForce);
bool __stdcall Hooked_InPrediction();
void __fastcall Hooked_DrawModelExecute(void* thisptr, int edx, void* ctx, void* state, const ModelRenderInfo_t &pInfo, matrix3x4 *pCustomBoneToWorld);
bool __stdcall CreateMoveClient_Hooked(/*void* self, int edx,*/ float frametime, CUserCmd* pCmd);
void __stdcall Hooked_FrameStageNotify(ClientFrameStage_t curStage);
void __fastcall Hooked_OverrideView(void* ecx, void* edx, CViewSetup* pSetup);
float __stdcall GGetViewModelFOV();
void __fastcall Hooked_RenderView(void* ecx, void* edx, CViewSetup &setup, CViewSetup &hudViewSetup, int nClearFlags, int whatToDraw);
// VMT Managers
namespace Hooks
{;
// VMT Managers
Utilities::Memory::VMTManager VMTPanel; // Hooking drawing functions
Utilities::Memory::VMTManager VMTClient; // Maybe CreateMove
Utilities::Memory::VMTManager VMTClientMode; // CreateMove for functionality
Utilities::Memory::VMTManager VMTModelRender; // DrawModelEx for chams
Utilities::Memory::VMTManager VMTPrediction; // InPrediction for no vis recoil
Utilities::Memory::VMTManager VMTPlaySound; // Autoaccept
Utilities::Memory::VMTManager VMTRenderView;
};
// Undo our hooks
void Hooks::UndoHooks()
{
VMTPanel.RestoreOriginal();
VMTPrediction.RestoreOriginal();
VMTModelRender.RestoreOriginal();
VMTClientMode.RestoreOriginal();
}
// Initialise all our hooks
void Hooks::Initialise()
{
// Panel hooks for drawing to the screen via surface functions
VMTPanel.Initialise((DWORD*)Interfaces::Panels);
oPaintTraverse = (PaintTraverse_)VMTPanel.HookMethod((DWORD)&PaintTraverse_Hooked, Offsets::VMT::Panel_PaintTraverse);
//Utilities::Log("Paint Traverse Hooked");
// No Visual Recoi l
VMTPrediction.Initialise((DWORD*)Interfaces::Prediction);
VMTPrediction.HookMethod((DWORD)&Hooked_InPrediction, 14);
//Utilities::Log("InPrediction Hooked");
// Chams
VMTModelRender.Initialise((DWORD*)Interfaces::ModelRender);
oDrawModelExecute = (DrawModelEx_)VMTModelRender.HookMethod((DWORD)&Hooked_DrawModelExecute, Offsets::VMT::ModelRender_DrawModelExecute);
//Utilities::Log("DrawModelExecute Hooked");
// Setup ClientMode Hooks
VMTClientMode.Initialise((DWORD*)Interfaces::ClientMode);
VMTClientMode.HookMethod((DWORD)CreateMoveClient_Hooked, 24);
oOverrideView = (OverrideViewFn)VMTClientMode.HookMethod((DWORD)&Hooked_OverrideView, 18);
VMTClientMode.HookMethod((DWORD)&GGetViewModelFOV, 35);
// Setup client hooks
VMTClient.Initialise((DWORD*)Interfaces::Client);
oFrameStageNotify = (FrameStageNotifyFn)VMTClient.HookMethod((DWORD)&Hooked_FrameStageNotify, 36);
}
void MovementCorrection(CUserCmd* pCmd)
{
}
//---------------------------------------------------------------------------------------------------------
// Hooked Functions
//---------------------------------------------------------------------------------------------------------
// Animated ClanTag Function
void SetClanTag(const char* tag, const char* name)
{
static auto pSetClanTag = reinterpret_cast<void(__fastcall*)(const char*, const char*)>(((DWORD)Utilities::Memory::FindPattern("engine.dll", (PBYTE)"\x53\x56\x57\x8B\xDA\x8B\xF9\xFF\x15\x00\x00\x00\x00\x6A\x24\x8B\xC8\x8B\x30", "xxxxxxxxx????xxxxxx")));
pSetClanTag(tag, name);
}
// Blank Clantag
void NoClantag()
{
SetClanTag("", "");
}
// Clantag Functions
void ClanTag()
{
int speed = Menu::Window.MiscTab.OtherClantagspeed.GetValue();
static int counter = 0;
switch (Menu::Window.MiscTab.OtherClantag.GetIndex())
{
case 0:
// No
break;
case 1:
{
static int motion = 0;
int ServerTime = (float)Interfaces::Globals->interval_per_tick * hackManager.pLocal()->GetTickBase() * speed;
if (counter % 48 == 0)
motion++;
int value = ServerTime % 20;
switch (value) {
case 0:SetClanTag("hake", "hake"); break;
case 1:SetClanTag("hake", "hake"); break;
case 2:SetClanTag("hake", "hake"); break;
case 3:SetClanTag("hake", "hake"); break;
case 4:SetClanTag("hake", "hake"); break;
case 5:SetClanTag("hake", "hake"); break;
case 6:SetClanTag("hake", "hake"); break;
case 7:SetClanTag("hake", "hake"); break;
case 8:SetClanTag("hake", "hake"); break;
case 9:SetClanTag("cuck", "hake"); break;
case 10:SetClanTag("hake", "hake"); break;
case 11:SetClanTag("hake", "hake"); break;
case 12:SetClanTag("hake", "hake"); break;
case 13:SetClanTag("hake", "hake"); break;
case 14:SetClanTag("hake", "hake"); break;
case 15:SetClanTag("hake", "hake"); break;
case 16:SetClanTag("hake", "hake"); break;
case 17:SetClanTag("hake", "hake"); break;
case 18:SetClanTag("hake", "hake"); break;
case 19:SetClanTag("hake", "hake"); break;
}
counter++;
}
break;
case 2:
{
static int motion = 0;
int ServerTime = (float)Interfaces::Globals->interval_per_tick * hackManager.pLocal()->GetTickBase() * speed;
if (counter % 48 == 0)
motion++;
int value = ServerTime % 42;
switch (value) {
case 0: SetClanTag("/ ", "Complex"); break;
case 1: SetClanTag("- ", "Complex"); break;
case 2: SetClanTag("C ", "Complex"); break;
case 3: SetClanTag("C/ ", "Complex"); break;
case 4: SetClanTag("C- ", "Complex"); break;
case 5: SetClanTag("Co ", "Complex"); break;
case 6: SetClanTag("Co/ ", "Complex"); break;
case 7: SetClanTag("Co- ", "Complex"); break;
case 8: SetClanTag("Com ", "Complex"); break;
case 9: SetClanTag("Com/ ", "Complex"); break;
case 10:SetClanTag("Com- ", "Complex"); break;
case 11:SetClanTag("Comp ", "Complex"); break;
case 12:SetClanTag("Comp/ ", "Complex"); break;
case 13:SetClanTag("Comp- ", "Complex"); break;
case 14:SetClanTag("Compl ", "Complex"); break;
case 15:SetClanTag("Compl/ ", "Complex"); break;
case 16:SetClanTag("Compl- ", "Complex"); break;
case 17:SetClanTag("Comple ", "Complex"); break;
case 18:SetClanTag("Comple/", "Complex"); break;
case 19:SetClanTag("Comple-", "Complex"); break;
case 20:SetClanTag("Complex", "Complex"); break;
case 21:SetClanTag("Comple-", "Complex"); break;
case 22:SetClanTag("Comple/", "Complex"); break;
case 23:SetClanTag("Comple ", "Complex"); break;
case 24:SetClanTag("Compl- ", "Complex"); break;
case 25:SetClanTag("Compl/ ", "Complex"); break;
case 26:SetClanTag("Compl ", "Complex"); break;
case 27:SetClanTag("Comp- ", "Complex"); break;
case 28:SetClanTag("Comp/ ", "Complex"); break;
case 29:SetClanTag("Comp ", "Complex"); break;
case 30:SetClanTag("Com- ", "Complex"); break;
case 31:SetClanTag("Com/ ", "Complex"); break;
case 32:SetClanTag("Com ", "Complex"); break;
case 33:SetClanTag("Co- ", "Complex"); break;
case 34:SetClanTag("Co/ ", "Complex"); break;
case 35:SetClanTag("Co ", "Complex"); break;
case 36:SetClanTag("C- ", "Complex"); break;
case 37:SetClanTag("C/ ", "Complex"); break;
case 38:SetClanTag("C ", "Complex"); break;
case 39:SetClanTag("- ", "Complex"); break;
case 40:SetClanTag("/ ", "Complex"); break;
case 41:SetClanTag(" ", "Complex"); break;
}
counter++;
}
break;
case 3:
{
static int motion = 0;
int ServerTime = (float)Interfaces::Globals->interval_per_tick * hackManager.pLocal()->GetTickBase() * speed;
if (counter % 48 == 0)
motion++;
int value = ServerTime % 3;
switch (value) {
case 0:SetClanTag(">> Complex <<", "pasteware"); break;
case 1:SetClanTag(">Complex<", "pasteware"); break;
}
counter++;
}
break;
case 4:
// stainless
SetClanTag("\r", "\r");
break;
case 5:
SetClanTag("[VALV\xE1\xB4\xB1]", "Valve");
break;
case 6:
{
static int motion = 0;
int ServerTime = (float)Interfaces::Globals->interval_per_tick * hackManager.pLocal()->GetTickBase() * speed;
if (counter % 48 == 0)
motion++;
int value = ServerTime % 7;
switch (value) {
case 0:SetClanTag("dick", "pasteware"); break;
case 1:SetClanTag("fuck", "pasteware"); break;
case 2:SetClanTag("bitch", "pasteware"); break;
case 3:SetClanTag("cock", "pasteware"); break;
case 4:SetClanTag("coon", "pasteware"); break;
case 5:SetClanTag("nigger", "pasteware"); break;
case 6:SetClanTag("cunt", "pasteware"); break;
}
counter++;
}
break;
case 7:
time_t now = time(0);
char timestamp[10] = "";
strftime(timestamp, 10, "[%H:%M:%S]", localtime(&now));
SetClanTag(timestamp, "Time");
break;
}
}
// Rank Revealer
void MsgFunc_ServerRankRevealAll()
{
using MsgFunc_ServerRankRevealAllFn = bool(__cdecl*)(float*);
static MsgFunc_ServerRankRevealAllFn MsgFunc_ServerRankRevealAll = reinterpret_cast<MsgFunc_ServerRankRevealAllFn>((PDWORD)Utilities::Memory::FindPattern("client.dll", (PBYTE)"\x55\x8B\xEC\x8B\x0D\x00\x00\x00\x00\x68\x00\x00\x00\x00", "xxxxx????x????"));
float fArray[3];
fArray[0] = 0.f;
fArray[1] = 0.f;
fArray[2] = 0.f;
MsgFunc_ServerRankRevealAll(fArray);
}
BYTE bMoveData[0x200];
// Movement Prediction
void Prediction(CUserCmd* pCmd, IClientEntity* LocalPlayer)
{
if (Interfaces::MoveHelper && Menu::Window.RageBotTab.AimbotEnable.GetState() && Menu::Window.RageBotTab.AccuracyPrediction.GetState() && LocalPlayer->IsAlive())
{
float curtime = Interfaces::Globals->curtime;
float frametime = Interfaces::Globals->frametime;
int iFlags = LocalPlayer->GetFlags();
Interfaces::Globals->curtime = (float)LocalPlayer->GetTickBase() * Interfaces::Globals->interval_per_tick;
Interfaces::Globals->frametime = Interfaces::Globals->interval_per_tick;
Interfaces::MoveHelper->SetHost(LocalPlayer);
Interfaces::GamePrediction->SetupMove(LocalPlayer, pCmd, nullptr, bMoveData);
Interfaces::GameMovement->ProcessMovement(LocalPlayer, bMoveData);
Interfaces::GamePrediction->FinishMove(LocalPlayer, pCmd, bMoveData);
Interfaces::MoveHelper->SetHost(0);
Interfaces::Globals->curtime = curtime;
Interfaces::Globals->frametime = frametime;
*LocalPlayer->GetPointerFlags() = iFlags;
}
}
// Create moves
bool __stdcall CreateMoveClient_Hooked(float frametime, CUserCmd* pCmd)
{
if (!pCmd->command_number)
return true;
if (Interfaces::Engine->IsConnected() && Interfaces::Engine->IsInGame())
{
PVOID pebp;
__asm mov pebp, ebp;
bool* pbSendPacket = (bool*)(*(DWORD*)pebp - 0x1C);
bool& bSendPacket = *pbSendPacket;
CClientState* pClient;
INetChannel* pNet;
CInput* pInput;
if (Menu::Window.MiscTab.OtherClantag.GetIndex() > 0)
ClanTag();
// CUserCmd* cmdlist = *(CUserCmd**)((DWORD)Interfaces::pInput + 0xEC);
// CUserCmd* pCmd = &cmdlist[sequence_number % 150];
// Backup for safety
Vector origView = pCmd->viewangles;
Vector viewforward, viewright, viewup, aimforward, aimright, aimup;
Vector qAimAngles;
qAimAngles.Init(0.0f, pCmd->viewangles.y, 0.0f);
AngleVectors(qAimAngles, &viewforward, &viewright, &viewup);
// Do da hacks
IClientEntity *pLocal = Interfaces::EntList->GetClientEntity(Interfaces::Engine->GetLocalPlayer());
if (Interfaces::Engine->IsConnected() && Interfaces::Engine->IsInGame() && pLocal && pLocal->IsAlive())
Hacks::MoveHacks(pCmd, bSendPacket);
// Movement Fix
qAimAngles.Init(0.0f, GetAutostrafeView().y, 0.0f);
AngleVectors(qAimAngles, &viewforward, &viewright, &viewup);
qAimAngles.Init(0.0f, pCmd->viewangles.y, 0.0f);
AngleVectors(qAimAngles, &aimforward, &aimright, &aimup);
Vector vForwardNorm; Normalize(viewforward, vForwardNorm);
Vector vRightNorm; Normalize(viewright, vRightNorm);
Vector vUpNorm; Normalize(viewup, vUpNorm);
// Movement Prediction
if (Interfaces::Engine->IsConnected() && Interfaces::Engine->IsInGame() && pLocal)
{
if (pLocal->IsAlive())
{
Prediction(pCmd, pLocal);
}
}
// Original shit for movement correction
float forward = pCmd->forwardmove;
float right = pCmd->sidemove;
float up = pCmd->upmove;
if (forward > 450) forward = 450;
if (right > 450) right = 450;
if (up > 450) up = 450;
if (forward < -450) forward = -450;
if (right < -450) right = -450;
if (up < -450) up = -450;
pCmd->forwardmove = DotProduct(forward * vForwardNorm, aimforward) + DotProduct(right * vRightNorm, aimforward) + DotProduct(up * vUpNorm, aimforward);
pCmd->sidemove = DotProduct(forward * vForwardNorm, aimright) + DotProduct(right * vRightNorm, aimright) + DotProduct(up * vUpNorm, aimright);
pCmd->upmove = DotProduct(forward * vForwardNorm, aimup) + DotProduct(right * vRightNorm, aimup) + DotProduct(up * vUpNorm, aimup);
// Angle normalisation
if (Menu::Window.MiscTab.OtherSafeMode.GetState())
{
GameUtils::NormaliseViewAngle(pCmd->viewangles);
if (pCmd->viewangles.z != 0.0f)
{
pCmd->viewangles.z = 0.00;
}
if (pCmd->viewangles.x < -89 || pCmd->viewangles.x > 89 || pCmd->viewangles.y < -180 || pCmd->viewangles.y > 180)
{
GameUtils::NormaliseViewAngle(pCmd->viewangles);
Beep(750, 800);
if (pCmd->viewangles.x < -89 || pCmd->viewangles.x > 89 || pCmd->viewangles.y < -180 || pCmd->viewangles.y > 180)
{
pCmd->viewangles = origView;
pCmd->sidemove = right;
pCmd->forwardmove = forward;
}
}
}
if (pCmd->viewangles.x > 90)
{
pCmd->forwardmove = -pCmd->forwardmove;
}
if (pCmd->viewangles.x < -90)
{
pCmd->forwardmove = -pCmd->forwardmove;
}
if (bSendPacket)
LastAngleAA = pCmd->viewangles;
}
return false;
}
// Paint Traverse Hooked function
void __fastcall PaintTraverse_Hooked(PVOID pPanels, int edx, unsigned int vguiPanel, bool forceRepaint, bool allowForce)
{
if (Menu::Window.VisualsTab.OtherNoScope.GetState() && !strcmp("HudZoom", Interfaces::Panels->GetName(vguiPanel)))
return;
oPaintTraverse(pPanels, vguiPanel, forceRepaint, allowForce);
static unsigned int FocusOverlayPanel = 0;
static bool FoundPanel = false;
if (!FoundPanel)
{
PCHAR szPanelName = (PCHAR)Interfaces::Panels->GetName(vguiPanel);
if (strstr(szPanelName, "MatSystemTopPanel"))
{
FocusOverlayPanel = vguiPanel;
FoundPanel = true;
}
}
else if (FocusOverlayPanel == vguiPanel)
{
if (Menu::Window.MiscTab.WaterMark.GetState() == true)
{
static float rainbow;
rainbow += 0.005f;
if (rainbow > 1.f) rainbow = 0.f;
Render::Text(10, 10, Color::FromHSB(rainbow, 1.f, 1.f), Render::Fonts::Menu, "成功");