Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <thread>
- #include "Hooks.h"
- #include "Utils\Utils.h"
- #include "Features\Features.h"
- #include "Menu\Menu.h"
- #include "SDK\Hitboxes.h"
- #include "libloaderapi.h"
- #include "Features/rankchanger/rankchanger.h"
- #include "Fonts.h"
- #include "ImGui/imgui.h"
- #include "ImGui/imgui_internal.h"
- #include "ImGui/dx9/imgui_dx9.h"
- #include "Features/rankchanger/Protobuffs.h"
- #include "Features/rankchanger/IMemAlloc.h"
- #include "Features/rankchanger/steam.h"
- #include "SDK/IMDLCache.h"
- #include "Features/skinchanger/skinchanger.h"
- #include "Features/skinchanger/trashconst.h"
- #include "Features/customskinchanger/customskinchanger.h"
- #include "Features/grenadetracer/grenadetracer.h"
- #include "Features/logs/logs.h"
- #include "Features/damage esp/damageesp.h"
- #include "Features/clantags/clantag.h"
- #include "Features/Backdrop/drop.h"
- #include "Menu/fonts1.h"
- #include "Features/custommodelchanger/custommodelchanger.h"
- #include "Features/uselessconst.h"
- #include "Features/uselesshitbytes.h"
- #include <d3dx9core.h>
- #include <intrin.h>
- #include "Features/Visuals/SPoint.h"
- #include "Features/TriggerBot/TriggerBot.h"
- #include <array>
- #include "Features/asdfshit.h"
- #include "Features/custom_ui/UI.h"
- #include "detourhooks.h"
- #include <string.h>
- #include <process.h>
- #pragma comment(lib, "Winmm.lib")
- #pragma comment (lib, "d3dx9.lib")
- float lastkilltime;
- int gitgrp;
- void OffscreenESP(Color colour, IDirect3DDevice9* pDevice);
- static bool menu_open = false;
- static bool d3d_init = false;
- bool PressedKeys[256] = {};
- int kill;
- int killstreak;
- Protobuffs write;
- C_HookedEvents hooked_events;
- Misc g_Misc;
- Hooks g_Hooks;
- ImFont* Text;
- ImFont* Tabs;
- ImFont* icon;
- ImFont* icon2;
- ImFont* anti_aim;
- ImFont* Main;
- ImFont* Main1;
- ImFont* Main2;
- ImFont* Main3;
- ImFont* LW;
- ImFont* LW2;
- LPD3DXFONT fntVerdana10;
- bool input_shouldListen;
- ButtonCode_t* input_receivedKeyval;
- static char ConfigNamexd[64] = { 0 };
- static char* clantagname;
- cDetour<Hooks::PaintTraverse_t>* oPaintTraverse_t;
- cDetour<Hooks::LockCursor_t>* oLockCursor_t;
- cDetour<Hooks::EndSceneFn>* oEndSceneFn;
- cDetour<Hooks::EndSceneResetFn>* oEndSceneResetFn;
- cDetour<Hooks::D3D9FEATURES>* oD3D9FEATURES;
- cDetour<Hooks::SetMouseCodeState_t>* oSetMouseCodeState_t;
- cDetour<Hooks::SetKeyCodeState_t>* oSetKeyCodeState_t;
- cDetour<Hooks::SvCheatsGetBoolFn>* oSvCheatsGetBoolFn;
- cDetour<Hooks::FrameStageNotify_t>* oFrameStageNotify_t;
- cDetour<Hooks::GCSendMessage>* oGCSendMessage;
- cDetour<Hooks::GCRetrieveMessage>* oGCRetrieveMessage;
- cDetour<Hooks::CreateMove_t>* oCreateMove_t;
- cDetour<Hooks::OverrideView_t>* oOverrideView_t;
- cDetour<Hooks::DoPostScreenEffects_t>* oDoPostScreenEffects_t;
- cDetour<Hooks::DrawModelExecute_t>* oDrawModelExecute_t;
- cDetour<Hooks::FireEventClientSide>* oFireEventClientSide;
- cDetour<Hooks::FindMDL_t>* oFindMDL_t;
- cDetour<Hooks::DispatchUserMessageFn>* oDispatchUserMessageFn;
- std::string GetWeaponName3()
- {
- switch (Shonax.number)
- {
- case (int)ItemDefinitionIndex::WEAPON_DEAGLE:
- return (("desert eagle"));
- case (int)ItemDefinitionIndex::WEAPON_ELITE:
- return (("dual berettas"));
- case (int)ItemDefinitionIndex::WEAPON_FIVESEVEN:
- return (("five-seveN"));
- case (int)ItemDefinitionIndex::WEAPON_GLOCK:
- return (("glock-18"));
- case (int)ItemDefinitionIndex::WEAPON_AK47:
- return (("ak-47"));
- case (int)ItemDefinitionIndex::WEAPON_AUG:
- return (("aug"));
- case (int)ItemDefinitionIndex::WEAPON_AWP:
- return (("awp"));
- case (int)ItemDefinitionIndex::WEAPON_FAMAS:
- return (("famas"));
- case (int)ItemDefinitionIndex::WEAPON_G3SG1:
- return (("g3sg1"));
- case (int)ItemDefinitionIndex::WEAPON_GALILAR:
- return (("galil"));
- case (int)ItemDefinitionIndex::WEAPON_M249:
- return (("m249"));
- case(int)ItemDefinitionIndex::WEAPON_M4A1:
- return (("m4a1"));
- case (int)ItemDefinitionIndex::WEAPON_MAC10:
- return (("mac-10"));
- case (int)ItemDefinitionIndex::WEAPON_P90:
- return (("p90"));
- case (int)ItemDefinitionIndex::WEAPON_UMP45:
- return (("ump-45"));
- case (int)ItemDefinitionIndex::WEAPON_XM1014:
- return (("xm1014"));
- case (int)ItemDefinitionIndex::WEAPON_BIZON:
- return (("bizon"));
- case (int)ItemDefinitionIndex::WEAPON_MAG7:
- return (("mag-7"));
- case (int)ItemDefinitionIndex::WEAPON_NEGEV:
- return (("negev"));
- case (int)ItemDefinitionIndex::WEAPON_SAWEDOFF:
- return (("sawed-off"));
- case (int)ItemDefinitionIndex::WEAPON_TEC9:
- return (("tec-9"));
- case (int)ItemDefinitionIndex::WEAPON_TASER:
- return (("zeus"));
- case (int)ItemDefinitionIndex::WEAPON_HKP2000:
- return (("p2000"));
- case (int)ItemDefinitionIndex::WEAPON_MP7:
- return (("mp7"));
- case (int)ItemDefinitionIndex::WEAPON_MP9:
- return (("mp9"));
- case (int)ItemDefinitionIndex::WEAPON_NOVA:
- return (("nova"));
- case (int)ItemDefinitionIndex::WEAPON_P250:
- return (("p250"));
- case (int)ItemDefinitionIndex::WEAPON_SCAR20:
- return (("scar-20"));
- case (int)ItemDefinitionIndex::WEAPON_SG556:
- return (("sg 553"));
- case (int)ItemDefinitionIndex::WEAPON_SSG08:
- return (("ssg 08"));
- case (int)ItemDefinitionIndex::WEAPON_KNIFE:
- return (("knife"));
- case (int)ItemDefinitionIndex::WEAPON_KNIFE_T:
- return (("knife"));
- case (int)ItemDefinitionIndex::WEAPON_FLASHBANG:
- return (("flashbang"));
- case (int)ItemDefinitionIndex::WEAPON_HEGRENADE:
- return (("he grenade"));
- case (int)ItemDefinitionIndex::WEAPON_SMOKEGRENADE:
- return (("smoke grenade"));
- case (int)ItemDefinitionIndex::WEAPON_MOLOTOV:
- return (("molotov"));
- case(int)ItemDefinitionIndex::WEAPON_DECOY:
- return (("decoy"));
- case (int)ItemDefinitionIndex::WEAPON_INCGRENADE:
- return (("incendiary grenade"));
- case (int)ItemDefinitionIndex::WEAPON_C4:
- return (("c4"));
- case (int)ItemDefinitionIndex::WEAPON_M4A1_SILENCER:
- return (("m4a1-S"));
- case(int)ItemDefinitionIndex::WEAPON_USP_SILENCER:
- return (("usp-s"));
- case (int)ItemDefinitionIndex::WEAPON_CZ75A:
- return (("cz75-auto"));
- case (int)ItemDefinitionIndex::WEAPON_REVOLVER:
- return (("r8 revolver"));
- default:
- return (("none"));
- }
- return ("");
- }
- namespace ImGui
- {
- static auto vector_getterxd = [](void* vec, int idx, const char** out_text)
- {
- auto& vector = *static_cast<std::vector<std::string>*>(vec);
- if (idx < 0 || idx >= static_cast<int>(vector.size())) { return false; }
- *out_text = vector.at(idx).c_str();
- return true;
- };
- IMGUI_API bool ComboBoxArrayxd(const char* label, int* currIndex, std::vector<std::string>& values)
- {
- if (values.empty()) { return false; }
- return Combo(label, currIndex, vector_getterxd,
- static_cast<void*>(&values), values.size());
- }
- }
- void line(int x, int y, int x2, int y2, Color color)
- {
- g_pSurface->DrawSetColor(color);
- g_pSurface->DrawLine(x, y, x2, y2);
- }
- struct hud_weapons_t
- {
- std::int32_t* get_weapon_count()
- {
- return reinterpret_cast<std::int32_t*>(std::uintptr_t(this) + 0x80);
- }
- };
- template<class T>
- static T* FindHudElement(const char* name)
- {
- static auto pThis = *reinterpret_cast<DWORD**>(Utils::FindSignature(("client_panorama.dll"), ("B9 ? ? ? ? E8 ? ? ? ? 8B 5D 08")) + 1);
- static auto find_hud_element = reinterpret_cast<DWORD(__thiscall*)(void*, const char*)>(Utils::FindSignature(("client_panorama.dll"), ("55 8B EC 53 8B 5D 08 56 57 8B F9 33 F6 39 77 28")));
- return (T*)find_hud_element(pThis, name);
- }
- void KnifeApplyCallbk()
- {
- static auto clear_hud_weapon_icon_fn = reinterpret_cast<std::int32_t(__thiscall*)(void*, std::int32_t)>(Utils::FindSignature(("client_panorama.dll"), ("55 8B EC 51 53 56 8B 75 08 8B D9 57 6B FE 2C")));
- auto element = FindHudElement<std::uintptr_t*>(("CCSGO_HudWeaponSelection"));
- auto hud_weapons = reinterpret_cast<hud_weapons_t*>(std::uintptr_t(element) - 0xA0);
- if (hud_weapons == nullptr)
- return;
- if (!*hud_weapons->get_weapon_count())
- return;
- for (std::int32_t i = 0; i < *hud_weapons->get_weapon_count(); i++)
- i = clear_hud_weapon_icon_fn(hud_weapons, i);
- g_pClientState->ForceFullUpdate();
- }
- static DWORD* deathNotice;
- static void(__thiscall *ClearDeathNotices)(DWORD);
- static bool fuckingcheck;
- static bool anotherpcheck;
- static bool shitchamsworkplease;
- static bool buybotfix;
- void things(IGameEvent* pEvent)
- {
- if (!strcmp(pEvent->GetName(), "round_prestart") && g_pEngine->IsInGame() && g_pEngine->IsConnected() && g::pLocalEntity)
- {
- deathNotice = nullptr;
- fuckingcheck = true;
- anotherpcheck = true;
- shitchamsworkplease = true;
- buybotfix = true;
- }
- }
- bool LabelClick(const char* concatoff, const char* concaton, const char* label, bool* v, const char* unique_id)
- {
- ImGuiWindow* window = ImGui::GetCurrentWindow();
- if (window->SkipItems)
- return false;
- // The concatoff/on thingies were for my weapon config system so if we're going to make that, we still need this aids.
- char Buf[64];
- _snprintf(Buf, 62, "%s%s", ((*v) ? concatoff : concaton), label);
- ImGuiContext& g = *GImGui;
- const ImGuiStyle& style = g.Style;
- const ImGuiID id = window->GetID(unique_id);
- const ImVec2 label_size = ImGui::CalcTextSize(label, NULL, true);
- const ImRect check_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(label_size.y + style.FramePadding.y * 2, label_size.y + style.FramePadding.y * 2));
- ImGui::ItemSize(check_bb, style.FramePadding.y);
- ImRect total_bb = check_bb;
- if (label_size.x > 0)
- ImGui::SameLine(0, style.ItemInnerSpacing.x);
- const ImRect text_bb(window->DC.CursorPos + ImVec2(0, style.FramePadding.y), window->DC.CursorPos + ImVec2(0, style.FramePadding.y) + label_size);
- if (label_size.x > 0)
- {
- ImGui::ItemSize(ImVec2(text_bb.GetWidth(), check_bb.GetHeight()), style.FramePadding.y);
- total_bb = ImRect(ImMin(check_bb.Min, text_bb.Min), ImMax(check_bb.Max, text_bb.Max));
- }
- if (!ImGui::ItemAddxd(total_bb, id))
- return false;
- bool hovered, held;
- bool pressed = ImGui::ButtonBehavior(total_bb, id, &hovered, &held);
- if (pressed)
- *v = !(*v);
- if (label_size.x > 0.0f)
- ImGui::RenderText(check_bb.GetTL(), Buf);
- return pressed;
- }
- C_BaseEntity* UTIL_PlayerByIndex(int index)
- {
- typedef C_BaseEntity*(__fastcall* PlayerByIndex)(int);
- static PlayerByIndex UTIL_PlayerByIndex = (PlayerByIndex)Utils::FindSignature("server.dll", "85 C9 7E 2A A1");
- if (!UTIL_PlayerByIndex)
- return false;
- return UTIL_PlayerByIndex(index);
- }
- void LoadNamedSky(const char *sky_name)
- {
- static auto fnLoadNamedSkys = (void(__fastcall*)(const char*))Utils::FindSignature("engine.dll", "55 8B EC 81 EC ? ? ? ? 56 57 8B F9 C7 45");
- fnLoadNamedSkys(sky_name);
- anotherpcheck = false;
- }
- ButtonCode_t tp_key1;
- void KeyBindButton(ButtonCode_t* key)
- {
- bool clicked = false;
- std::string text = g_pInputSystem->ButtonCodeToString(*key);
- std::string unique_id = std::to_string((int)key);
- if (*key <= BUTTON_CODE_NONE)
- text = ("Key not set");
- if (input_shouldListen && input_receivedKeyval == key) {
- clicked = true;
- text = ("...");
- }
- text += ("]");
- ImGui::SameLine();
- LabelClick(("["), ("["), text.c_str(), &clicked, unique_id.c_str());
- if (clicked)
- {
- input_shouldListen = true;
- input_receivedKeyval = key;
- }
- if (*key == KEY_DELETE)
- {
- *key = BUTTON_CODE_NONE;
- }
- if (ImGui::IsItemHovered())
- ImGui::SetTooltip(("Bind the \"del\" key to remove current bind."));
- }
- void setviewmovelscallback()
- {
- g_pCvar->FindVar("viewmodel_fov")->fnChangeCallback.SetSize(0);
- g_pCvar->FindVar("viewmodel_offset_x")->fnChangeCallback.SetSize(0);
- g_pCvar->FindVar("viewmodel_offset_y")->fnChangeCallback.SetSize(0);
- g_pCvar->FindVar("viewmodel_offset_z")->fnChangeCallback.SetSize(0);
- }
- bool __fastcall Hooks::Hooked_FireEventClientSide(void *ecx, void* edx, IGameEvent* pEvent)
- {
- //static auto ofunct = g_Hooks.pEvent->GetOriginal<FireEventClientSide>(9);
- if (!pEvent)
- return oFireEventClientSide->GetTrampoline()(ecx, pEvent);
- DamageESP::HandleGameEvent(pEvent);
- return oFireEventClientSide->GetTrampoline()(ecx, pEvent);
- }
- #include "vfunct/vfuncthook.h"
- vfunc_hook gc_hook;
- EGCResultxd __fastcall hkGCRetrieveMessage(void* ecx, void*, uint32_t *punMsgType, void *pubDest, uint32_t cubDest, uint32_t *pcubMsgSize)
- {
- //static auto oGCRetrieveMessage = gc_hook.get_original<Hooks::GCRetrieveMessage>(vtable_indexes::retrieve_message);
- auto status = oGCRetrieveMessage->GetTrampoline()(ecx, punMsgType, pubDest, cubDest, pcubMsgSize);
- if (status == k_EGCResultOK)
- {
- void* thisPtr = nullptr;
- __asm mov thisPtr, ebx;
- auto oldEBP = *reinterpret_cast<void**>((uint32_t)_AddressOfReturnAddress() - 4);
- uint32_t messageType = *punMsgType & 0x7FFFFFFF;
- write.ReceiveMessage(thisPtr, oldEBP, messageType, pubDest, cubDest, pcubMsgSize);
- if (Shonax.newfeatures.special && !g_pEngine->IsConnected() && !g_pEngine->IsInGame())
- {
- static auto SetLocalPlayerReadyFn = reinterpret_cast<bool(__stdcall*)(const char*)>(Utils::FindSignature("client_panorama.dll", "55 8B EC 83 E4 F8 8B 4D 08 BA ? ? ? ? E8 ? ? ? ? 85 C0 75 12"));
- if (SetLocalPlayerReadyFn)
- SetLocalPlayerReadyFn("");
- }
- }
- return status;
- }
- EGCResultxd __fastcall hkGCSendMessage(void* ecx, void*, uint32_t unMsgType, const void* pubData, uint32_t cubData)
- {
- //static auto oGCSendMessage = gc_hook.get_original<Hooks::GCSendMessage>(vtable_indexes::send_message);
- EGCResult status;
- bool sendMessage = write.PreSendMessage(unMsgType, const_cast<void*>(pubData), cubData);
- if (!sendMessage)
- return k_EGCResultOKxd;
- return oGCSendMessage->GetTrampoline()(ecx, unMsgType, const_cast<void*>(pubData), cubData);
- }
- bool __fastcall hkDispatchUserMessage(void* ecx, void* edx, int type, unsigned int a3, unsigned int length, bf_read &msg_data)
- {
- //static auto oDispatchUserMessage = framestage.get_original<DispatchUserMessageFn>(38);
- if (Shonax.newfeatures.antikick && type == static_cast<int>(46))
- {
- bf_read read = bf_read(msg_data);
- read.SetOffset(2);
- auto ent_index = read.ReadByte();
- auto vote_type = read.ReadByte();
- g_pCvar->ConsoleColorPrintf(Color(1.0f, 0.0f, 0.0f), "Anti-Kicking... \n");
- g_pEngine->ExecuteClientCmd("callvote swapteams");
- }
- return oDispatchUserMessageFn->GetTrampoline()(ecx, type, a3, length, msg_data);
- }
- void Draw_Line(int x1, int y1, int x2, int y2, Color color)
- {
- g_pSurface->DrawSetColor(color.red, color.green, color.blue, color.alpha);
- g_pSurface->DrawLine(x1, y1, x2, y2);
- }
- void DrawZeusRange() {
- if (!g_pEngine->IsConnected() || !g_pEngine->IsInGame())
- return;
- if (!g::pLocalEntity) return;
- if (!*(bool*)((uintptr_t)g_pInput + 0xAD))
- return;
- if (!Shonax.newfeatures.drawzeus)
- return;
- auto weapon = g::pLocalEntity->GetActiveWeapon();
- if (weapon->GetItemDefinitionIndex() != ItemDefinitionIndex::WEAPON_TASER)
- return;
- float step = M_PI * 2.0 / 1023;
- float rad = weapon->GetCSWpnData()->range;
- Vector origin = g::pLocalEntity->GetEyePosition();
- static double rainbow;
- Vector screenPos;
- static Vector prevScreenPos;
- for (float rotation = 0; rotation < (M_PI * 2.0); rotation += step)
- {
- Vector pos(rad * cos(rotation) + origin.x, rad * sin(rotation) + origin.y, origin.z);
- C_Trace trace;
- CTraceEntity filter(g::pLocalEntity);
- filter.pSkip1 = g::pLocalEntity;
- g_pTrace->TraceRay(C_Ray(origin, pos), MASK_SHOT_BRUSHONLY, &filter, &trace);
- if (g_pIVDebugOverlay->ScreenPosition(trace.end, screenPos))
- continue;
- if (!prevScreenPos.IsZero() && !screenPos.IsZero() && screenPos.DistTo(Vector(-107374176, -107374176, -107374176)) > 3.f&& prevScreenPos.DistTo(Vector(-107374176, -107374176, -107374176)) > 3.f) {
- rainbow += 0.00001;
- if (rainbow > 1.f)
- rainbow = 0;
- Color color = Color::FromHSB(rainbow, 1.f, 1.f);
- Draw_Line(prevScreenPos.x, prevScreenPos.y, screenPos.x, screenPos.y, color);
- //DrawLine(prevScreenPos.x, prevScreenPos.y + 1, screenPos.x, screenPos.y + 1, color);
- //DrawLine(Vector2D(prevScreenPos.x, prevScreenPos.y - 1), Vector2D(screenPos.x, screenPos.y - 1), color);
- }
- prevScreenPos = screenPos;
- }
- }
- void __fastcall Hooks::PaintTraverse(PVOID pPanels, int edx, unsigned int vguiPanel, bool forceRepaint, bool allowForce)
- {
- //static auto oPaintTraverse = g_Hooks.pPanelHook->GetOriginal<PaintTraverse_t>(vtable_indexes::paint);
- static unsigned int panelID, panelHudID;
- std::string panel_name = g_pPanel->GetName(vguiPanel);
- static uint32_t HudZoomPanel;
- if (!HudZoomPanel)
- if (!strcmp("HudZoom", g_pPanel->GetName(vguiPanel)))
- HudZoomPanel = vguiPanel;
- if (g::pLocalEntity)
- if (Shonax.Visuals.NoScope && HudZoomPanel == vguiPanel && g::pLocalEntity->IsScoped())
- return;
- if (panel_name == "MatSystemTopPanel")
- {
- if (g_pEngine->IsConnected() && g_pEngine->IsInGame())
- {
- auto matpostprocess = g_pCvar->FindVar("mat_postprocess_enable");
- matpostprocess->fnChangeCallback.SetSize(0);
- matpostprocess->SetValue(Shonax.Visuals.matpostprocessenable);
- auto HUD = g_pCvar->FindVar("cl_draw_only_deathnotices");
- HUD->fnChangeCallback.SetSize(0);
- if (Shonax.Visuals.clearhud)
- HUD->SetValue(1);
- else
- HUD->SetValue(0);
- DrawZeusRange();
- if (!Shonax.Misc.UI) g_pCvar->FindVar("cl_drawhud")->SetValue(1);
- g_ESP.InstallFonts();
- g_ESP.Render();
- if (Shonax.Misc.UI)
- GUI.Draw();
- GrenadePrediction::get().Paint();// fixed
- if (Shonax.Visuals.NoScope && g::pLocalEntity) //fixed
- {
- int screen_x;
- int screen_y;
- int center_x;
- int center_y;
- g_pEngine->GetScreenSize(screen_x, screen_y);
- g_pEngine->GetScreenSize(center_x, center_y);
- center_x /= 2; center_y /= 2;
- if (g::pLocalEntity->IsScoped())
- {
- g_pSurface->Line(0, center_y, screen_x, center_y, Color(10, 10, 10, 140));
- g_pSurface->Line(center_x, 0, center_x, screen_y, Color(10, 10, 10, 140));
- g_pSurface->Line(0, center_y - 1, screen_x, center_y - 1, Color(10, 10, 10, 140));
- g_pSurface->Line(center_x - 1, 0, center_x - 1, screen_y, Color(10, 10, 10, 140));
- g_pSurface->Line(0, center_y + 1, screen_x, center_y + 1, Color(10, 10, 10, 140));
- g_pSurface->Line(center_x + 1, 0, center_x + 1, screen_y, Color(10, 10, 10, 140));
- }
- }
- for (int i = 0; i < 4; i++) {
- for (int j = 0; j < 4; j++)
- {
- g::w2s_matrix[i][j] = g_pEngine->WorldToScreenMatrix()[i][j];
- }
- }
- if (Shonax.Visuals.hitmarker[0])
- otheresp::get().hitmarker_paint();
- FEATURES::MISC::in_game_logger.Do();
- static bool zalupa;
- if (Shonax.Visuals.galaxysky)
- {
- if (anotherpcheck || !zalupa)
- LoadNamedSky("sky_descent");
- zalupa = true;
- }
- if (Shonax.Visuals.hitmarker[1])
- otheresp::get().hitmarkerdynamic_paint();
- if (Shonax.Visuals.killfeed)
- {
- if (g::pLocalEntity && g_pEngine->IsInGame() && g_pEngine->IsConnected())
- {
- if (g::pLocalEntity) {
- if (!deathNotice) deathNotice = FindHudElement<DWORD>("CCSGO_HudDeathNotice");
- if (deathNotice) {
- float* localDeathNotice = (float*)((DWORD)deathNotice + 0x50);
- if (localDeathNotice) *localDeathNotice = Shonax.Visuals.killfeed ? FLT_MAX : 1.5f;
- if (fuckingcheck && deathNotice - 20) {
- if (!ClearDeathNotices) ClearDeathNotices = (void(__thiscall*)(DWORD))Utils::FindSignature("client_panorama.dll", "55 8B EC 83 EC 0C 53 56 8B 71 58");
- if (ClearDeathNotices) { ClearDeathNotices(((DWORD)deathNotice - 20)); fuckingcheck = false; }
- }
- }
- }
- }
- }
- CustomDrawmodels();
- if (Shonax.Visuals.worldcheck)
- {
- for (MaterialHandle_t i = g_pMaterialSys->FirstMaterial(); i != g_pMaterialSys->InvalidMaterial(); i = g_pMaterialSys->NextMaterial(i))
- {
- IMaterial *pMaterial = g_pMaterialSys->GetMaterial(i);
- if (!pMaterial)
- continue;
- const char* group = pMaterial->GetTextureGroupName();
- const char* name = pMaterial->GetName();
- if (strstr(group, "World textures"))
- {
- pMaterial->ColorModulate(Shonax.Visuals.WorldColor[0], Shonax.Visuals.WorldColor[1], Shonax.Visuals.WorldColor[2]);
- pMaterial->AlphaModulate(Shonax.Visuals.WorldColor[3]);
- }
- }
- }
- if (Shonax.Visuals.skycheck)
- {
- for (MaterialHandle_t i = g_pMaterialSys->FirstMaterial(); i != g_pMaterialSys->InvalidMaterial(); i = g_pMaterialSys->NextMaterial(i))
- {
- IMaterial *pMaterial = g_pMaterialSys->GetMaterial(i);
- if (!pMaterial)
- continue;
- if (strstr(pMaterial->GetTextureGroupName(), "SkyBox"))
- {
- pMaterial->ColorModulate(Shonax.Visuals.SkyColor[0], Shonax.Visuals.SkyColor[1], Shonax.Visuals.SkyColor[2]);
- pMaterial->AlphaModulate(Shonax.Visuals.SkyColor[3]);
- }
- }
- }
- if (false) // server hitboxes
- {
- static uintptr_t pCall = (uintptr_t)Utils::FindSignature("server.dll", "55 8B EC 81 EC ? ? ? ? 53 56 8B 35 ? ? ? ? 8B D9 57 8B CE");
- float fDuration = -1.f;
- PVOID pEntity = nullptr;
- pEntity = UTIL_PlayerByIndex(g::pLocalEntity->EntIndex());
- if (pEntity)
- {
- __asm
- {
- pushad
- movss xmm1, fDuration
- push 0 //bool monoColor
- mov ecx, pEntity
- call pCall
- popad
- }
- }
- }
- }
- //if (g_pEngine->IsActiveApp() && menu_open)
- //Drop::DrawBackDrop();
- }
- oPaintTraverse_t->GetTrampoline()(pPanels, vguiPanel, forceRepaint, allowForce);
- //oPaintTraverse(pPanels, vguiPanel, forceRepaint, allowForce);
- //fix for skins black, dont need with drop
- g_pCvar->FindVar("cl_showfps")->SetValue(1);
- g_pCvar->FindVar("net_graph")->SetValue(1);
- }
- void Hooks::Restore()
- {
- g_Hooks.pClientHook->Unhook(vtable_indexes::frameStage);
- g_Hooks.pClientModeHook->Unhook(vtable_indexes::createMove);
- g_Hooks.pClientModeHook->Unhook(vtable_indexes::view);
- g_Hooks.pSurfaceHook->Unhook(vtable_indexes::lockCursor);
- g_Hooks.pPanelHook->Unhook(vtable_indexes::paint);
- g_Hooks.pModelHook->Unhook(vtable_indexes::dme);
- SetWindowLongPtr(g_Hooks.hCSGOWindow, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(g_Hooks.pOriginalWNDProc));
- g_pNetvars.reset();
- hooked_events.RemoveSelf();
- }
- void Hooks::HookPlayers()
- {
- static bool Init[65];
- static bool Hooked[65];
- for (int i = 1; i < g_pEngine->GetMaxClients(); ++i)
- {
- C_BaseEntity* pPlayerEntity = g_pEntityList->GetClientEntity(i);
- if (!pPlayerEntity
- || !pPlayerEntity->IsAlive()
- || pPlayerEntity->IsDormant())
- {
- if (Hooked[i])
- g_Hooks.pPlayerHook[i]->Unhook(vtable_indexes::extraBonePro);
- Hooked[i] = false;
- continue;
- }
- if (!Init[i])
- {
- g_Hooks.pPlayerHook[i] = std::make_unique<VMTHook>(pPlayerEntity);
- Init[i] = true;
- }
- if (Hooked[i])
- g_Hooks.pPlayerHook[i]->Unhook(vtable_indexes::extraBonePro);
- if (!Hooked[i])
- {
- //g_Hooks.pPlayerHook[i]->Setup(pPlayerEntity);
- g_Hooks.pPlayerHook[i]->Hook(vtable_indexes::extraBonePro, Hooks::DoExtraBonesProcessing);
- Hooked[i] = true;
- }
- }
- }
- C_BaseCombatWeapon* xd(C_BaseEntity* xz)
- {
- if (!g_pEngine->IsConnected())
- return nullptr;
- if (!xz->IsAlive())
- return nullptr;
- CBaseHandle weaponData = *(CBaseHandle*)((DWORD)xz + 0x2EF8); //m_hActiveWeapon
- return (C_BaseCombatWeapon*)g_pEntityList->GetClientEntityFromHandle(weaponData);
- }
- short SafeWeaponID()
- {
- if (!(g::pLocalEntity))
- return 0;
- C_BaseCombatWeapon* WeaponC = xd(g::pLocalEntity);
- if (!(WeaponC))
- return 0;
- return *WeaponC->fixskins();
- }
- inline float FastSqrt1(float x)
- {
- unsigned int i = *(unsigned int*)&x;
- i += 127 << 23;
- i >>= 1;
- return *(float*)&i;
- }
- #define square1( x ) ( x * x )
- void SlowWalk(CUserCmd* get_cmd, float get_speed)
- {
- if (get_speed <= 0.f)
- return;
- float min_speed = (float)(FastSqrt1(square1(get_cmd->forwardmove) + square1(get_cmd->sidemove) + square1(get_cmd->upmove)));
- if (min_speed <= 0.f)
- return;
- if (get_cmd->buttons & IN_DUCK)
- get_speed *= 2.94117647f;
- if (min_speed <= get_speed)
- return;
- float speed = get_speed / min_speed;
- get_cmd->forwardmove *= speed;
- get_cmd->sidemove *= speed;
- get_cmd->upmove *= speed;
- }
- bool __fastcall Hooks::CreateMove(IClientMode* thisptr, void* edx, float sample_frametime, CUserCmd* pCmd)
- {
- // Call original createmove before we start screwing with it
- //static auto oCreateMove = g_Hooks.pClientModeHook->GetOriginal<CreateMove_t>(vtable_indexes::createMove);
- oCreateMove_t->GetTrampoline()(thisptr, edx, sample_frametime, pCmd);
- if (!pCmd || !pCmd->command_number)
- return oCreateMove_t->GetTrampoline();
- // Get globals
- g::pCmd = pCmd;
- g::pLocalEntity = g_pEntityList->GetClientEntity(g_pEngine->GetLocalPlayer());
- g::bSendPacket = true;
- Shonax.number = SafeWeaponID();
- if (Shonax.Clantag.enable && g::pLocalEntity)
- if (g_pEngine->IsConnected() && g_pEngine->IsInGame())
- clantagsystem(g::pCmd);
- if (!g::pLocalEntity)
- return oCreateMove_t->GetTrampoline();
- uintptr_t *framePtr;
- __asm mov framePtr, ebp;
- if (Shonax.Misc.knifebot)
- g_Knifebot.Run();
- g::OriginalView = g::pCmd->viewangles;
- if (!g::pLocalEntity->IsAlive() || g_pGlobalVars->curtime - lastkilltime > 5.0f)
- killstreak = 0;
- if (Shonax.Aimbot.Weapon[Shonax.number].SlowWalk && GetAsyncKeyState(VK_SHIFT))
- SlowWalk(g::pCmd, Shonax.Aimbot.Weapon[Shonax.number].Speed);
- GrenadePrediction::get().Tick(g::pCmd->buttons);
- g_Misc.OnCreateMove();
- g_Resolver.OnCreateMove();
- if (g_pInputSystem->IsButtonDown(Shonax.Misc.freecamerakey) && Shonax.Misc.freecamera)
- {
- pCmd->forwardmove = 0;
- pCmd->sidemove = 0;
- }
- if (Shonax.Misc.unlimit_duck) g::pCmd->buttons |= IN_BULLRUSH;
- if (Shonax.Misc.fake_crouch && g_pInputSystem->IsButtonDown(Shonax.newfeatures.fakeduckkey)) {
- /*static bool counter = false;
- if (g_pInputSystem->IsButtonDown(Shonax.newfeatures.fakeduckkey)) {
- static bool counter = false;
- static int counte = 0;
- if (counte == 5) {
- counte = 0;
- counter = !counter;
- }
- counte++;
- if (counter) {
- g::pCmd->buttons |= IN_DUCK;
- g::bSendPacket = true;
- }
- else {
- g::pCmd->buttons &= ~IN_DUCK;
- g::bSendPacket = false;
- }
- }*/
- /*g::pCmd->buttons |= IN_DUCK;
- if (g::pCmd->buttons & IN_DUCK)
- {
- static bool counter = false;
- static int counters = 0;
- if (counters == 9)
- {
- counters = 0;
- counter = !counter;
- }
- counters++;
- if (counter)
- {
- g::pCmd->buttons |= IN_DUCK;
- g::bSendPacket = true;
- }
- else
- g::pCmd->buttons &= ~IN_DUCK;
- }*/
- /*
- int choked_goal = Shonax.Antiaim.Fakelag / 2;
- bool should_crouch = g_pClientState->m_nChokedCommands >= choked_goal;
- if (g::pLocalEntity->GetFlags() & FL_ONGROUND)
- {
- g::pCmd->buttons |= IN_BULLRUSH;
- if (should_crouch)
- g::pCmd->buttons |= IN_DUCK;
- else
- g::pCmd->buttons &= ~IN_DUCK;
- }*/
- /*int fakelag_limit = Shonax.Antiaim.Fakelag / 2;
- int choked_goal = fakelag_limit / 2;
- bool should_crouch = g_pEngine->GetNetChannel()->m_nChokedPackets >= choked_goal;
- if (g::pLocalEntity->GetFlags() & FL_ONGROUND)
- {
- if (should_crouch)
- g::pCmd->buttons |= IN_DUCK;
- else
- g::pCmd->buttons &= ~IN_DUCK;
- }*/
- }
- g_AntiAim.OnCreateMove();
- if (!Shonax.Visuals.ilovethat)
- engine_prediction::RunEnginePred();
- if (Shonax.Visuals.ilovethat)
- {
- g_Aimbot.OnCreateMove();
- g_Legitbot.Run();
- TriggerBot.Move(pCmd);
- }
- if (!Shonax.Visuals.ilovethat)
- engine_prediction::EndEnginePred();
- g_Misc.MovementFix(g::OriginalView);
- g_Math.Clamp(g::pCmd->viewangles);
- if (g::bSendPacket)
- g::RealAngle = g::pCmd->viewangles;
- //else
- //g::FakeAngle = g::pCmd->viewangles;
- *(bool*)(*framePtr - 0x1C) = g::bSendPacket;
- g::pCmd->buttons |= IN_BULLRUSH; // hehe
- if (Shonax.Visuals.show_spread)
- g_pCvar->FindVar("crosshair")->SetValue(0);
- else
- g_pCvar->FindVar("crosshair")->SetValue(1);
- return false;
- }
- static IMaterial* Material;
- static IMaterial* Metallic;
- static IMaterial* GlowMat;
- void run_chams()
- {
- }
- #include "Features/chamsmat.h"
- float randnum2(int Min, int Max)
- {
- return ((rand() % (Max - Min)) + Min);
- }
- float GetDesyncDelta2()
- {
- auto animstate = uintptr_t(g::pLocalEntity->AnimState());
- float duckammount = *(float *)(animstate + 0xA4);
- float speedfraction = max(0, min(*reinterpret_cast<float*>(animstate + 0xF8), 1));
- float speedfactor = max(0, min(1, *reinterpret_cast<float*> (animstate + 0xFC)));
- float unk1 = ((*reinterpret_cast<float*> (animstate + 0x11C) * -0.30000001) - 0.19999999) * speedfraction;
- float unk2 = unk1 + 1.f;
- float unk3;
- if (duckammount > 0)
- {
- unk2 += ((duckammount * speedfactor) * (0.5f - unk2));
- }
- unk3 = *(float *)(animstate + 0x334) * unk2;
- return unk3 + randnum2(-10, 0);
- }
- static IMaterial* gold;
- static IMaterial* crystal;
- static IMaterial* gloss;
- static IMaterial* crystalblue;
- static IMaterial* glass;
- static IMaterial* glow;
- static IMaterial* predglass;
- static IMaterial* dogout;
- void __fastcall Hooks::DoExtraBonesProcessing(void * ECX, void * EDX, void * unkn1, void * unkn2, void * unkn3, void * unkn4, CBoneBitList & unkn5, void * unkn6)
- {
- C_BaseEntity* pPlayerEntity = (C_BaseEntity*)ECX;
- if (!pPlayerEntity || pPlayerEntity == nullptr)
- return;
- if (!pPlayerEntity->IsAlive() || pPlayerEntity->IsDormant())
- return;
- if (!pPlayerEntity->AnimState())
- return;
- auto oDoExtraBonesProcessing = g_Hooks.pPlayerHook[pPlayerEntity->EntIndex()]->GetOriginal<ExtraBoneProcess_t>(vtable_indexes::extraBonePro);
- float Backup = pPlayerEntity->AnimState()->m_flUnknownFraction;
- pPlayerEntity->AnimState()->m_flUnknownFraction = 0;
- oDoExtraBonesProcessing(ECX, unkn1, unkn2, unkn3, unkn4, unkn5, unkn6);
- pPlayerEntity->AnimState()->m_flUnknownFraction = Backup;
- }
- void __fastcall Hooks::SceneEnd(void *ecx, void *edx)
- {
- static auto oSceneEnd = g_Hooks.pRenderViewHook->GetOriginal<SceneEnd_t>(vtable_indexes::sceneEnd);
- //miss chams to postscreen xd
- knowledge.setup_materials();
- if (!g_pEngine->IsInGame() || !g_pEngine->IsConnected())
- {
- Material = nullptr;
- Metallic = nullptr;
- GlowMat = nullptr;
- }
- if (Shonax.Visuals.Chams || Shonax.Visuals.LocalChams)
- {
- if (g_pEngine->IsConnected() && g_pEngine->IsInGame())
- {
- if (!g::pLocalEntity) return;
- for (int i = 1; i < g_pEngine->GetMaxClients(); i++)
- {
- auto entity = (C_BaseEntity*)g_pEntityList->GetClientEntity(i);
- if (!entity) continue;
- if (!entity->IsAlive()) continue;
- if (entity->IsDormant()) continue;
- if (entity->GetClientClass()->ClassID != 38) continue;
- if (entity)
- {
- if (entity == g::pLocalEntity && Shonax.Visuals.LocalChams && g_pInput->m_fCameraInThirdPerson)
- {
- if (entity)
- {
- if (Shonax.Visuals.BacktrackLocalChams)
- {
- typedef Vector Vector3D;
- Vector3D OrigAng;
- OrigAng = entity->GetEyeAngles();
- entity->SetAngle2(Vector(OrigAng.x, g::FakeAngle.y, OrigAng.z)); // paste he re ur AA.y value or pLocal->GetLby() (for example)
- dogout->ColorModulate(Shonax.Visuals.DesyncColor[0], Shonax.Visuals.DesyncColor[1], Shonax.Visuals.DesyncColor[2]);
- dogout->AlphaModulate(Shonax.Visuals.DesyncColor[3]);
- g_pModelRender->ForcedMaterialOverride(dogout);
- entity->DrawModel(0x1, 255);
- g_pModelRender->ForcedMaterialOverride(nullptr);
- entity->SetAngle2(OrigAng);
- }
- }
- if (entity)
- {
- if (Shonax.Visuals.LocalChamsType == 0)
- {
- Material->SetMaterialVarFlag(MATERIAL_VAR_IGNOREZ, true);
- Material->AlphaModulate(Shonax.Visuals.LocalChamsColor[3]);
- Material->ColorModulate(Shonax.Visuals.LocalChamsColor[0], Shonax.Visuals.LocalChamsColor[1], Shonax.Visuals.LocalChamsColor[2]);
- g_pModelRender->ForcedMaterialOverride(Material);
- entity->DrawModel(0x1, entity->GetModelInstance());
- g_pModelRender->ForcedMaterialOverride(nullptr);
- }
- else if (Shonax.Visuals.LocalChamsType == 1)
- {
- Metallic->AlphaModulate(Shonax.Visuals.LocalChamsColor[3]);
- Metallic->ColorModulate(Shonax.Visuals.LocalChamsColor[0], Shonax.Visuals.LocalChamsColor[1], Shonax.Visuals.LocalChamsColor[2]);
- g_pModelRender->ForcedMaterialOverride(Metallic);
- entity->DrawModel(0x1, entity->GetModelInstance());
- g_pModelRender->ForcedMaterialOverride(nullptr);
- }
- else if (Shonax.Visuals.LocalChamsType == 2)
- {
- crystal->SetMaterialVarFlag(MATERIAL_VAR_IGNOREZ, true);
- crystal->AlphaModulate(Shonax.Visuals.LocalChamsColor[3]);
- crystal->ColorModulate(Shonax.Visuals.LocalChamsColor[0], Shonax.Visuals.LocalChamsColor[1], Shonax.Visuals.LocalChamsColor[2]);
- g_pModelRender->ForcedMaterialOverride(crystal);
- entity->DrawModel(0x1, entity->GetModelInstance());
- g_pModelRender->ForcedMaterialOverride(nullptr);
- }
- else if (Shonax.Visuals.LocalChamsType == 3)
- {
- glass->SetMaterialVarFlag(MATERIAL_VAR_IGNOREZ, true);
- glass->AlphaModulate(Shonax.Visuals.LocalChamsColor[3]);
- glass->ColorModulate(Shonax.Visuals.LocalChamsColor[0], Shonax.Visuals.LocalChamsColor[1], Shonax.Visuals.LocalChamsColor[2]);
- g_pModelRender->ForcedMaterialOverride(glass);
- entity->DrawModel(0x1, entity->GetModelInstance());
- g_pModelRender->ForcedMaterialOverride(nullptr);
- }
- else if (Shonax.Visuals.LocalChamsType == 4 && !Shonax.Visuals.BacktrackLocalChams)
- {
- dogout->SetMaterialVarFlag(MATERIAL_VAR_IGNOREZ, true);
- dogout->AlphaModulate(Shonax.Visuals.LocalChamsColor[3]);
- dogout->ColorModulate(Shonax.Visuals.LocalChamsColor[0], Shonax.Visuals.LocalChamsColor[1], Shonax.Visuals.LocalChamsColor[2]);
- g_pModelRender->ForcedMaterialOverride(dogout);
- entity->DrawModel(0x1, entity->GetModelInstance());
- g_pModelRender->ForcedMaterialOverride(nullptr);
- }
- }
- }
- else if (entity->GetTeam() != g::pLocalEntity->GetTeam() && Shonax.Visuals.Chams && entity != g::pLocalEntity)
- {
- if (Shonax.Visuals.ChamsType == 0)
- {
- Material->SetMaterialVarFlag(MATERIAL_VAR_IGNOREZ, true);
- Material->AlphaModulate(Shonax.Visuals.LocalChamsColor[3]);
- Material->ColorModulate(Shonax.Visuals.LocalChamsColor[0], Shonax.Visuals.LocalChamsColor[1], Shonax.Visuals.LocalChamsColor[2]);
- g_pModelRender->ForcedMaterialOverride(Material);
- entity->DrawModel(0x1, entity->GetModelInstance());
- g_pModelRender->ForcedMaterialOverride(nullptr);
- }
- else if (Shonax.Visuals.ChamsType == 1)
- {
- Metallic->AlphaModulate(Shonax.Visuals.LocalChamsColor[3]);
- Metallic->ColorModulate(Shonax.Visuals.LocalChamsColor[0], Shonax.Visuals.LocalChamsColor[1], Shonax.Visuals.LocalChamsColor[2]);
- g_pModelRender->ForcedMaterialOverride(Metallic);
- entity->DrawModel(0x1, entity->GetModelInstance());
- g_pModelRender->ForcedMaterialOverride(nullptr);
- }
- else if (Shonax.Visuals.ChamsType == 2)
- {
- crystal->SetMaterialVarFlag(MATERIAL_VAR_IGNOREZ, true);
- crystal->AlphaModulate(Shonax.Visuals.LocalChamsColor[3]);
- crystal->ColorModulate(Shonax.Visuals.LocalChamsColor[0], Shonax.Visuals.LocalChamsColor[1], Shonax.Visuals.LocalChamsColor[2]);
- g_pModelRender->ForcedMaterialOverride(crystal);
- entity->DrawModel(0x1, entity->GetModelInstance());
- g_pModelRender->ForcedMaterialOverride(nullptr);
- }
- else if (Shonax.Visuals.ChamsType == 3)
- {
- glass->SetMaterialVarFlag(MATERIAL_VAR_IGNOREZ, true);
- glass->AlphaModulate(Shonax.Visuals.LocalChamsColor[3]);
- glass->ColorModulate(Shonax.Visuals.LocalChamsColor[0], Shonax.Visuals.LocalChamsColor[1], Shonax.Visuals.LocalChamsColor[2]);
- g_pModelRender->ForcedMaterialOverride(glass);
- entity->DrawModel(0x1, entity->GetModelInstance());
- g_pModelRender->ForcedMaterialOverride(nullptr);
- }
- else if (Shonax.Visuals.ChamsType == 4)
- {
- dogout->SetMaterialVarFlag(MATERIAL_VAR_IGNOREZ, true);
- dogout->AlphaModulate(Shonax.Visuals.LocalChamsColor[3]);
- dogout->ColorModulate(Shonax.Visuals.LocalChamsColor[0], Shonax.Visuals.LocalChamsColor[1], Shonax.Visuals.LocalChamsColor[2]);
- g_pModelRender->ForcedMaterialOverride(dogout);
- entity->DrawModel(0x1, entity->GetModelInstance());
- g_pModelRender->ForcedMaterialOverride(nullptr);
- }
- }
- }
- }
- }
- }
- oSceneEnd(ecx, edx);
- }
- void __fastcall Hooks::DrawModelExecute(void* ecx, void* edx, IMatRenderContext* context, const DrawModelState_t& state, const ModelRenderInfo_t& info, matrix3x4_t* matrix)
- {
- //static auto oDrawModelExecute = g_Hooks.pModelHook->GetOriginal<DrawModelExecute_t>(vtable_indexes::dme);
- const char* ModelName = g_pModelInfo->GetModelName((model_t*)info.pModel);
- IMaterial* health_boost_material = nullptr;
- static bool zalupa = false;
- if (g_pEngine->IsConnected() || g_pEngine->IsInGame())
- zalupa = false;
- knowledge.setup_materials();
- if (!zalupa && Shonax.Visuals.headshoteffect)
- {
- health_boost_material = g_pMaterialSys->FindMaterial("effects/healthboost", "ClientEffect textures", true);
- zalupa = true;
- }
- if (Shonax.Visuals.headshoteffect && health_boost_material)
- {
- auto boost_time_remaining = 1.0f;
- if (boost_time_remaining > 0.f)
- {
- auto health_boost_material_var = health_boost_material->FindVar("$c0_x", false, true);
- /*health_boost_material_var->set_float_value(boost_time_remaining);
- auto render_context = g_MatSystem->get_render_context();
- render_context->draw_screen_space_rectangle(health_boost_material, 0, 0, width, height, 0, 0, width, height, width, height, nullptr, 1, 1);
- render_context->release();*/
- }
- }
- C_BaseEntity* pPlayerEntity = g_pEntityList->GetClientEntity(info.index);
- //setup
- if (g_pEngine->IsConnected() && g_pEngine->IsInGame())
- {
- knowledge.is_sleeve = strstr(info.pModel->name, "sleeve") != nullptr;
- knowledge.is_arm = strstr(info.pModel->name, "arms") != nullptr;
- knowledge.is_weapon = (strstr(info.pModel->name, "weapons/v_") != nullptr) && (strstr(info.pModel->name, "arms") == nullptr) && (strstr(info.pModel->name, "knife") == nullptr) && !knowledge.is_sleeve;
- knowledge.isplayer = strstr(info.pModel->name, "models/player") != nullptr;
- knowledge.is_knife = strstr(info.pModel->name, "knife") != nullptr;
- knowledge.is_knife_wep = strstr(info.pModel->name, "weapons/v_") != nullptr;
- knowledge.draw_skins();
- //oDrawModelExecute(ecx, context, state, info, matrix);
- }
- //end
- if (!g::pLocalEntity && !g_pEngine->IsConnected())
- {
- gold = nullptr;
- crystal = nullptr;
- gloss = nullptr;
- crystalblue = nullptr;
- glass = nullptr;
- glow = nullptr;
- predglass = nullptr;
- dogout = nullptr;
- Material = nullptr;
- Metallic = nullptr;
- GlowMat = nullptr;
- }
- if (!gold || !crystal || !gloss || !crystalblue || !glass || !glow || !predglass || !dogout || !Material || !Metallic || !GlowMat)
- {
- gold = g_pMaterialSys->FindMaterial(chamsmat[0], "Model textures");
- crystal = g_pMaterialSys->FindMaterial(chamsmat[1], "Model textures");
- gloss = g_pMaterialSys->FindMaterial(chamsmat[2], "Model textures");
- crystalblue = g_pMaterialSys->FindMaterial(chamsmat[3], "Model textures");
- glass = g_pMaterialSys->FindMaterial(chamsmat[4], "Model textures");
- glow = g_pMaterialSys->FindMaterial("vgui/achievements/glow", "Model textures");
- predglass = g_pMaterialSys->FindMaterial("models/inventory_items/cologne_prediction/cologne_prediction_glass", "Other textures");
- dogout = g_pMaterialSys->FindMaterial("models/inventory_items/dogtags/dogtags_outline", "Model textures");
- Material = g_pMaterialSys->FindMaterial("FlatChams", "Model textures");
- Metallic = g_pMaterialSys->FindMaterial("simple_ignorez_reflective", "Model textures");
- GlowMat = g_pMaterialSys->FindMaterial("dev/glow_armsrace.vmt", nullptr, false, 0);
- }
- C_BaseEntity* Model_Entity = g_pEntityList->GetClientEntity(info.index);
- if (Model_Entity && gold && crystal && gloss && crystalblue && glass && glow && predglass && dogout && Material && Metallic && GlowMat)
- if (Shonax.Visuals.Chams || Shonax.Visuals.LocalChams || Shonax.Visuals.weaponchams || Shonax.Visuals.handchams)
- {
- if (knowledge.isplayer && !knowledge.is_sleeve && !knowledge.is_arm)
- {
- if (g::pLocalEntity)
- if (Model_Entity->IsPlayer() && Model_Entity == g::pLocalEntity)
- {
- if (Shonax.Visuals.LocalChams && g::pLocalEntity->IsAlive() && g_Misc.in_tp)
- {
- /*if (Shonax.Visuals.LocalChamsType == 0)
- {
- g_pRenderView->SetColorModulation(Shonax.Visuals.LocalChamsColor);
- g_pRenderView->SetBlend(Shonax.Visuals.LocalChamsColor[3]);
- g_pModelRender->ForcedMaterialOverride(Material);
- oDrawModelExecute_t->GetTrampoline()(ecx, context, state, info, matrix);
- }
- if (Shonax.Visuals.LocalChamsType == 1)
- {
- g_pRenderView->SetColorModulation(Shonax.Visuals.LocalChamsColor);
- g_pRenderView->SetBlend(Shonax.Visuals.LocalChamsColor[3]);
- g_pModelRender->ForcedMaterialOverride(Metallic);
- oDrawModelExecute_t->GetTrampoline()(ecx, context, state, info, matrix);
- }
- if (Shonax.Visuals.LocalChamsType == 7)
- {
- g_pRenderView->SetColorModulation(Shonax.Visuals.LocalChamsColor);
- g_pRenderView->SetBlend(Shonax.Visuals.LocalChamsColor[3]);
- g_pModelRender->ForcedMaterialOverride(GlowMat);
- oDrawModelExecute_t->GetTrampoline()(ecx, context, state, info, matrix);
- }
- if (Shonax.Visuals.LocalChamsType == 2)
- {
- g_pRenderView->SetColorModulation(Shonax.Visuals.LocalChamsColor);
- g_pRenderView->SetBlend(Shonax.Visuals.LocalChamsColor[3]);
- g_pModelRender->ForcedMaterialOverride(gold);
- oDrawModelExecute_t->GetTrampoline()(ecx, context, state, info, matrix);
- }
- else if (Shonax.Visuals.LocalChamsType == 3)
- {
- g_pRenderView->SetColorModulation(Shonax.Visuals.LocalChamsColor);
- g_pRenderView->SetBlend(Shonax.Visuals.LocalChamsColor[3]);
- g_pModelRender->ForcedMaterialOverride(crystal);
- oDrawModelExecute_t->GetTrampoline()(ecx, context, state, info, matrix);
- }
- else if (Shonax.Visuals.LocalChamsType == 4)
- {
- g_pRenderView->SetColorModulation(Shonax.Visuals.LocalChamsColor);
- g_pRenderView->SetBlend(Shonax.Visuals.LocalChamsColor[3]);
- g_pModelRender->ForcedMaterialOverride(gloss);
- oDrawModelExecute_t->GetTrampoline()(ecx, context, state, info, matrix);
- }
- else if (Shonax.Visuals.LocalChamsType == 5)
- {
- g_pRenderView->SetColorModulation(Shonax.Visuals.LocalChamsColor);
- g_pRenderView->SetBlend(Shonax.Visuals.LocalChamsColor[3]);
- g_pModelRender->ForcedMaterialOverride(crystalblue);
- oDrawModelExecute_t->GetTrampoline()(ecx, context, state, info, matrix);
- }
- else if (Shonax.Visuals.LocalChamsType == 6)
- {
- g_pRenderView->SetColorModulation(Shonax.Visuals.LocalChamsColor);
- g_pRenderView->SetBlend(Shonax.Visuals.LocalChamsColor[3]);
- g_pModelRender->ForcedMaterialOverride(glass);
- oDrawModelExecute_t->GetTrampoline()(ecx, context, state, info, matrix);
- }
- else if (Shonax.Visuals.LocalChamsType == 8)
- {
- g_pRenderView->SetColorModulation(Shonax.Visuals.LocalChamsColor);
- g_pRenderView->SetBlend(Shonax.Visuals.LocalChamsColor[3]);
- g_pModelRender->ForcedMaterialOverride(glow);
- oDrawModelExecute_t->GetTrampoline()(ecx, context, state, info, matrix);
- }
- else if (Shonax.Visuals.LocalChamsType == 9)
- {
- g_pRenderView->SetColorModulation(Shonax.Visuals.LocalChamsColor);
- g_pRenderView->SetBlend(Shonax.Visuals.LocalChamsColor[3]);
- g_pModelRender->ForcedMaterialOverride(predglass);
- oDrawModelExecute_t->GetTrampoline()(ecx, context, state, info, matrix);
- }
- else if (Shonax.Visuals.LocalChamsType == 10)
- {
- g_pRenderView->SetColorModulation(Shonax.Visuals.LocalChamsColor);
- g_pRenderView->SetBlend(Shonax.Visuals.LocalChamsColor[3]);
- g_pModelRender->ForcedMaterialOverride(dogout);
- oDrawModelExecute_t->GetTrampoline()(ecx, context, state, info, matrix);
- }*/
- }
- }
- if (g::pLocalEntity)
- if (Shonax.Visuals.Chams && Model_Entity->GetTeam() != g::pLocalEntity->GetTeam() && Model_Entity->IsPlayer() && Model_Entity != g::pLocalEntity)
- {
- /*if (Shonax.Visuals.ChamsType == 0)
- {
- g_pRenderView->SetColorModulation(Shonax.Visuals.ChamsColor);
- g_pRenderView->SetBlend(Shonax.Visuals.ChamsColor[3]);
- g_pModelRender->ForcedMaterialOverride(Material);
- oDrawModelExecute_t->GetTrampoline()(ecx, context, state, info, matrix);
- }
- if (Shonax.Visuals.ChamsType == 1)
- {
- g_pRenderView->SetColorModulation(Shonax.Visuals.ChamsColor);
- g_pRenderView->SetBlend(Shonax.Visuals.ChamsColor[3]);
- g_pModelRender->ForcedMaterialOverride(Metallic);
- oDrawModelExecute_t->GetTrampoline()(ecx, context, state, info, matrix);
- }
- if (Shonax.Visuals.ChamsType == 7)
- {
- g_pRenderView->SetColorModulation(Shonax.Visuals.ChamsColor);
- g_pRenderView->SetBlend(Shonax.Visuals.ChamsColor[3]);
- g_pModelRender->ForcedMaterialOverride(GlowMat);
- oDrawModelExecute_t->GetTrampoline()(ecx, context, state, info, matrix);
- }
- if (Shonax.Visuals.ChamsType == 2)
- {
- g_pRenderView->SetColorModulation(Shonax.Visuals.ChamsColor);
- g_pRenderView->SetBlend(Shonax.Visuals.ChamsColor[3]);
- g_pModelRender->ForcedMaterialOverride(gold);
- oDrawModelExecute_t->GetTrampoline()(ecx, context, state, info, matrix);
- }
- else if (Shonax.Visuals.ChamsType == 3)
- {
- g_pRenderView->SetColorModulation(Shonax.Visuals.ChamsColor);
- g_pRenderView->SetBlend(Shonax.Visuals.ChamsColor[3]);
- g_pModelRender->ForcedMaterialOverride(crystal);
- oDrawModelExecute_t->GetTrampoline()(ecx, context, state, info, matrix);
- }
- else if (Shonax.Visuals.ChamsType == 4)
- {
- g_pRenderView->SetColorModulation(Shonax.Visuals.ChamsColor);
- g_pRenderView->SetBlend(Shonax.Visuals.ChamsColor[3]);
- g_pModelRender->ForcedMaterialOverride(gloss);
- oDrawModelExecute_t->GetTrampoline()(ecx, context, state, info, matrix);
- }
- else if (Shonax.Visuals.ChamsType == 5)
- {
- g_pRenderView->SetColorModulation(Shonax.Visuals.ChamsColor);
- g_pRenderView->SetBlend(Shonax.Visuals.ChamsColor[3]);
- g_pModelRender->ForcedMaterialOverride(crystalblue);
- oDrawModelExecute_t->GetTrampoline()(ecx, context, state, info, matrix);
- }
- else if (Shonax.Visuals.ChamsType == 6)
- {
- g_pRenderView->SetColorModulation(Shonax.Visuals.ChamsColor);
- g_pRenderView->SetBlend(Shonax.Visuals.ChamsColor[3]);
- g_pModelRender->ForcedMaterialOverride(glass);
- oDrawModelExecute_t->GetTrampoline()(ecx, context, state, info, matrix);
- }
- else if (Shonax.Visuals.ChamsType == 8)
- {
- g_pRenderView->SetColorModulation(Shonax.Visuals.ChamsColor);
- g_pRenderView->SetBlend(Shonax.Visuals.ChamsColor[3]);
- g_pModelRender->ForcedMaterialOverride(glow);
- oDrawModelExecute_t->GetTrampoline()(ecx, context, state, info, matrix);
- }
- else if (Shonax.Visuals.ChamsType == 9)
- {
- g_pRenderView->SetColorModulation(Shonax.Visuals.ChamsColor);
- g_pRenderView->SetBlend(Shonax.Visuals.ChamsColor[3]);
- g_pModelRender->ForcedMaterialOverride(predglass);
- oDrawModelExecute_t->GetTrampoline()(ecx, context, state, info, matrix);
- }
- else if (Shonax.Visuals.ChamsType == 10)
- {
- g_pRenderView->SetColorModulation(Shonax.Visuals.ChamsColor);
- g_pRenderView->SetBlend(Shonax.Visuals.ChamsColor[3]);
- g_pModelRender->ForcedMaterialOverride(dogout);
- oDrawModelExecute_t->GetTrampoline()(ecx, context, state, info, matrix);
- }*/
- }
- }
- if (!Model_Entity->IsPlayer() && !knowledge.isplayer && !knowledge.is_sleeve && !knowledge.is_arm && knowledge.is_weapon && Shonax.Visuals.weaponchams && !g_Misc.in_tp)
- {
- if (Shonax.Visuals.weaponchamstype == 0)
- {
- g_pRenderView->SetColorModulation(Shonax.Visuals.weaponchamscolor);
- g_pRenderView->SetBlend(Shonax.Visuals.weaponchamscolor[3]);
- g_pModelRender->ForcedMaterialOverride(gold);
- }
- else if (Shonax.Visuals.weaponchamstype == 1)
- {
- g_pRenderView->SetColorModulation(Shonax.Visuals.weaponchamscolor);
- g_pRenderView->SetBlend(Shonax.Visuals.weaponchamscolor[3]);
- g_pModelRender->ForcedMaterialOverride(crystal);
- }
- else if (Shonax.Visuals.weaponchamstype == 2)
- {
- g_pRenderView->SetColorModulation(Shonax.Visuals.weaponchamscolor);
- g_pRenderView->SetBlend(Shonax.Visuals.weaponchamscolor[3]);
- g_pModelRender->ForcedMaterialOverride(gloss);
- }
- else if (Shonax.Visuals.weaponchamstype == 3)
- {
- g_pRenderView->SetColorModulation(Shonax.Visuals.weaponchamscolor);
- g_pRenderView->SetBlend(Shonax.Visuals.weaponchamscolor[3]);
- g_pModelRender->ForcedMaterialOverride(crystalblue);
- }
- else if (Shonax.Visuals.weaponchamstype == 4)
- {
- g_pRenderView->SetColorModulation(Shonax.Visuals.weaponchamscolor);
- g_pRenderView->SetBlend(Shonax.Visuals.weaponchamscolor[3]);
- g_pModelRender->ForcedMaterialOverride(glass);
- }
- else if (Shonax.Visuals.weaponchamstype == 5)
- {
- g_pRenderView->SetColorModulation(Shonax.Visuals.weaponchamscolor);
- g_pRenderView->SetBlend(Shonax.Visuals.weaponchamscolor[3]);
- g_pModelRender->ForcedMaterialOverride(glow);
- }
- else if (Shonax.Visuals.weaponchamstype == 6)
- {
- g_pRenderView->SetColorModulation(Shonax.Visuals.weaponchamscolor);
- g_pRenderView->SetBlend(Shonax.Visuals.weaponchamscolor[3]);
- g_pModelRender->ForcedMaterialOverride(predglass);
- }
- else if (Shonax.Visuals.weaponchamstype == 6)
- {
- g_pRenderView->SetColorModulation(Shonax.Visuals.weaponchamscolor);
- g_pRenderView->SetBlend(Shonax.Visuals.weaponchamscolor[3]);
- g_pModelRender->ForcedMaterialOverride(dogout);
- }
- }
- }
- auto model_entity = static_cast<C_BaseEntity *>(g_pEntityList->GetClientEntity(info.index));
- if (pPlayerEntity && pPlayerEntity->IsAlive() && !pPlayerEntity->IsDormant() && g_Aimbot.Matrix[info.index] && strstr(ModelName, "models/player"))
- oDrawModelExecute_t->GetTrampoline()(ecx, context, state, info, g_Aimbot.Matrix[info.index]);
- else
- oDrawModelExecute_t->GetTrampoline()(ecx, context, state, info, matrix);
- g_pModelRender->ForcedMaterialOverride(NULL);
- }
- void __stdcall Hooks::FrameStageNotify(ClientFrameStage_t curStage)
- {
- //static auto oFrameStage = g_Hooks.pClientHook->GetOriginal<FrameStageNotify_t>(vtable_indexes::frameStage);
- //if (!Shonax.Visuals.drawteaserrange)
- {
- g_Misc.sv_cheats_spoof(curStage);
- g_Misc.ThirdPerson(curStage);
- g_Misc.KnifeCustom(curStage);
- if (curStage == FRAME_NET_UPDATE_POSTDATAUPDATE_START)
- skinchanger();//ez
- g_Misc.SoundEsp(curStage);
- if (curStage == FRAME_RENDER_START)
- {
- g_Misc.remose_flash();
- g_Misc.remove_smoke();
- g_Misc.ragdol_start();
- }
- g_Resolver.FrameStage(curStage);
- }
- oFrameStageNotify_t->GetTrampoline()(curStage);
- }
- void __fastcall Hooks::OverrideView(void* ecx, void* edx, CViewSetup* pSetup)
- {
- //static auto oOverrideView = g_Hooks.pClientModeHook->GetOriginal<OverrideView_t>(vtable_indexes::view);
- if (g_pEngine->IsConnected() && g_pEngine->IsInGame())
- {
- if (!g::pLocalEntity)
- return;
- if (!g::pLocalEntity->IsAlive())
- return;
- if (Shonax.Visuals.NoRecoil)
- {
- Vector viewPunch = g::pLocalEntity->GetViewPunchAngle();
- Vector aimPunch = g::pLocalEntity->GetAimPunchAngle();
- pSetup->angles[0] -= (viewPunch[0] + (aimPunch[0] * 2 * 0.4499999f));
- pSetup->angles[1] -= (viewPunch[1] + (aimPunch[1] * 2 * 0.4499999f));
- pSetup->angles[2] -= (viewPunch[2] + (aimPunch[2] * 2 * 0.4499999f));
- }
- if (Shonax.Visuals.grenadepred)
- GrenadePrediction::get().View(pSetup);
- g_pCvar->FindVar("viewmodel_fov")->SetValue(Shonax.Visuals.viewmodel);
- g_pCvar->FindVar("viewmodel_offset_x")->SetValue(Shonax.Visuals.viewmodel_x);
- g_pCvar->FindVar("viewmodel_offset_y")->SetValue(Shonax.Visuals.viewmodel_y);
- g_pCvar->FindVar("viewmodel_offset_z")->SetValue(Shonax.Visuals.viewmodel_z - 10);
- if (Shonax.Visuals.Fov != 0 && !g::pLocalEntity->IsScoped())
- pSetup->fov = Shonax.Visuals.Fov;
- if (Shonax.Visuals.NoZoom && g::pLocalEntity->IsScoped())
- pSetup->fov = (Shonax.Visuals.Fov == 0) ? 90 : Shonax.Visuals.Fov;
- if (Shonax.Misc.freecamera)
- {
- static Vector newOrigin;
- //int freecamkey = g_Options.Misc.iFreeCamKey;
- float freecamspeed = Shonax.Misc.freecamspeed;
- if (!g_pInputSystem->IsButtonDown(Shonax.Misc.freecamerakey))
- {
- newOrigin = pSetup->origin;
- }
- if (g_pInputSystem->IsButtonDown(Shonax.Misc.freecamerakey))
- {
- unsigned int fSpeed = freecamspeed; //5.f;
- if (GetAsyncKeyState(VK_CONTROL))
- fSpeed = fSpeed * 0.45;
- if (GetAsyncKeyState(VK_SHIFT))
- fSpeed = fSpeed * 1.65;
- if (GetAsyncKeyState(0x57)) // W
- {
- newOrigin += pSetup->angles.Forward() * fSpeed;
- }
- if (GetAsyncKeyState(0x41)) // A
- {
- newOrigin += pSetup->angles.Right() * fSpeed;
- }
- if (GetAsyncKeyState(0x44)) // D
- {
- newOrigin -= pSetup->angles.Right() * fSpeed;
- }
- if (GetAsyncKeyState(0x53)) // S
- {
- newOrigin -= pSetup->angles.Forward() * fSpeed;
- }
- if (GetAsyncKeyState(VK_SPACE)) // Space
- {
- newOrigin += pSetup->angles.Up() * fSpeed;
- }
- pSetup->origin = newOrigin;
- }
- }
- }
- oOverrideView_t->GetTrampoline()(ecx, edx, pSetup);
- }
- void __fastcall Hooks::LockCursor(ISurface* thisptr, void* edx)
- {
- //static auto oLockCursor = g_Hooks.pSurfaceHook->GetOriginal<LockCursor_t>(vtable_indexes::lockCursor);
- if (!menu_open)
- return oLockCursor_t->GetTrampoline()(thisptr, edx);
- g_pSurface->UnLockCursor();
- }
- void OpenMenu()
- {
- static bool is_down = false;
- static bool is_clicked = false;
- if (GetAsyncKeyState(VK_INSERT))
- {
- is_clicked = false;
- is_down = true;
- }
- else if (!GetAsyncKeyState(VK_INSERT) && is_down)
- {
- is_clicked = true;
- is_down = false;
- }
- else
- {
- is_clicked = false;
- is_down = false;
- }
- if (is_clicked)
- {
- menu_open = !menu_open;
- }
- }
- LRESULT Hooks::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
- {
- switch (uMsg) {
- case WM_LBUTTONDOWN:
- PressedKeys[VK_LBUTTON] = true;
- break;
- case WM_LBUTTONUP:
- PressedKeys[VK_LBUTTON] = false;
- break;
- case WM_RBUTTONDOWN:
- PressedKeys[VK_RBUTTON] = true;
- break;
- case WM_RBUTTONUP:
- PressedKeys[VK_RBUTTON] = false;
- break;
- case WM_MBUTTONDOWN:
- PressedKeys[VK_MBUTTON] = true;
- break;
- case WM_MBUTTONUP:
- PressedKeys[VK_MBUTTON] = false;
- break;
- case WM_XBUTTONDOWN:
- {
- UINT button = GET_XBUTTON_WPARAM(wParam);
- if (button == XBUTTON1)
- {
- PressedKeys[VK_XBUTTON1] = true;
- }
- else if (button == XBUTTON2)
- {
- PressedKeys[VK_XBUTTON2] = true;
- }
- break;
- }
- case WM_XBUTTONUP:
- {
- UINT button = GET_XBUTTON_WPARAM(wParam);
- if (button == XBUTTON1)
- {
- PressedKeys[VK_XBUTTON1] = false;
- }
- else if (button == XBUTTON2)
- {
- PressedKeys[VK_XBUTTON2] = false;
- }
- break;
- }
- case WM_KEYDOWN:
- PressedKeys[wParam] = true;
- break;
- case WM_KEYUP:
- PressedKeys[wParam] = false;
- break;
- default: break;
- }
- OpenMenu();
- if (d3d_init && menu_open && ImGui_ImplDX9_WndProcHandler(hWnd, uMsg, wParam, lParam) && !input_shouldListen)
- return true;
- return CallWindowProc(g_Hooks.pOriginalWNDProc, hWnd, uMsg, wParam, lParam);
- }
- void GUI_Init(IDirect3DDevice9* pDevice)
- {
- ImGui_ImplDX9_Init(g_Hooks.hCSGOWindow, pDevice);
- ImGuiIO& io = ImGui::GetIO();
- Text = io.Fonts->AddFontFromFileTTF("C:\\Windows\\Fonts\\Verdana.ttf", 13.f);
- Tabs = io.Fonts->AddFontFromFileTTF("C:\\Windows\\Fonts\\Tahoma.ttf", 20.0f);
- icon = io.Fonts->AddFontFromMemoryCompressedTTF(MyFont_compressed_data13, MyFont_compressed_size13, 25.f);
- icon2 = io.Fonts->AddFontFromMemoryCompressedTTF(MyFont_compressed_dataxdd, MyFont_compressed_sizexdd, 25.f);
- anti_aim = io.Fonts->AddFontFromMemoryCompressedTTF(MyFont_compressed_data13, MyFont_compressed_size13, 15.f);
- Main1 = io.Fonts->AddFontFromMemoryTTF(&maintext1, sizeof maintext1, 18.0f);
- Main2 = io.Fonts->AddFontFromMemoryTTF(&maintext2, sizeof maintext2, 12.0f);
- Main = io.Fonts->AddFontFromMemoryTTF(&maintext1, sizeof maintext1, 22.0f);
- Main3 = io.Fonts->AddFontFromMemoryTTF(&maintext1, sizeof maintext1, 15.0f);
- LW = io.Fonts->AddFontFromFileTTF("C:\\Windows\\Fonts\\Night Machine.ttf", 24.0f);
- LW2 = io.Fonts->AddFontFromFileTTF("C:\\Windows\\Fonts\\Night Machine.ttf", 20.0f);
- D3DXCreateFont(pDevice, 20, 10, FW_NORMAL, 1, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, ("Choktoff"), &fntVerdana10);
- ImGuiStyle &style = ImGui::GetStyle();
- style.Alpha = 1.0f;
- style.WindowPadding = ImVec2(8, 8);
- style.WindowMinSize = ImVec2(32, 32);
- style.WindowRounding = 0.0f;
- style.WindowTitleAlign = ImVec2(0.5f, 0.5f);
- style.ChildWindowRounding = 0.0f;
- style.FramePadding = ImVec2(4, 1);
- style.FrameRounding = 0.0f;
- style.ItemSpacing = ImVec2(15, 4);
- style.ItemInnerSpacing = ImVec2(4, 4);
- style.TouchExtraPadding = ImVec2(0, 0);
- style.IndentSpacing = 21.0f;
- style.ColumnsMinSpacing = 3.0f;
- style.ScrollbarSize = 12.0f;
- style.ScrollbarRounding = 0.0f;
- style.GrabMinSize = 0.1f;
- style.GrabRounding = 16.0f;
- style.ButtonTextAlign = ImVec2(0.5f, 0.5f);
- style.DisplayWindowPadding = ImVec2(22, 22);
- style.DisplaySafeAreaPadding = ImVec2(4, 4);
- style.AntiAliasedLines = true;
- style.AntiAliasedShapes = true;
- style.CurveTessellationTol = 1.25f;
- ImVec4 Color_Title_Text = ImColor(165, 75, 100);
- int MenuRed, MenuGreen, MenuBlue;
- MenuRed = 255;
- MenuGreen = 255;
- MenuBlue = 255;
- ImColor mainColor = ImColor(MenuRed, MenuGreen, MenuBlue);
- ImColor bodyColor = ImColor(24, 24, 24, 239);
- ImColor fontColor = ImColor(150, 150, 150, 255);
- ImVec4 mainColorHovered = ImVec4(mainColor.Value.x + 0.1f, mainColor.Value.y + 0.1f, mainColor.Value.z + 0.1f, mainColor.Value.w);
- ImVec4 mainColorActive = ImVec4(mainColor.Value.x + 0.2f, mainColor.Value.y + 0.2f, mainColor.Value.z + 0.2f, mainColor.Value.w);
- ImVec4 menubarColor = ImVec4(bodyColor.Value.x, bodyColor.Value.y, bodyColor.Value.z, bodyColor.Value.w - 0.8f);
- ImVec4 frameBgColor = ImVec4(bodyColor.Value.x, bodyColor.Value.y, bodyColor.Value.z, bodyColor.Value.w + .1f);
- ImVec4 tooltipBgColor = ImVec4(bodyColor.Value.x, bodyColor.Value.y, bodyColor.Value.z, bodyColor.Value.w + .05f);
- //style.Colors[ImGuiCol_Button] = ImColor(255, 127, 39, 255);
- style.Colors[ImGuiCol_MainTheme] = ImColor(176, 66, 244, 255);
- style.Colors[ImGuiCol_MainTheme2] = ImColor(138, 6, 219, 255);
- style.Colors[ImGuiCol_Text] = ImVec4(0.9f, 0.9f, 0.9f, 1.f);
- style.Colors[ImGuiCol_TextDisabled] = ImVec4(1.f, 1.f, 1.f, 1.f);
- style.Colors[ImGuiCol_WindowBg] = ImVec4(0.13f, 0.13f, 0.13f, 1.f);
- style.Colors[ImGuiCol_ChildWindowBg] = ImVec4(0.1f, 0.1f, 0.1f, 0.f);
- style.Colors[ImGuiCol_Border] = ImColor(15, 30, 15, 255);
- style.Colors[ImGuiCol_BorderShadow] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
- style.Colors[ImGuiCol_FrameBg] = ImVec4(0.22f, 0.22f, 0.22f, 0.f);
- style.Colors[ImGuiCol_FrameBgHovered] = ImVec4(0.22f, 0.22f, 0.22f, 1.f);
- style.Colors[ImGuiCol_FrameBgActive] = ImVec4(0.22f, 0.22f, 0.22f, 1.f);
- style.Colors[ImGuiCol_TitleBg] = ImColor(MenuRed, MenuGreen, MenuBlue, 255);
- style.Colors[ImGuiCol_TitleBgCollapsed] = ImColor(MenuRed, MenuGreen, MenuBlue, 255);
- style.Colors[ImGuiCol_TitleBgActive] = ImColor(MenuRed, MenuGreen, MenuBlue, 255);
- style.Colors[ImGuiCol_MenuBarBg] = ImVec4(0.24f, 0.24f, 0.24f, 1.00f);
- style.Colors[ImGuiCol_ScrollbarBg] = ImVec4(frameBgColor.x + .1f, frameBgColor.y + .1f, frameBgColor.z + .1f, frameBgColor.w);
- style.Colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.40f, 0.40f, 0.40f, 1.f);
- style.Colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.40f, 0.40f, 0.40f, 1.f);
- style.Colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.40f, 0.40f, 0.40f, 1.f);
- style.Colors[ImGuiCol_ComboBg] = frameBgColor;
- style.Colors[ImGuiCol_CheckMark] = ImColor(176, 66, 244, 255);
- style.Colors[ImGuiCol_SliderGrab] = ImColor(68, 140, 255);
- style.Colors[ImGuiCol_SliderGrabActive] = ImColor(68, 140, 255);
- style.Colors[ImGuiCol_Button] = ImVec4(0.1f, 0.1f, 0.1f, 0.95f);
- style.Colors[ImGuiCol_ButtonHovered] = ImVec4(0.1f, 0.1f, 0.1f, 0.95f);
- style.Colors[ImGuiCol_ButtonActive] = ImVec4(0.1f, 0.1f, 0.1f, 0.95f);
- //style.Colors[ImGuiCol_Header] = mainColor;
- //style.Colors[ImGuiCol_HeaderHovered] = mainColorHovered;
- //style.Colors[ImGuiCol_HeaderActive] = mainColorActive;
- style.Colors[ImGuiCol_Header] = ImColor(176, 66, 244, 125);
- style.Colors[ImGuiCol_HeaderHovered] = ImColor(138, 6, 219, 125);
- style.Colors[ImGuiCol_HeaderActive] = ImColor(138, 6, 219, 125);
- style.Colors[ImGuiCol_Column] = ImVec4(.30f, .30f, .30f, 1.f);
- style.Colors[ImGuiCol_ColumnHovered] = mainColorHovered;
- style.Colors[ImGuiCol_ColumnActive] = mainColorActive;
- d3d_init = true;
- }
- void morphBtnActiveTab()
- {
- auto& style = ImGui::GetStyle();
- style.Colors[ImGuiCol_Button] = ImColor(176, 66, 244, 255);
- style.Colors[ImGuiCol_ButtonHovered] = ImColor(176, 66, 244, 255);
- style.Colors[ImGuiCol_ButtonActive] = ImColor(176, 66, 244, 255);
- style.Colors[ImGuiCol_Text] = ImColor(255, 255, 255, 255);
- }
- void morphBtnNormalTab()
- {
- auto& style = ImGui::GetStyle();
- style.Colors[ImGuiCol_Button] = ImColor(176, 66, 244, 255);
- style.Colors[ImGuiCol_ButtonHovered] = ImColor(176, 66, 244, 255);
- style.Colors[ImGuiCol_ButtonActive] = ImColor(176, 66, 244, 255);
- style.Colors[ImGuiCol_Text] = ImColor(140, 140, 140, 255);
- }
- void Active()
- {
- auto& style = ImGui::GetStyle();
- style.Colors[ImGuiCol_Button] = ImColor(17, 17, 17, 255);
- style.Colors[ImGuiCol_ButtonHovered] = ImColor(17, 17, 17, 255);
- style.Colors[ImGuiCol_ButtonActive] = ImColor(17, 17, 17, 255);
- style.Colors[ImGuiCol_Text] = ImColor(176, 66, 244, 255);
- }
- void Normal()
- {
- auto& style = ImGui::GetStyle();
- style.Colors[ImGuiCol_Button] = ImColor(17, 17, 17, 255);
- style.Colors[ImGuiCol_ButtonHovered] = ImColor(17, 17, 17, 255);
- style.Colors[ImGuiCol_ButtonActive] = ImColor(17, 17, 17, 255);
- style.Colors[ImGuiCol_Text] = ImColor(255, 255, 255, 255);
- }
- void Hover()
- {
- auto& style = ImGui::GetStyle();
- style.Colors[ImGuiCol_Button] = ImColor(17, 17, 17, 255);
- style.Colors[ImGuiCol_ButtonHovered] = ImColor(17, 17, 17, 255);
- style.Colors[ImGuiCol_ButtonActive] = ImColor(17, 17, 17, 255);
- style.Colors[ImGuiCol_Text] = ImColor(255, 255, 255, 255);
- }
- static bool _visible = true;
- void MessageSend()
- {
- write.SendClientHello();
- write.SendMatchmakingClient2GCHello();
- }
- bool __fastcall Hooks::HookedSetupbones(void * ecx, void * edx, matrix3x4_t *bone_world_out, int max_bones, int bone_mask, float current_time) {
- static auto zalupa = g_Hooks.pBones->GetOriginal<SetupBonesFn>(vtable_indexes::setupbones);
- if (ecx && ((IClientRenderable*)ecx)->GetIClientUnknown()) {
- IClientNetworkable* pNetworkable = ((IClientRenderable*)ecx)->GetIClientUnknown()->GetClientNetworkable();
- if (pNetworkable && pNetworkable->GetClientClass() && pNetworkable->GetClientClass()->ClassID == 38) {
- static auto host_timescale = g_pCvar->FindVar(("host_timescale"));
- auto player = (C_BaseEntity*)ecx;
- float OldCurTime = g_pGlobalVars->curtime;
- float OldRealTime = g_pGlobalVars->realtime;
- float OldFrameTime = g_pGlobalVars->frametime;
- float OldAbsFrameTime = g_pGlobalVars->absoluteframetime;
- float OldAbsFrameTimeStart = g_pGlobalVars->absoluteframestarttimestddev;
- float OldInterpAmount = g_pGlobalVars->interpolationAmount;
- int OldFrameCount = g_pGlobalVars->framecount;
- int OldTickCount = g_pGlobalVars->tickcount;
- g_pGlobalVars->curtime = player->GetSimulationTime();
- g_pGlobalVars->realtime = player->GetSimulationTime();
- g_pGlobalVars->frametime = g_pGlobalVars->intervalPerTick * host_timescale->GetFloat();
- g_pGlobalVars->absoluteframetime = g_pGlobalVars->intervalPerTick * host_timescale->GetFloat();
- g_pGlobalVars->absoluteframestarttimestddev = player->GetSimulationTime() - g_pGlobalVars->intervalPerTick * host_timescale->GetFloat();
- g_pGlobalVars->interpolationAmount = 0;
- g_pGlobalVars->framecount = TIME_TO_TICKS(player->GetSimulationTime());
- g_pGlobalVars->tickcount = TIME_TO_TICKS(player->GetSimulationTime());
- //*( int* ) ( ( int ) player + 224 ) |= 8;
- *(int*)((int)player + 236) |= 8; // IsNoInterpolationFrame
- bool ret_value = zalupa(player, bone_world_out, max_bones, bone_mask, g_pGlobalVars->curtime);
- *(int*)((int)player + 236) &= ~8; // (1 << 3)
- //*( int* ) ( ( int ) player + 224 ) &= ~8;
- g_pGlobalVars->curtime = OldCurTime;
- g_pGlobalVars->realtime = OldRealTime;
- g_pGlobalVars->frametime = OldFrameTime;
- g_pGlobalVars->absoluteframetime = OldAbsFrameTime;
- g_pGlobalVars->absoluteframestarttimestddev = OldAbsFrameTimeStart;
- g_pGlobalVars->interpolationAmount = OldInterpAmount;
- g_pGlobalVars->framecount = OldFrameCount;
- g_pGlobalVars->tickcount = OldTickCount;
- return ret_value;
- }
- }
- return zalupa(ecx, bone_world_out, max_bones, bone_mask, current_time);
- }
- std::vector<int> GetObservervators(int playerId)
- {
- std::vector<int> SpectatorList;
- C_BaseEntity* pPlayer = (C_BaseEntity*)g_pEntityList->GetClientEntity(playerId);
- if (!pPlayer)
- return SpectatorList;
- if (!pPlayer->IsAlive())
- {
- C_BaseEntity* pObserverTarget = (C_BaseEntity*)g_pEntityList->GetClientEntityFromHandle(pPlayer->m_hObserverTarget());
- if (!pObserverTarget)
- return SpectatorList;
- pPlayer = pObserverTarget;
- }
- for (int PlayerIndex = 0; PlayerIndex < 65; PlayerIndex++)
- {
- C_BaseEntity* pCheckPlayer = (C_BaseEntity*)g_pEntityList->GetClientEntity(PlayerIndex);
- if (!pCheckPlayer)
- continue;
- if (pCheckPlayer->IsDormant() || pCheckPlayer->IsAlive())
- continue;
- C_BaseEntity* pObserverTarget = (C_BaseEntity*)g_pEntityList->GetClientEntityFromHandle(pCheckPlayer->m_hObserverTarget());
- if (!pObserverTarget)
- continue;
- if (pPlayer != pObserverTarget)
- continue;
- SpectatorList.push_back(PlayerIndex);
- }
- return SpectatorList;
- }
- void SpectatorList()
- {
- if (!Shonax.Misc.spectators)
- return;
- if (!g_pEngine->IsInGame() && !g_pEngine->IsConnected())
- return;
- int specs = 0;
- std::string spect = "";
- int DrawIndex = 1;
- for (int playerId : GetObservervators(g_pEngine->GetLocalPlayer()))
- {
- if (playerId == g_pEngine->GetLocalPlayer())
- continue;
- C_BaseEntity* pPlayer = (C_BaseEntity*)g_pEntityList->GetClientEntity(playerId);
- if (!pPlayer)
- continue;
- PlayerInfo_s Pinfo;
- g_pEngine->GetPlayerInfo(playerId, &Pinfo);
- //if (Pinfo.fakeplayer)
- // continue;
- spect += Pinfo.szName;
- spect += "\n";
- specs++;
- }
- bool Spectators = true;
- ImGuiStyle& style = ImGui::GetStyle();
- style.Colors[ImGuiCol_WindowBg] = ImVec4(0.10f, 0.10f, 0.10f, 0.7f);
- ImGui::PushStyleColor(ImGuiCol_CloseButton, ImVec4(0.0f, 0.0f, 0.0f, 0.0f));
- style.Colors[ImGuiCol_WindowBg] = ImVec4(0.10f, 0.10f, 0.10f, 0.7f);
- ImGui::PushStyleColor(ImGuiCol_TitleBg, ImColor(176, 66, 244, 200));
- ImGui::PushStyleColor(ImGuiCol_TitleBgActive, ImColor(176, 66, 244, 200));
- ImGui::PushStyleColor(ImGuiCol_TitleBgCollapsed, ImColor(176, 66, 244, 200));
- ImGui::PushFont(Main2);
- if (ImGui::Begin("Spectators", &Spectators, ImVec2(200, 250), 1.0F, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_ShowBorders | ImGuiWindowFlags_NoScrollbar))
- {
- if (specs > 0) spect += "\n";
- ImVec2 size = ImGui::CalcTextSize(spect.c_str());
- ImGui::SetWindowSize(ImVec2(200, 40 + size.y));
- ImGui::Columns(1);
- ImGui::Text(spect.c_str());
- ImGui::Columns(1);
- DrawIndex++;
- }
- ImGui::PopStyleColor(4);
- ImGui::PopFont();
- ImGui::End();
- }
- void DrawColors()
- {
- ImVec2 menu_pos;
- ImGuiIO& io = ImGui::GetIO();
- ImGuiStyle& style = ImGui::GetStyle();
- ImVec2 pos = ImGui::GetWindowPos();
- style.Colors[ImGuiCol_WindowBg] = ImColor(17, 17, 17, 255);
- style.Colors[ImGuiCol_Border] = ImVec4(1.f, 1.f, 1.f, 0.f);
- ImGui::PushStyleColor(ImGuiCol_TitleBg, ImColor(176, 66, 244, 200));
- ImGui::PushStyleColor(ImGuiCol_TitleBgActive, ImColor(176, 66, 244, 200));
- ImGui::PushStyleColor(ImGuiCol_TitleBgCollapsed, ImColor(176, 66, 244, 200));
- ImGui::PushStyleColor(ImGuiCol_CloseButton, ImVec4(0.0f, 0.0f, 0.0f, 0.0f));
- ImGui::PushFont(Text);
- if (ImGui::Begin("Colors", &_visible, ImVec2(300, 500), 1.0F, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_ShowBorders | ImGuiWindowFlags_NoScrollbar))
- {
- ImGui::BeginChildNew("", ImVec2(280, -1), true, ImGuiWindowFlags_ChildZeus);
- {
- ImGui::Text("ESP");
- ImGui::Spacing();
- ImGui::Spacing();
- ImGui::MyColorEdit4("Font color", Shonax.Visuals.FontColor, ImGuiColorEditFlags_Alpha | ImGuiColorEditFlags_NoSliders);
- ImGui::MyColorEdit4("Box color", Shonax.Visuals.BoxColor, ImGuiColorEditFlags_Alpha | ImGuiColorEditFlags_NoSliders);
- ImGui::MyColorEdit4("Sceleton color", Shonax.Visuals.SkeletonColor, ImGuiColorEditFlags_Alpha | ImGuiColorEditFlags_NoSliders);
- ImGui::MyColorEdit4("Tracer color", Shonax.Visuals.bullet_tracer_color, ImGuiColorEditFlags_Alpha | ImGuiColorEditFlags_NoSliders);
- ImGui::MyColorEdit4("Spread color", Shonax.Visuals.show_spread_color, ImGuiColorEditFlags_Alpha | ImGuiColorEditFlags_NoSliders);
- ImGui::MyColorEdit4("Capsule color", Shonax.Visuals.capsule_col, ImGuiColorEditFlags_Alpha | ImGuiColorEditFlags_NoSliders);
- ImGui::MyColorEdit4("SoundEsp color", Shonax.Visuals.SoundEspColor, ImGuiColorEditFlags_Alpha | ImGuiColorEditFlags_NoSliders);
- ImGui::MyColorEdit4("Local SoundEsp color", Shonax.Visuals.LocalSoundEspColor, ImGuiColorEditFlags_Alpha | ImGuiColorEditFlags_NoSliders);
- ImGui::MyColorEdit4("DamageEsp color", Shonax.Visuals.damageespcolor, ImGuiColorEditFlags_Alpha | ImGuiColorEditFlags_NoSliders);
- ImGui::MyColorEdit4("Arrow color", Shonax.Visuals.povarrowcolor, ImGuiColorEditFlags_Alpha | ImGuiColorEditFlags_NoSliders);
- ImGui::MyColorEdit4("Damage group color", Shonax.Visuals.damagegroupcolor, ImGuiColorEditFlags_Alpha | ImGuiColorEditFlags_NoSliders);
- ImGui::MyColorEdit4("Line color", Shonax.Visuals.snapline, ImGuiColorEditFlags_Alpha | ImGuiColorEditFlags_NoSliders);
- ImGui::MyColorEdit4("DLight color", Shonax.Visuals.dlightcolor, ImGuiColorEditFlags_Alpha | ImGuiColorEditFlags_NoSliders);
- ImGui::Spacing();
- ImGui::Spacing();
- ImGui::Text("Colored models");
- ImGui::Spacing();
- ImGui::Spacing();
- ImGui::MyColorEdit4("Chams color", Shonax.Visuals.ChamsColor, ImGuiColorEditFlags_Alpha | ImGuiColorEditFlags_NoSliders);
- ImGui::MyColorEdit4("Glow color", Shonax.Visuals.glowcolor, ImGuiColorEditFlags_Alpha | ImGuiColorEditFlags_NoSliders);
- ImGui::MyColorEdit4("Local Chams color", Shonax.Visuals.LocalChamsColor, ImGuiColorEditFlags_Alpha | ImGuiColorEditFlags_NoSliders);
- ImGui::MyColorEdit4("Desync Chams color", Shonax.Visuals.DesyncColor, ImGuiColorEditFlags_Alpha | ImGuiColorEditFlags_NoSliders);
- ImGui::MyColorEdit4("Local Glow color", Shonax.Visuals.glowlocal, ImGuiColorEditFlags_Alpha | ImGuiColorEditFlags_NoSliders);
- ImGui::MyColorEdit4("Weapon Chams color", Shonax.Visuals.weaponchamscolor, ImGuiColorEditFlags_Alpha | ImGuiColorEditFlags_NoSliders);
- ImGui::MyColorEdit4("Hand Chams color", Shonax.Visuals.handchamscolor, ImGuiColorEditFlags_Alpha | ImGuiColorEditFlags_NoSliders);
- ImGui::MyColorEdit4("Knife Chams color", Shonax.Visuals.knifechamcolor, ImGuiColorEditFlags_Alpha | ImGuiColorEditFlags_NoSliders);
- ImGui::MyColorEdit4("Droped weapon Chams color", Shonax.Visuals.WeaponsWorldColor, ImGuiColorEditFlags_Alpha | ImGuiColorEditFlags_NoSliders);
- ImGui::MyColorEdit4("Weapon droped Glow color", Shonax.Visuals.weaponglowcolor, ImGuiColorEditFlags_Alpha | ImGuiColorEditFlags_NoSliders);
- ImGui::Spacing();
- ImGui::Spacing();
- ImGui::Text("Misc");
- if (ImGui::MyColorEdit4("Sky color", Shonax.Visuals.SkyColor, ImGuiColorEditFlags_Alpha | ImGuiColorEditFlags_NoSliders)) Shonax.Visuals.skycheck = true; else Shonax.Visuals.skycheck = false;
- if (ImGui::MyColorEdit4("World color", Shonax.Visuals.WorldColor, ImGuiColorEditFlags_Alpha | ImGuiColorEditFlags_NoSliders)) Shonax.Visuals.worldcheck = true; else Shonax.Visuals.worldcheck = false;
- }
- ImGui::EndChild();
- ImGui::PopFont();
- }
- ImGui::PopStyleColor(4);
- ImGui::End();
- }
- C_BaseCombatWeapon* GetActiveBaseCombatWeaponxd(C_BaseEntity *entity)
- {
- unsigned long pWeepEhandle = *reinterpret_cast<unsigned long*>(uintptr_t(entity) + 0x2EF8);
- return (C_BaseCombatWeapon*)(g_pEntityList->GetClientEntityFromHandle(pWeepEhandle));
- }
- void RenderMonitor()
- {
- if (!Shonax.Misc.monitor)
- return;
- if (!g_pEngine->IsConnected())
- return;
- if (!g_pEngine->IsInGame())
- return;
- if (!g::pLocalEntity)
- return;
- auto pLocal = g::pLocalEntity;
- if (!pLocal)
- return;
- if (!pLocal->IsAlive())
- return;
- if (!pLocal->IsDormant())
- return;
- ImGui::PushFont(Main2);
- ImGuiStyle& style = ImGui::GetStyle();
- style.Colors[ImGuiCol_WindowBg] = ImVec4(0.10f, 0.10f, 0.10f, 0.7f);
- if (ImGui::Begin(("Monitor"), &Shonax.Misc.monitor, ImVec2(200, 250), 1.0F, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_ShowBorders | ImGuiWindowFlags_NoScrollbar))
- {
- ImDrawList* windowDrawList = ImGui::GetWindowDrawList();
- ImVec2 siz = ImGui::GetWindowSize();
- ImVec2 pos = ImGui::GetWindowPos();
- if (pLocal)
- {
- C_BaseCombatWeapon* pWeapon = GetActiveBaseCombatWeaponxd(pLocal);
- if (pWeapon)
- {
- float accuracy = pWeapon->GetInaccuracy() * 550.f;
- if (accuracy > 179)
- accuracy = 179;
- int iSpeed = 0;
- Vector vSpeed = pLocal->GetVelocity();
- iSpeed = (int)vSpeed.Length2D();
- int iBoost = 0;
- Vector vBoost = pLocal->GetVelocity();
- iBoost = (int)vBoost.Length2D() - 300;
- float flPunch = 0.0f;
- Vector vRecoil = pLocal->GetAimPunchAngle();
- flPunch = (float)vRecoil.Length();
- if (iSpeed < 300)
- windowDrawList->AddText(ImVec2(pos.x + 25, pos.y + 1 + 217), Color(255, 255, 255, 255).GetU32(), ("Speed"));
- if (iSpeed > 300)
- windowDrawList->AddText(ImVec2(pos.x + 25, pos.y + 1 + 217), Color(255, 0, 0, 255).GetU32(), ("Boost"));
- windowDrawList->AddText(ImVec2(pos.x + 85, pos.y + 1 + 217), Color(255, 255, 255, 255).GetU32(), ("Recoil"));
- windowDrawList->AddText(ImVec2(pos.x + 145, pos.y + 1 + 217), Color(255, 255, 255, 255).GetU32(), ("Spread"));
- windowDrawList->AddRect(ImVec2(pos.x + 147, pos.y + 35), ImVec2(pos.x + 147 + 25, pos.y + 35 + 180), Color(0, 0, 0, 255).GetU32());
- windowDrawList->AddRect(ImVec2(pos.x + 87, pos.y + 35), ImVec2(pos.x + 87 + 25, pos.y + 35 + 180), Color(0, 0, 0, 255).GetU32());
- windowDrawList->AddRect(ImVec2(pos.x + 28, pos.y + 35), ImVec2(pos.x + 28 + 25, pos.y + 35 + 180), Color(0, 0, 0, 255).GetU32());
- if (iSpeed < 300)
- windowDrawList->AddRectFilled(ImVec2(pos.x + 28, pos.y + 35 + 180 - (iSpeed * 0.6)), ImVec2(pos.x + 28 + 25, pos.y + 35 + 180), Color(255, 255, 255, 255).GetU32());
- if (iSpeed > 300)
- windowDrawList->AddRectFilled(ImVec2(pos.x + 28, pos.y + 35 + 180 - (iBoost * 0.2)), ImVec2(pos.x + 28 + 25, pos.y + 35 + 180), Color(255, 0, 0, 255).GetU32());
- windowDrawList->AddRectFilled(ImVec2(pos.x + 147, pos.y + 35 + 180 - accuracy), ImVec2(pos.x + 147 + 25, pos.y + 35 + 180), Color(255, 255, 255, 255).GetU32());
- windowDrawList->AddRectFilled(ImVec2(pos.x + 87, pos.y + 35 + 180 - flPunch * 30), ImVec2(pos.x + 87 + 25, pos.y + 35 + 180), Color(255, 255, 255, 255).GetU32());
- }
- }
- }
- ImGui::PopFont();
- ImGui::End();
- }
- int givemeshit(int v)
- {
- int x, y;
- g_pEngine->GetScreenSize(x, y);
- if (v == 0)
- return x;
- else
- return y;
- }
- void DrawMenu()
- {
- ImVec2 menu_pos;
- ImGuiIO& io = ImGui::GetIO();
- ImGuiStyle& style = ImGui::GetStyle();
- ImVec2 pos = ImGui::GetWindowPos();
- static int tab = -1;
- style.Colors[ImGuiCol_WindowBg] = ImColor(17, 17, 17, 255);
- style.Colors[ImGuiCol_Border] = ImVec4(1.f, 1.f, 1.f, 0.f);
- ImGui::SetNextWindowSize(ImVec2(880, 520));
- ImGui::Begin("LegendWare", &_visible, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_ShowBorders | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoTitleBar);
- {
- style.Colors[ImGuiCol_ChildWindowBg] = ImColor(17, 17, 17, 255);
- ImGui::BeginChild("##Content", ImVec2(860, -1), false);
- {
- style.ItemSpacing = ImVec2(5, 4);
- style.ButtonTextAlign = ImVec2(0.5f, 0.0f);
- ImGui::PushFont(LW);
- ImGui::Spacing();
- ImGui::Spacing();
- ImGui::BeginGroup();
- ImGui::SameLine(20);
- ImGui::PushStyleColor(ImGuiCol_Text, ImColor(255, 255, 255, 255));
- ImGui::Text("LegendWare");
- ImGui::PopStyleColor();
- ImGui::SameLine(220);
- ImGui::PopFont();
- ImGui::BeginGroup();
- ImGui::PushFont(LW2);
- if (tab == 1) Active(); else Normal();
- if (ImGui::Button("Ragebot", ImVec2(100, 50))) tab = 1;
- ImGui::SameLine();
- if (tab == 0) Active(); else Normal();
- if (ImGui::Button("Legitbot", ImVec2(100, 50))) tab = 0;
- ImGui::SameLine();
- if (tab == 2) Active(); else Normal();
- if (ImGui::Button(" Visuals", ImVec2(100, 50))) tab = 2;
- ImGui::SameLine();
- if (tab == 3) Active(); else Normal();
- if (ImGui::Button(" Misc", ImVec2(100, 50))) tab = 3;
- ImGui::SameLine();
- if (tab == 4) Active(); else Normal();
- if (ImGui::Button("Skins", ImVec2(100, 50))) tab = 4;
- ImGui::SameLine();
- if (tab == 5) Active(); else Normal();
- if (ImGui::Button("Presets", ImVec2(100, 50))) tab = 5;
- style.Colors[ImGuiCol_Text] = ImColor(255, 255, 255, 255);
- ImGui::PopFont();
- ImGui::EndGroup();
- ImGui::EndGroup();
- style.Colors[ImGuiCol_Border] = ImColor(176, 66, 244, 240);
- style.ItemSpacing = ImVec2(5, 1);
- ImGui::Separator();
- style.Colors[ImGuiCol_Border] = ImVec4(1.f, 1.f, 1.f, 0.f);
- ImGui::PushFont(Text);
- style.ItemSpacing = ImVec2(15, 4);
- style.ButtonTextAlign = ImVec2(0.5f, 0.5f);
- if (tab == -1)
- {
- ImGui::Spacing();
- ImGui::Spacing();
- ImGui::Text("");
- ImGui::Text("Weclome!");
- }
- if (tab == 0)
- {
- ImGui::Spacing();
- ImGui::Spacing();
- ImGui::Text("");
- ImGui::PushStyleColor(ImGuiCol_Text, ImColor(176, 66, 244, 255));
- ImGui::BeginChildNew("Legitbot", ImVec2(400, 375), true, ImGuiWindowFlags_ChildZeus);
- {
- ImGui::PopStyleColor();
- ImGui::Text("Settings for %s", GetWeaponName3().c_str());
- ImGui::Checkbox("Legitbot enable", &Shonax.Aimbot.legitbot[Shonax.number].enable);
- ImGui::Text("Legit Key");
- KeyBindButton(&Shonax.Aimbot.legitbot[Shonax.number].keyxd);
- ImGui::SliderFloat("Fov", &Shonax.Aimbot.legitbot[Shonax.number].fov, 0.0f, 10.0f);
- ImGui::Checkbox("Psilent", &Shonax.Aimbot.legitbot[Shonax.number].psilent);
- ImGui::Checkbox("Backtrack##leg", &Shonax.Aimbot.legitbot[Shonax.number].LegitBacktrack);
- ImGui::Checkbox("Fast zoom", &Shonax.newfeatures.fastzoom);
- ImGui::Checkbox("Switch after zoom", &Shonax.newfeatures.switchfast);
- }
- ImGui::EndChild();
- ImGui::SameLine();
- ImGui::PushStyleColor(ImGuiCol_Text, ImColor(176, 66, 244, 255));
- ImGui::BeginChildNew("TriggerBot", ImVec2(460, 375), true, ImGuiWindowFlags_ChildZeus);
- {
- ImGui::PopStyleColor();
- {
- ImGui::Text("Settings for %s", GetWeaponName3().c_str());
- ImGui::Checkbox("Triggerbot Enable", &Shonax.TriggerBot.weapon[Shonax.number].trigetbot_enable);
- ImGui::Text("TriggerKey");
- KeyBindButton(&Shonax.TriggerBot.weapon[Shonax.number].TrigerKey);
- ImGui::Checkbox("Triggerbot Recoil", &Shonax.TriggerBot.weapon[Shonax.number].triggerbot_recoil);
- ImGui::Checkbox("Triggerbot FriendlyFire", &Shonax.TriggerBot.weapon[Shonax.number].triggerbot_deadmatch);
- const char* hitboxtriger[] = { "head", "chest", "stomack", "arms", "legs" };
- ImGui::Text("Hitbox");
- ImGui::BeginChild("##shitadgadg");
- {
- for (int i = 0; i <= 4; i++)
- ImGui::Selectable(hitboxtriger[i], &Shonax.TriggerBot.weapon[Shonax.number].triggerbotbox[i]);
- }
- ImGui::EndChild();
- //Shonax.TriggerBot.weapon[Shonax.number].triggerbot_recoil
- }
- }
- ImGui::EndChild();
- }
- if (tab == 1)
- {
- ImGui::Spacing();
- ImGui::Spacing();
- ImGui::Text("");
- ImGui::PushStyleColor(ImGuiCol_Text, ImColor(176, 66, 244, 255));
- ImGui::BeginChildNew("Ragebot", ImVec2(290, -1), true, ImGuiWindowFlags_ChildZeus);
- {
- ImGui::PopStyleColor();
- ImGui::Checkbox("Ragebot enabled", &Shonax.Aimbot.enable);
- ImGui::Checkbox("Resolver", &Shonax.Aimbot.Resolver);
- ImGui::Checkbox("Shot backtrack", &Shonax.Aimbot.ShotBacktrack);
- ImGui::Checkbox("Position backtrack", &Shonax.Aimbot.PosBacktrack);
- ImGui::Checkbox("Fix shot pitch", &Shonax.Aimbot.FixShotPitch);
- }
- ImGui::EndChild();
- ImGui::SameLine();
- ImGui::PushStyleColor(ImGuiCol_Text, ImColor(176, 66, 244, 255));
- ImGui::BeginChildNew("Weapon", ImVec2(270, -1), true, ImGuiWindowFlags_ChildZeus);
- {
- ImGui::PopStyleColor();
- ImGui::Text("Settings for %s", GetWeaponName3().c_str());
- ImGui::SliderInt("Min dmg", &Shonax.Aimbot.Weapon[Shonax.number].Mindmg, 0, 100);
- ImGui::Checkbox("Autostop", &Shonax.Aimbot.Weapon[Shonax.number].Autostop);
- const char* type[] = { "off", "extra", "normal" };
- ImGui::Combo("Hitchance", &Shonax.Aimbot.Weapon[Shonax.number].Hitchance, type, 3);
- if (Shonax.Aimbot.Weapon[Shonax.number].Hitchance != 0)
- ImGui::SliderInt("Hit value", &Shonax.Aimbot.Weapon[Shonax.number].HitchanceValue, 0, 100);
- ImGui::Checkbox("SlowWalk", &Shonax.Aimbot.Weapon[Shonax.number].SlowWalk);
- if (Shonax.Aimbot.Weapon[Shonax.number].SlowWalk)
- ImGui::SliderFloat("Speed", &Shonax.Aimbot.Weapon[Shonax.number].Speed, 0, 150);
- ImGui::Checkbox("Multipoint", &Shonax.Aimbot.Weapon[Shonax.number].MultiPoint);
- if (Shonax.Aimbot.Weapon[Shonax.number].MultiPoint)
- {
- ImGui::SliderInt("Head scale", &Shonax.Aimbot.Weapon[Shonax.number].HeadScale, 0, 100);
- ImGui::SliderInt("Body scale", &Shonax.Aimbot.Weapon[Shonax.number].BodyScale, 0, 100);
- }
- ImGui::Checkbox("Delay shot", &Shonax.Aimbot.Weapon[Shonax.number].DelayShot);
- ImGui::Checkbox("Ignore limbs", &Shonax.Aimbot.Weapon[Shonax.number].IgnoreLimbs);
- ImGui::Checkbox("Baim if lethal", &Shonax.Aimbot.Weapon[Shonax.number].BaimLethal);
- ImGui::Checkbox("Baim bad pitch", &Shonax.Aimbot.Weapon[Shonax.number].BaimPitch);
- ImGui::Checkbox("Baim in air", &Shonax.Aimbot.Weapon[Shonax.number].BaimInAir);
- }
- ImGui::EndChild();
- ImGui::SameLine();
- ImGui::PushStyleColor(ImGuiCol_Text, ImColor(176, 66, 244, 255));
- ImGui::BeginChildNew("Anti-aimbot", ImVec2(290, -1), true, ImGuiWindowFlags_ChildZeus);
- {
- ImGui::PopStyleColor();
- static int ragebutton = 1;
- static bool againrbal1, againrbal2, againrbal3 = false;
- if (ragebutton == 1) morphBtnActiveTab(); else morphBtnNormalTab();
- if (againrbal1)
- {
- style.Colors[ImGuiCol_Button] = ImColor(176, 66, 244, 255);
- style.Colors[ImGuiCol_Text] = ImColor(176, 66, 244, 255);
- }
- if (ImGui::MyButton("Stand/Slow", true, ImVec2(65.f, 30.f))) ragebutton = 1;
- if (ImGui::IsItemHovered())
- {
- againrbal1 = true;
- }
- else
- againrbal1 = false;
- if (ragebutton == 2) morphBtnActiveTab(); else morphBtnNormalTab();
- ImGui::SameLine();
- if (againrbal2)
- {
- style.Colors[ImGuiCol_Button] = ImColor(176, 66, 244, 255);
- style.Colors[ImGuiCol_Text] = ImColor(176, 66, 244, 255);
- }
- if (ImGui::MyButton("Move/Air" , true, ImVec2(65.f, 30.f))) ragebutton = 2;
- if (ImGui::IsItemHovered())
- {
- againrbal2 = true;
- }
- else
- againrbal2 = false;
- if (ragebutton == 3) morphBtnActiveTab(); else morphBtnNormalTab();
- ImGui::SameLine();
- if (againrbal3)
- {
- style.Colors[ImGuiCol_Button] = ImColor(176, 66, 244, 255);
- style.Colors[ImGuiCol_Text] = ImColor(176, 66, 244, 255);
- }
- if (ImGui::MyButton("Adjust", true, ImVec2(65.f, 30.f))) ragebutton = 3;
- if (ImGui::IsItemHovered())
- {
- againrbal3 = true;
- }
- else
- againrbal3 = false;
- if (ragebutton == 4) morphBtnActiveTab(); else morphBtnNormalTab();
- if (ragebutton == 1) againrbal1 = true;
- if (ragebutton == 2) againrbal2 = true;
- if (ragebutton == 3) againrbal3 = true;
- ImGui::Spacing();
- ImGui::Spacing();
- //ImGui::Checkbox("Enabled", &yakuza::config.AAenabled);
- const char* pitchtype[] = { "zero", "down", "up", "minimal", "fake zero", "fake down", "fake up", "switched" };
- const char* yawtype[] = { "sideways", "backwards", "rotate", "jitter", "local view", "lowerbody", "auto direction", "180z", "soon" };
- if (ragebutton == 1)
- {
- ImGui::Checkbox("Enabled", &Shonax.Antiaim.enable);
- if (Shonax.Antiaim.enable)
- {
- ImGui::Text("Stand");
- ImGui::Combo("Pitch##stand", &Shonax.Antiaim.pitch[0], pitchtype, ARRAYSIZE(pitchtype));
- ImGui::Combo("Yaw##stand", &Shonax.Antiaim.yaw[0], yawtype, ARRAYSIZE(yawtype));
- ImGui::SliderFloat("Offset##yaw1", &Shonax.Antiaim.yawoffset[0], -180, 180);
- ImGui::Text("Slow");
- ImGui::Combo("Pitch##slow", &Shonax.newfeatures.slowpitch, pitchtype, ARRAYSIZE(pitchtype));
- ImGui::Combo("Yaw##slow", &Shonax.newfeatures.slowyaw, yawtype, ARRAYSIZE(yawtype));
- ImGui::SliderFloat("Offset##slow", &Shonax.newfeatures.yawoffset, -180, 180);
- }
- }
- if (ragebutton == 2)
- {
- if (Shonax.Antiaim.enable)
- {
- ImGui::Text("Move");
- ImGui::Combo("Pitch##move", &Shonax.Antiaim.pitch[1], pitchtype, ARRAYSIZE(pitchtype));
- ImGui::Combo("Yaw##move", &Shonax.Antiaim.yaw[1], yawtype, ARRAYSIZE(yawtype));
- ImGui::SliderFloat("Offset##yaw2", &Shonax.Antiaim.yawoffset[1], -180, 180);
- ImGui::Text("Air");
- ImGui::Combo("Pitch##air", &Shonax.Antiaim.pitch[2], pitchtype, ARRAYSIZE(pitchtype));
- ImGui::Combo("Yaw##air", &Shonax.Antiaim.yaw[2], yawtype, ARRAYSIZE(yawtype));
- ImGui::SliderFloat("Offset##yaw3", &Shonax.Antiaim.yawoffset[2], -180, 180);
- }
- }
- if (ragebutton == 3)
- {
- if (Shonax.Antiaim.enable)
- {
- ImGui::Checkbox("Desync angle", &Shonax.Antiaim.DesyncAngle);
- ImGui::Checkbox("Random jitter", &Shonax.Antiaim.RandJitterInRange);
- ImGui::SliderInt("jitter range", &Shonax.Antiaim.JitterRange, 0, 360);
- ImGui::SliderInt("Fakelag", &Shonax.Antiaim.Fakelag, 0, 14);
- ImGui::Checkbox("Flag on peek", &Shonax.Antiaim.FakelagOnPeek);
- if (Shonax.Antiaim.FakelagOnPeek)
- ImGui::Checkbox("Choke shot", &Shonax.Antiaim.ChokeShotOnPeek);
- }
- }
- }
- ImGui::EndChild();
- }
- if (tab == 2)
- {
- ImGui::Spacing();
- ImGui::Spacing();
- ImGui::Text("");
- ImGui::PushStyleColor(ImGuiCol_Text, ImColor(176, 66, 244, 255));
- ImGui::BeginChildNew("Player ESP", ImVec2(285, -1), true, ImGuiWindowFlags_ChildZeus);
- {
- ImGui::PopStyleColor();
- static bool vis = false;
- const char* xdez[] = { "old", "new" };
- //ImGui::Checkbox("New Visuals", &vis);
- ImGui::Checkbox("Enable", &Shonax.Visuals.Esp);
- Shonax.Visuals.Font = 1;
- ImGui::Checkbox("Box", &Shonax.Visuals.Box);
- ImGui::Checkbox("Health bar", &Shonax.Visuals.HealthBar);
- const char* type_name[] = { "Disable", "Enable" };
- ImGui::Combo("Name", &Shonax.Visuals.Name, type_name, 2);
- const char* type_health[] = { "Disable", "Enable" };
- ImGui::Combo("Health", &Shonax.Visuals.HealthVal, type_health, 2);
- const char* typeweapon[] = { "Disable", "Bot", "Right" };
- ImGui::Combo("Weapon", &Shonax.Visuals.Weapon, typeweapon, 3);
- const char* skeletontype[] = { "Enable Skeleton" };
- //ImGui::Text("Skeleton");
- ImGui::BeginChild("##asdgsadg");
- {
- for (int i = 0; i <= 0; i++)
- ImGui::Selectable(skeletontype[i], &Shonax.Visuals.Skeleton[i]);
- }
- //ImGui::Checkbox("Line", &Shonax.Visuals.snapline_esp);
- //ImGui::Checkbox("DLight", &Shonax.Visuals.dlight);
- //ImGui::Checkbox("Capsule", &Shonax.Visuals.drawcapsule);
- //ImGui::Checkbox("Damage esp", &Shonax.Visuals.damageesp);
- //ImGui::Checkbox("Damage group esp", &Shonax.Visuals.damagegroup);
- //ImGui::Checkbox("Sound esp", &Shonax.Visuals.SoundEsp);
- //if (Shonax.Visuals.SoundEsp)
- //ImGui::Checkbox("Local Sound esp", &Shonax.Visuals.LocalSoundEsp);
- ImGui::Checkbox("Offscrean Esp", &Shonax.Visuals.povarrows);
- //Shonax.Visuals.dlight
- ImGui::EndChild();
- }
- ImGui::EndChild();
- ImGui::SameLine();
- ImGui::PushStyleColor(ImGuiCol_Text, ImColor(176, 66, 244, 255));
- ImGui::BeginChildNew("Models", ImVec2(285, -1), true, ImGuiWindowFlags_ChildZeus);
- {
- ImGui::PopStyleColor();
- ImGui::Checkbox("Enemy chams##shit", &Shonax.Visuals.Chams);
- const char* type_mat2[] = { "flat", "metallic", "gold", "crystal", "gloss", "crystal blue", "glass", "pulse", "glow", "predglass", "dgoutline" };
- const char* local_mat2[] = { "flat", "metallic", "gold", "crystal", "gloss", "crystal blue", "glass", "pulse", "glow", "predglass", "dgoutline" };
- const char* local_mat[] = { "Flat", "Metallic", "Glass typ", "Glass cry", "Pulse"};
- const char* type_mat[] = { "Flat", "Metallic", "Glass typ", "Glass cry", "Pulse" };
- const char* type_mat_anoth[] = { "gold", "crystal", "gloss", "crystal blue", "glass", "pulse", "glow","predglass", "dgoutline" };
- ImGui::Combo("Enemy chams type", &Shonax.Visuals.ChamsType, type_mat, ARRAYSIZE(type_mat));
- ImGui::Checkbox("Enemy glow", &Shonax.Visuals.glow);
- if (Shonax.Visuals.glow)
- Shonax.Visuals.glowtype = 0;
- //const char* type_name[] = { "Regular", "light", "oppac" };
- //ImGui::Combo("Enemy glow type", &Shonax.Visuals.glowtype, type_name, 3);
- ImGui::Checkbox("Local chams##local", &Shonax.Visuals.LocalChams);
- ImGui::Checkbox("Desync angle", &Shonax.Visuals.BacktrackLocalChams);
- //ImGui::Checkbox("Fakelag Chams##local", &Shonax.Visuals.BacktrackLocalChams);
- ImGui::Combo("Chams type local##local", &Shonax.Visuals.LocalChamsType, local_mat, ARRAYSIZE(local_mat));
- ImGui::Checkbox("Weapon chams##local", &Shonax.Visuals.weaponchams);
- ImGui::Combo("Weapon type##local", &Shonax.Visuals.weaponchamstype, type_mat_anoth, ARRAYSIZE(type_mat_anoth));
- ImGui::Checkbox("Glow local##local", &Shonax.Visuals.localglow);
- if (Shonax.Visuals.localglow)
- Shonax.Visuals.glowlocaltype = 0;
- //ImGui::Combo("Glow type##local", &Shonax.Visuals.glowlocaltype, type_name, 3);
- }
- ImGui::EndChild();
- ImGui::SameLine();
- ImGui::PushStyleColor(ImGuiCol_Text, ImColor(176, 66, 244, 255));
- ImGui::BeginChildNew("Others", ImVec2(285, -1), true, ImGuiWindowFlags_ChildZeus);
- {
- ImGui::PopStyleColor();
- const char* key_binds[] = { "none", "mouse1", "mouse2", "mouse3", "mouse4", "mouse5", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "f10", "f11", "f12" };
- ImGui::Text("Thirdperson");
- KeyBindButton(&Shonax.Visuals.tp_key);
- //ImGui::Checkbox("Hitbox points", &Shonax.Visuals.HitboxPoints);
- ImGui::Checkbox("No zoom", &Shonax.Visuals.NoZoom);
- ImGui::Checkbox("No scope", &Shonax.Visuals.NoScope);
- ImGui::Checkbox("No recoil", &Shonax.Visuals.NoRecoil);
- ImGui::Checkbox("No flash", &Shonax.Visuals.noflash);
- ImGui::Checkbox("No smoke", &Shonax.Visuals.nosmoke);
- ImGui::Checkbox("Bullet trcer", &Shonax.Visuals.bullet_tracer);
- ImGui::Checkbox(("Show spread"), &Shonax.Visuals.show_spread);
- const char* spreadtype[] = { "standart", "rainbow" };
- ImGui::Combo(("Spread type"), &Shonax.Visuals.show_spread_type, spreadtype, ARRAYSIZE(spreadtype));
- ImGui::Checkbox("Killfeed", &Shonax.Visuals.killfeed);
- ImGui::Checkbox("Grenade prediction", &Shonax.Visuals.grenadepred);
- //ImGui::Checkbox("Grenade throwed", &Shonax.Visuals.grenadethrowed);
- ImGui::Checkbox("Galaxy sky", &Shonax.Visuals.galaxysky);
- ImGui::Checkbox("Enable postprocessing", &Shonax.Visuals.matpostprocessenable);
- //ImGui::Checkbox("Clear HUD", &Shonax.Visuals.clearhud);
- ImGui::Checkbox("Zeus range", &Shonax.newfeatures.drawzeus);
- //Shonax.newfeatures.drawzeus
- const char* hittype[] = { "Static", "Dynamic+" };
- ImGui::Text("Hitmarker");
- ImGui::BeginChild("##hitmarker");
- {
- for (int i = 0; i <= 1; i++)
- ImGui::Selectable(hittype[i], &Shonax.Visuals.hitmarker[i]);
- }
- ImGui::EndChild();
- }
- ImGui::EndChild();
- }
- if (tab == 3)
- {
- ImGui::Spacing();
- ImGui::Spacing();
- ImGui::Text("");
- ImGui::PushStyleColor(ImGuiCol_Text, ImColor(176, 66, 244, 255));
- ImGui::BeginChildNew("Misc", ImVec2(500, 475), true, ImGuiWindowFlags_ChildZeus);
- {
- ImGui::PopStyleColor();
- ImGui::Checkbox("Bhop", &Shonax.Misc.Bhop);
- ImGui::Checkbox("Autostrafe", &Shonax.Misc.AutoStrafe);
- ImGui::Checkbox("Unlimited duck", &Shonax.Misc.unlimit_duck);
- ImGui::Checkbox("Fake duck", &Shonax.Misc.fake_crouch);
- ImGui::Text("Fake duck key"); KeyBindButton(&Shonax.newfeatures.fakeduckkey);
- ImGui::Checkbox("Ragdolls", &Shonax.Misc.exaggeratedragdolls);
- ImGui::Checkbox("Trashtalk", &Shonax.Misc.trashtalk);
- ImGui::Checkbox("Buybot enable", &Shonax.BuyBot.enable);
- if (Shonax.BuyBot.enable)
- {
- const char* main[] = { "Auto", "Awp", "Scout" };
- const char* second[] = { "Deagle&Revolver", "Dual" };
- const char* other[] = { "VestHelm" };
- const char* grenade[] = { "None", "All" };
- ImGui::Combo("Main", &Shonax.BuyBot.main, main, ARRAYSIZE(main));
- ImGui::Combo("Second", &Shonax.BuyBot.second, second, ARRAYSIZE(second));
- ImGui::Combo("Helmet", &Shonax.BuyBot.ammo, other, ARRAYSIZE(other));
- ImGui::Combo("Grenade", &Shonax.BuyBot.grenade, grenade, ARRAYSIZE(grenade));
- }
- ImGui::Checkbox("Clantag enable", &Shonax.Clantag.enable);
- if (Shonax.Clantag.enable)
- {
- auto applyxd = [](const char * name) -> void {
- using Fn = int(__fastcall *)(const char *, const char *);
- static auto fn = reinterpret_cast<Fn>(Utils::FindSignature("engine.dll", "53 56 57 8B DA 8B F9 FF 15"));
- fn(name, name);
- };
- static char buffer[16];
- ImGui::InputText("custom", buffer, IM_ARRAYSIZE(buffer));
- if (ImGui::Button("Set custom")) {
- applyxd(buffer);
- }
- }
- /*ImGui::Checkbox("Modelchanger enable", &Shonax.Modelchanger.enable);
- if (Shonax.Modelchanger.enable)
- {
- ImGui::Combo(("ct model"), &Shonax.Modelchanger.ctmodel, playermodels, ARRAYSIZE(playermodels));
- ImGui::Combo(("t model"), &Shonax.Modelchanger.tmodel, playermodels, ARRAYSIZE(playermodels));
- ImGui::Combo(("knife model"), &Shonax.Modelchanger.knifemodel, knifecustommodels, ARRAYSIZE(knifecustommodels));
- if (ImGui::Button("Force Update"))
- KnifeApplyCallbk();
- }*/
- ImGui::Checkbox("Hitsounds", &Shonax.Misc.hitsound);
- const char* hits[] = { "Gamesense","Bubble" };
- if (Shonax.Misc.hitsound)
- ImGui::Combo(("Hit"), &Shonax.Misc.hit, hits, ARRAYSIZE(hits));
- ImGui::Checkbox("KnifeBot", &Shonax.Misc.knifebot);
- ImGui::Checkbox("AutoAccept", &Shonax.newfeatures.special);
- }
- ImGui::EndChild();
- ImGui::SameLine();
- ImGui::PushStyleColor(ImGuiCol_Text, ImColor(176, 66, 244, 255));
- ImGui::BeginChildNew("Other", ImVec2(360, 475), true, ImGuiWindowFlags_ChildZeus);
- {
- ImGui::PopStyleColor();
- ImGui::SliderInt("Fov", &Shonax.Visuals.Fov, 0, 150);
- ImGui::SliderInt("Fov weapon", &Shonax.Visuals.viewmodel, 0, 150);
- ImGui::SliderInt("Fov x", &Shonax.Visuals.viewmodel_x, 0, 10);
- ImGui::SliderInt("Fov y", &Shonax.Visuals.viewmodel_y, 0, 10);
- ImGui::SliderInt("Fov z", &Shonax.Visuals.viewmodel_z, 0, 20);
- ImGui::Checkbox("Spectators", &Shonax.Misc.spectators);
- ImGui::Text("EventLog");
- const char* eventlogxd[] = { "Hits", "Buys" };
- ImGui::BeginChild("##ergdg");
- {
- for (int i = 0; i <= 1; i++)
- ImGui::Selectable(eventlogxd[i], &Shonax.Misc.eventlog[i]);
- //ImGui::Selectable("killstreaklog", &Shonax.Visuals.eventkilling);
- }
- ImGui::EndChild();
- }
- ImGui::EndChild();
- }
- if (tab == 4)
- {
- ImGui::Spacing();
- ImGui::Spacing();
- ImGui::Text("");
- ImGui::PushStyleColor(ImGuiCol_Text, ImColor(176, 66, 244, 255));
- ImGui::BeginChildNew("Rankchanger", ImVec2(400, 375), true, ImGuiWindowFlags_ChildZeus);
- {
- ImGui::PopStyleColor();
- ImGui::Checkbox("Rackchanger", &Shonax.RankChanger.enabled);
- const char* xdxdranks[] = {
- "off",
- "silver 1",
- "silver 2",
- "silver 3",
- "silver 4",
- "silver elite",
- "silver elite master",
- "gold nova 1",
- "gold nova 2",
- "gold nova 3",
- "gold nova master",
- "master guardian 1",
- "master guardian 2",
- "master guardian elite",
- "distinguished master guardian",
- "legendary eagle",
- "legendary eagle master",
- "supreme master first class",
- "the global elite"
- };
- ImGui::Combo(("Rank"), &Shonax.RankChanger.rank_id, xdxdranks, ARRAYSIZE(xdxdranks));
- ImGui::PushItemWidth(150.0f);
- ImGui::SliderInt("Level", &Shonax.RankChanger.player_level, 0, 40);
- ImGui::InputInt("Xp##level", &Shonax.RankChanger.player_level_xp);
- ImGui::PushItemWidth(150.0f);
- ImGui::InputInt("Wins", &Shonax.RankChanger.wins);
- ImGui::PushItemWidth(150.0f);
- ImGui::InputInt("Friend", &Shonax.RankChanger.cmd_friendly);
- ImGui::PushItemWidth(150.0f);
- ImGui::InputInt("Teach", &Shonax.RankChanger.cmd_teaching);
- ImGui::PushItemWidth(150.0f);
- ImGui::InputInt("Leader", &Shonax.RankChanger.cmd_leader);
- static const char* bans[] =
- {
- "none",
- "you were kicked from the last match (competitive cooldown)",
- "you killed too many teammates (competitive cooldown)",
- "you killed a teammate at round start (competitive cooldown)",
- "you failed to reconnect to the last match (competitive cooldown)",
- "you abandoned the last match (competitive cooldown)",
- "you did too much damage to your teammates (competitive cooldown)",
- "you did too much damage to your teammates at round start (competitive cooldown)",
- "this account is permanently untrusted (global cooldown)",
- "you were kicked from too many recent matches (competitive cooldown)",
- "convicted by overwatch - majorly disruptive (global cooldown)",
- "convicted by overwatch - minorly disruptive (global cooldown)",
- "resolving matchmaking state for your account (temporary cooldown)",
- "resolving matchmaking state after the last match (temporary cooldown)",
- "this account is permanently untrusted (global cooldown)",
- "(global cooldown)",
- "you failed to connect by match start. (competitive cooldown)",
- "you have kicked too many teammates in recent matches (competitive cooldown)",
- "congratulations on your recent competitive wins! before you play competitive matches further please wait for matchmaking servers to calibrate your skill group placement based on your lastest performance. (temporary cooldown)",
- "a server using your game server login token has been banned. your account is now permanently banned from operating game servers, and you have a cooldown from connecting to game servers. (global cooldown)"
- };
- ImGui::Combo("Ban", &Shonax.RankChanger.ban, bans, IM_ARRAYSIZE(bans));
- ImGui::InputInt("Time##ban", &Shonax.RankChanger.time);
- if (ImGui::Button(("Update##egfa")))
- {
- write.SendClientHello();
- write.SendMatchmakingClient2GCHello();
- }
- }
- ImGui::EndChild();
- ImGui::SameLine();
- ImGui::PushStyleColor(ImGuiCol_Text, ImColor(176, 66, 244, 255));
- ImGui::BeginChildNew("Skinchanger", ImVec2(460, 375), true, ImGuiWindowFlags_ChildZeus);
- {
- ImGui::PopStyleColor();
- if (ImGui::Button("Force Update", ImVec2(-1, 20)))
- KnifeApplyCallbk();
- if (ImGui::Checkbox("Skinchanger", &Shonax.Skinchanger.skinenabled)) KnifeApplyCallbk();
- if (ImGui::Checkbox("Stickerchanger", &Shonax.Skinchanger.stickers)) KnifeApplyCallbk();
- ImGui::Checkbox("Custom skinchanger", &Shonax.Skinchanger.customchams);
- if (ImGui::IsItemHovered())
- ImGui::SetTooltip(("Bind the \"del\" key to remove current bind."));
- if (!Shonax.Skinchanger.customchams && Shonax.Skinchanger.skinenabled)
- {
- if (ImGui::Combo("Model##knife", &Shonax.Skinchanger.Knife, knifemodels, ARRAYSIZE(knifemodels))) KnifeApplyCallbk();
- if (ImGui::Combo("Skins##knife", &Shonax.Skinchanger.KnifeSkin, knifeskin, ARRAYSIZE(knifeskin))) KnifeApplyCallbk();
- ImGui::Combo("Awp", &Shonax.Skinchanger.AWPSkin, awp, ARRAYSIZE(awp));
- ImGui::Combo("Scout", &Shonax.Skinchanger.SSG08Skin, scout, ARRAYSIZE(scout));
- ImGui::Combo("Scar", &Shonax.Skinchanger.SCAR20Skin, scars, ARRAYSIZE(scars));
- ImGui::Combo("Glock", &Shonax.Skinchanger.GlockSkin, glock, ARRAYSIZE(glock));
- ImGui::Combo("G3sg1", &Shonax.Skinchanger.G3sg1Skin, g3sg1, ARRAYSIZE(g3sg1));
- ImGui::Combo("Duals", &Shonax.Skinchanger.DualSkin, duals, ARRAYSIZE(duals));
- ImGui::Combo("Deagle", &Shonax.Skinchanger.DeagleSkin, deagle, ARRAYSIZE(deagle));
- ImGui::Combo("Usp-s", &Shonax.Skinchanger.USPSkin, usp, ARRAYSIZE(usp));
- ImGui::Combo("Ak-47", &Shonax.Skinchanger.AK47Skin, ak, ARRAYSIZE(ak));
- ImGui::Combo("P2000", &Shonax.Skinchanger.P2000Skin, p2000, ARRAYSIZE(p2000));
- ImGui::Combo("Revolver", &Shonax.Skinchanger.RevolverSkin, revolver, ARRAYSIZE(revolver));
- if (Shonax.Skinchanger.stickers)
- {
- ImGui::Combo("Sticker 1", &Shonax.Skinchanger.allin1skins[Shonax.number].Stikers1, ids, ARRAYSIZE(ids));
- ImGui::Combo("Sticker 2", &Shonax.Skinchanger.allin1skins[Shonax.number].Stikers2, ids, ARRAYSIZE(ids));
- ImGui::Combo("Sticker 3", &Shonax.Skinchanger.allin1skins[Shonax.number].Stikers3, ids, ARRAYSIZE(ids));
- ImGui::Combo("Sticker 4", &Shonax.Skinchanger.allin1skins[Shonax.number].Stikers4, ids, ARRAYSIZE(ids));
- }
- }
- else
- {
- const char* awpcustom[] = { "none", "tokyo ghoul", "miku", "frost", "jinx", "snaked", "colorich", "blackrockshooter", "stars", "thunder" };
- ImGui::Combo(("Awp##custom"), &Shonax.Skinchanger.awpcustom, awpcustom, ARRAYSIZE(awpcustom));
- const char* ak47custom[] = { "none", "gladiator", "vanish", "sport", "green" };
- ImGui::Combo(("ak47##custom"), &Shonax.Skinchanger.ak47custom, ak47custom, ARRAYSIZE(ak47custom));
- const char* m4a1scustom[] = { "none", "EnergyEagle", "Blue Force", "Freeze" };
- ImGui::Combo(("m4a1##custom"), &Shonax.Skinchanger.m4a1scustom, m4a1scustom, ARRAYSIZE(m4a1scustom));
- const char* scarcustom[] = { "none", "blue" };
- ImGui::Combo(("scar##custom"), &Shonax.Skinchanger.scarcustom, scarcustom, ARRAYSIZE(scarcustom));
- const char* ssgcustom[] = { "none", "tatoo" };
- ImGui::Combo(("ssg##custom"), &Shonax.Skinchanger.ssgcustom, ssgcustom, ARRAYSIZE(ssgcustom));
- const char* customknife[] = { "none", "m9 grafit", "color bayonet", "flip galaxy", "karambit purpel", "m9 evolve", "karambit spectrum", "karambit hyper", "karambit beast", "karambit aquamarine", "m9 crystal", "M9 Space", "Falchion Pearl", "Butterfly Disarray", "Falchion Fade", "tactical fade" };
- if (ImGui::Combo(("knifes##custom"), &Shonax.Skinchanger.knifecustom, customknife, ARRAYSIZE(customknife))) KnifeApplyCallbk();
- ImGui::Text("Custom knife skins on your current weapon");
- ImGui::Combo(("-> %s", GetWeaponName3().c_str()), &Shonax.newfeatures.allcustomskins[Shonax.number], customknife, ARRAYSIZE(customknife));
- }
- }
- ImGui::EndChild();
- }
- if (tab == 5)
- {
- ImGui::Spacing();
- ImGui::Spacing();
- ImGui::Text("");
- ImGui::PushStyleColor(ImGuiCol_Text, ImColor(176, 66, 244, 255));
- ImGui::BeginChildNew("", ImVec2(-1, 0), true, ImGuiWindowFlags_ChildZeus);
- {
- ImGui::PopStyleColor();
- ImGui::InputText(("CFG name"), ConfigNamexd, 64);
- static int sel;
- std::string config;
- std::vector<std::string> configs = Shonax.Config.GetConfigs();
- if (configs.size() > 0) {
- ImGui::ComboBoxArrayxd(("Configs"), &sel, configs);
- ImGui::Spacing();
- ImGui::Separator();
- ImGui::Spacing();
- ImGui::PushItemWidth(220.f);
- config = configs[Shonax.Config.counts];
- }
- Shonax.Config.counts = sel;
- if (configs.size() > 0) {
- if (ImGui::Button(("Load"), ImVec2(50, 20)))
- {
- Shonax.Config.Load(config);
- }
- }
- ImGui::SameLine();
- if (configs.size() >= 1) {
- if (ImGui::Button(("Save"), ImVec2(50, 20)))
- {
- Shonax.Config.Save(config);
- }
- }
- ImGui::SameLine();
- if (ImGui::Button(("Create"), ImVec2(50, 20)))
- {
- std::string ConfigFileName = ConfigNamexd;
- if (ConfigFileName.size() < 1)
- {
- ConfigFileName = ("settings");
- }
- Shonax.Config.CreateConfig(ConfigFileName);
- }
- ImGui::SameLine();
- if (config.size() >= 1) {
- if (ImGui::Button(("Delete"), ImVec2(50, 20)))
- {
- Shonax.Config.Remove(config);
- }
- }
- }
- ImGui::EndChild();
- ImGui::Columns(1);
- }
- ImGui::PopFont();
- }
- ImGui::EndChild();
- }
- ImGui::End();
- }
- void __stdcall Hooks::Hooked_EndScene(IDirect3DDevice9* pDevice)
- {
- //static auto ofunc = g_Hooks.pD3d9Hook->GetOriginal<EndSceneFn>(vtable_indexes::d3d9menu);
- ImGuiStyle& style = ImGui::GetStyle();
- if (!d3d_init)
- GUI_Init(pDevice);
- ImGui::GetIO().MouseDrawCursor = menu_open;
- //if (g_pEngine->IsConnected())
- // ImGui::FinalFix(pDevice);
- ImGui_ImplDX9_NewFrame();
- POINT mp;
- GetCursorPos(&mp);
- ImGuiIO& io = ImGui::GetIO();
- io.MousePos.x = mp.x;
- io.MousePos.y = mp.y;
- if (g_pEngine->IsConnected())
- ImGui::StageFix(pDevice);
- if (menu_open)
- {
- DrawMenu();
- DrawColors();
- }
- SpectatorList();
- ImGui::Render();
- //if (g_pEngine->IsConnected())
- // ImGui::ClearFix(pDevice);
- return oEndSceneFn->GetTrampoline()(pDevice);
- }
- void __stdcall Hooks::Hooked_EndScene_Reset(IDirect3DDevice9* pDevice, D3DPRESENT_PARAMETERS* pPresentationParameters)
- {
- //static auto ofunc = g_Hooks.pD3d9Hook->GetOriginal<EndSceneResetFn>(vtable_indexes::d3d9reset);
- if (!d3d_init)
- return oEndSceneResetFn->GetTrampoline()(pDevice, pPresentationParameters);
- ImGui_ImplDX9_InvalidateDeviceObjects();
- ImGui::DestroyFix();
- ImGui_ImplDX9_CreateDeviceObjects();
- return oEndSceneResetFn->GetTrampoline()(pDevice, pPresentationParameters);
- }
- void __stdcall Hooks::Hooked_features(IDirect3DDevice9* m_device, const RECT* source_rect, const RECT* dest_rect, HWND dest_window_override, const RGNDATA* dirty_region)
- {
- //static auto ofunc = g_Hooks.pD3d9Hook->GetOriginal<D3D9FEATURES>(vtable_indexes::d3d9features);
- static const D3DRENDERSTATETYPE backupStates[] = { D3DRS_COLORWRITEENABLE, D3DRS_ALPHABLENDENABLE, D3DRS_SRCBLEND, D3DRS_DESTBLEND, D3DRS_BLENDOP, D3DRS_FOGENABLE };
- static const int size = sizeof(backupStates) / sizeof(DWORD);
- DWORD oldStates[size] = { 0 };
- for (int i = 0; i < size; i++)
- m_device->GetRenderState(backupStates[i], &oldStates[i]);
- m_device->SetRenderState(D3DRS_COLORWRITEENABLE, 0xFFFFFFFF);
- if (g_pEngine->IsConnected() && g_pEngine->IsInGame())
- otheresp::get().spread_crosshair(m_device);
- if (g_pEngine->IsConnected() && g_pEngine->IsInGame())
- DamageESP::Draw();
- if (Shonax.Visuals.povarrows)
- OffscreenESP(Color(Shonax.Visuals.povarrowcolor[0]*255, Shonax.Visuals.povarrowcolor[1] * 255, Shonax.Visuals.povarrowcolor[2] * 255, Shonax.Visuals.povarrowcolor[3] * 255), m_device);
- if (g_pEngine->IsConnected() && g_pEngine->IsInGame() && Shonax.NewVisuals.enable && !Shonax.Visuals.Esp)
- {
- }
- for (int i = 0; i < size; i++)
- m_device->SetRenderState(backupStates[i], oldStates[i]);
- oD3D9FEATURES->GetTrampoline()(m_device, source_rect, dest_rect, dest_window_override, dirty_region);
- }
- void __fastcall Hooks::SetMouseCodeState_h(void* thisptr, void* EDX, ButtonCode_t code, MouseCodeState_t state)
- {
- //static auto o_SetMouseCodeState = g_Hooks.keyset->GetOriginal<SetMouseCodeState_t>(vtable_indexes::mousecode);
- if (input_shouldListen && state == BUTTON_PRESSED)
- {
- input_shouldListen = false;
- if (input_receivedKeyval)
- *input_receivedKeyval = code;
- }
- return oSetMouseCodeState_t->GetTrampoline()(thisptr, code, state);
- }
- void __fastcall Hooks::SetKeyCodeState_h(void* thisptr, void* EDX, ButtonCode_t code, bool bDown)
- {
- //static auto o_SetKeyCodeState = g_Hooks.keyset->GetOriginal<SetKeyCodeState_t>(vtable_indexes::keycode);
- if (input_shouldListen && bDown)
- {
- input_shouldListen = false;
- if (input_receivedKeyval)
- *input_receivedKeyval = code;
- }
- return oSetKeyCodeState_t->GetTrampoline()(thisptr, code, bDown);
- }
- const char* GetHitgroupName(int hitgroup)
- {
- switch (hitgroup)
- {
- case 1:
- return "Head";
- case 2:
- return "Chest";
- case 3:
- return "Pelvis";
- case 4:
- return "Left Arm";
- case 5:
- return "Right Arm";
- case 6:
- return "Left Leg";
- case 7:
- return "Right Leg";
- default:
- return "";
- }
- }
- float dot_product(const Vector & a, const Vector & b) {
- return (a.x * b.x
- + a.y * b.y
- + a.z * b.z);
- }
- static void CapsuleOverlay(C_BaseEntity* pPlayer, Color col, float duration)
- {
- if (!pPlayer)
- return;
- studiohdr_t* pStudioModel = g_pModelInfo->GetStudiomodel((model_t*)pPlayer->GetModel());
- if (!pStudioModel)
- return;
- static matrix3x4_t pBoneToWorldOut[128];
- if (!pPlayer->SetupBones(pBoneToWorldOut, 128, 256, 0))
- return;
- mstudiohitboxset_t* pHitboxSet = pStudioModel->GetHitboxSet(0);
- if (!pHitboxSet)
- return;
- auto VectorTransform2 = [](const Vector in1, matrix3x4_t in2, Vector& out)
- {
- out[0] = dot_product(in1, Vector(in2[0][0], in2[0][1], in2[0][2])) + in2[0][3];
- out[1] = dot_product(in1, Vector(in2[1][0], in2[1][1], in2[1][2])) + in2[1][3];
- out[2] = dot_product(in1, Vector(in2[2][0], in2[2][1], in2[2][2])) + in2[2][3];
- };
- for (int i = 0; i < pHitboxSet->numhitboxes; i++)
- {
- mstudiobbox_t* pHitbox = pHitboxSet->GetHitbox(i);
- if (!pHitbox)
- continue;
- Vector vMin, vMax;
- VectorTransform2(pHitbox->min, pBoneToWorldOut[pHitbox->bone], vMin); //nullptr???
- VectorTransform2(pHitbox->max, pBoneToWorldOut[pHitbox->bone], vMax);
- if (pHitbox->radius > -1)
- {
- g_pIVDebugOverlay->AddCapsuleOverlay(vMin, vMax, pHitbox->radius, col.red, col.green, col.blue, col.alpha, duration);
- }
- }
- }
- void C_HookedEvents::FireGameEvent(IGameEvent* event)
- {
- auto event_name = event->GetName();
- //auto attacker = event->GetInt("attacker");
- //auto user = event->GetInt("userid");
- static bool newkillstreak;
- if (strcmp(event_name, "round_prestart"))
- {
- g::newround = true;
- newkillstreak = true;
- }
- if (buybotfix)
- {
- if (Shonax.BuyBot.enable)
- {
- //ammo
- if (Shonax.BuyBot.ammo == 0)
- g_pEngine->ExecuteClientCmd("buy vesthelm");
- //main
- if (Shonax.BuyBot.main == 0)
- g_pEngine->ExecuteClientCmd("buy g3sg1; buy scar20");
- if (Shonax.BuyBot.main == 1)
- g_pEngine->ExecuteClientCmd("buy awp");
- if (Shonax.BuyBot.main == 2)
- g_pEngine->ExecuteClientCmd("buy ssg08");
- //second
- if (Shonax.BuyBot.second == 0)
- g_pEngine->ExecuteClientCmd("buy deagle; buy revolver");
- if (Shonax.BuyBot.second == 1)
- g_pEngine->ExecuteClientCmd("buy elite");
- //grenade
- if (Shonax.BuyBot.grenade == 0)
- g_pEngine->ExecuteClientCmd("");
- if (Shonax.BuyBot.grenade == 1)
- g_pEngine->ExecuteClientCmd("buy hegrenade; buy molotov; buy smokegrenade; buy incgrenade;");
- }
- buybotfix = false;
- }
- if (Shonax.Visuals.hitmarker[0] || Shonax.Visuals.hitmarker[1])
- otheresp::get().hitmarker_event(event);
- const char* fuckthattrash;
- if (strstr(event->GetName(), "player_hurt"))
- {
- if (!event)
- return;
- if (!g::pLocalEntity)
- return;
- auto* attacker = (C_BaseEntity*)g_pEntityList->GetClientEntity(g_pEngine->GetPlayerForUserID(event->GetInt("attacker")));
- if (!attacker)
- return;
- if (attacker != g::pLocalEntity)
- return;
- PlayerInfo_s player_info;
- g_pEngine->GetPlayerInfo(g_pEngine->GetPlayerForUserID(event->GetInt("userid")), &player_info);
- //dont edit or gay, please :(
- FEATURES::MISC::InGameLogger::Log log;
- log.color_line.PushBack(("LegendWare"), Color(138, 6, 219, 255));
- log.color_line.PushBack(("-> "), Color(176, 66, 244, 255));
- log.color_line.PushBack("hit ", Color(230, 230, 230, 255));
- log.color_line.PushBack(player_info.szName, Color(176, 66, 244, 255));
- int hitgroup = event->GetInt("hitgroup");
- if (hitgroup > 0 && hitgroup <= 7)
- {
- log.color_line.PushBack(" in the ", Color(230, 230, 230, 255));
- log.color_line.PushBack(GetHitgroupName(hitgroup), Color(230, 230, 230, 255));
- gitgrp = hitgroup;
- fuckthattrash = GetHitgroupName(hitgroup);
- }
- log.color_line.PushBack(" for ", Color(230, 230, 230, 255));
- log.color_line.PushBack(std::to_string(event->GetInt("dmg_health")), Color(176, 66, 244, 255));
- log.color_line.PushBack(" damage", Color(230, 230, 230, 255));
- if (Shonax.Visuals.drawcapsule)
- {
- C_BaseEntity* hittedplayer = (C_BaseEntity*)g_pEntityList->GetClientEntity(g_pEngine->GetPlayerForUserID(event->GetInt("userid")));
- if (hittedplayer && hittedplayer->EntIndex() > 0 && hittedplayer->EntIndex() < 64)
- {
- if (g::pLocalEntity && hittedplayer != g::pLocalEntity)
- CapsuleOverlay(hittedplayer, Color(Shonax.Visuals.capsule_col[0]*255, Shonax.Visuals.capsule_col[1] * 255, Shonax.Visuals.capsule_col[2] * 255), 1.0f);
- }
- }
- if (Shonax.Visuals.SoundEsp)
- {
- auto victim = g_pEntityList->GetClientEntity(g_pEngine->GetPlayerForUserID(event->GetInt("userid")));
- if (attacker == g::pLocalEntity && !Shonax.Visuals.LocalSoundEspColor)
- sound_logs.push_back(sound_info(victim->GetAbsOrigin(), g_pGlobalVars->curtime, event->GetInt("userid")));
- else if (attacker == g::pLocalEntity && Shonax.Visuals.LocalSoundEspColor)
- sound_logs_local.push_back(sound_info(victim->GetAbsOrigin(), g_pGlobalVars->curtime, event->GetInt("userid")));
- }
- if (Shonax.Misc.hitsound)
- {
- switch (Shonax.Misc.hit)
- {
- case 0:
- g_pSurface->PlaySound_("buttons\\arena_switch_press_02.wav");
- break;
- case 1:
- PlaySoundA(bubble, nullptr, SND_MEMORY | SND_ASYNC);
- break;
- default:
- break;
- }
- }
- if (Shonax.Misc.eventlog[0])
- FEATURES::MISC::in_game_logger.AddLog(log);
- }
- if (strstr(event->GetName(), "item_purchase") && Shonax.Misc.eventlog[1])
- {
- if (!event)
- return;
- if (!g::pLocalEntity)
- return;
- auto* entity = (C_BaseEntity*)g_pEntityList->GetClientEntity(g_pEngine->GetPlayerForUserID(event->GetInt("userid")));
- if (!entity)
- return;
- if (entity->GetTeam() == g::pLocalEntity->GetTeam())
- return;
- PlayerInfo_s player_info;
- if (!g_pEngine->GetPlayerInfo(entity->EntIndex(), &player_info))
- return;
- FEATURES::MISC::InGameLogger::Log log;
- log.color_line.PushBack(("LegendWare"), Color(138, 6, 219, 255));
- log.color_line.PushBack(("-> "), Color(176, 66, 244, 255));
- log.color_line.PushBack(player_info.szName, Color(230, 230, 230, 255));
- log.color_line.PushBack(" bought a ", Color(48, 5, 219, 255));
- log.color_line.PushBack(event->GetString("weapon"), Color(176, 66, 244, 255));
- FEATURES::MISC::in_game_logger.AddLog(log);
- }
- if (strstr(event->GetName(), "bomb_beginplant") && Shonax.Misc.eventlog[2]) {
- auto userid = event->GetInt("userid");
- if (!userid) {
- return;
- }
- auto userid_id = g_pEngine->GetPlayerForUserID(userid);
- PlayerInfo_s userid_info;
- if (!g_pEngine->GetPlayerInfo(userid_id, &userid_info)) {
- return;
- }
- auto m_player = static_cast< C_BaseEntity * >(g_pEntityList->GetClientEntity(userid_id));
- if (!m_player) {
- return;
- }
- FEATURES::MISC::InGameLogger::Log log;
- log.color_line.PushBack(("LegendWare"), Color(138, 6, 219, 255));
- log.color_line.PushBack(("-> "), Color(176, 66, 244, 255));
- log.color_line.PushBack(userid_info.szName, Color(230, 230, 230, 255));
- log.color_line.PushBack(" has began planting the bomb at ", Color(230, 230, 230, 255));
- log.color_line.PushBack(std::to_string(event->GetInt("site")), Color(176, 66, 244, 255));
- FEATURES::MISC::in_game_logger.AddLog(log);
- //Color(209, 10, 70, 255)
- }
- if (strstr(event->GetName(), "bomb_begindefuse") && Shonax.Misc.eventlog[3]) {
- auto userid = event->GetInt("userid");
- if (!userid) {
- return;
- }
- auto userid_id = g_pEngine->GetPlayerForUserID(userid);
- PlayerInfo_s userid_info;
- if (!g_pEngine->GetPlayerInfo(userid_id, &userid_info)) {
- return;
- }
- auto m_player = static_cast< C_BaseEntity * >(g_pEntityList->GetClientEntity(userid_id));
- if (!m_player) {
- return;
- }
- constexpr char * hasdefusekit[2] = { "without defuse kit.","with defuse kit." };
- FEATURES::MISC::InGameLogger::Log log;
- log.color_line.PushBack(("LegendWare"), Color(138, 6, 219, 255));
- log.color_line.PushBack(("-> "), Color(176, 66, 244, 255));
- log.color_line.PushBack(" has began defusing the bomb ", Color(230, 230, 230, 255));
- log.color_line.PushBack(hasdefusekit[event->GetBool("haskit")], Color(176, 66, 244, 255));
- FEATURES::MISC::in_game_logger.AddLog(log);
- }
- if (strstr(event->GetName(), "player_footstep") || strstr(event->GetName(), "player_jump"))
- {
- if (!Shonax.Visuals.SoundEsp)
- return;
- if (!g::pLocalEntity)
- return;
- auto walker = g_pEntityList->GetClientEntity(g_pEngine->GetPlayerForUserID(event->GetInt("userid")));
- if (!walker)
- return;
- if (walker->IsDormant())
- return;
- if (walker)
- {
- if (walker->GetTeam() != g::pLocalEntity->GetTeam())
- sound_logs.push_back(sound_info(walker->GetAbsOrigin(), g_pGlobalVars->curtime, event->GetInt("userid")));
- if (walker == g::pLocalEntity && Shonax.Visuals.LocalSoundEsp)
- sound_logs_local.push_back(sound_info(g::pLocalEntity->GetAbsOrigin(), g_pGlobalVars->curtime, event->GetInt("userid")));
- }
- }
- things(event);
- if (strstr(event->GetName(), "player_death"))
- {
- if (!event)
- return;
- if (!g::pLocalEntity)
- return;
- auto* attacker = (C_BaseEntity*)g_pEntityList->GetClientEntity(g_pEngine->GetPlayerForUserID(event->GetInt("attacker")));
- if (!attacker)
- return;
- if (attacker != g::pLocalEntity)
- return;
- kill = kill + 1;
- killstreak = killstreak + 1;
- if (Shonax.newfeatures.announcments)
- {
- if (Shonax.newfeatures.soundcoolest[0])
- if (Shonax.newfeatures.announcments_female)
- {
- if ((g_pGlobalVars->curtime - lastkilltime) < 5.0f)
- {
- switch (killstreak)
- {
- case 1:
- mciSendString("play C://sound//female//firstblood.wav", NULL, 0, 0); break;
- case 2:
- // mciSendString("play C://sound//female//Double_Kill.wav", NULL, 0, 0); break; female dont have double kill announsments;
- case 3:
- // mciSendString("play C://sound//female//quake_tripplekill.wav", NULL, 0, 0); break; female dont have tripple kill announsments;
- case 4:
- mciSendString("play C://sound//female//multikill.wav", NULL, 0, 0); break;
- case 5:
- // mciSendString("play C://sound//female//MegaKill.wav", NULL, 0, 0); break; female dont have megakill announsments;
- case 6:
- mciSendString("play C://sound//female//ultrakill.wav", NULL, 0, 0); break;
- case 7:
- mciSendString("play C://sound//female//monsterkill.wav", NULL, 0, 0); break;
- case 8:
- mciSendString("play C://sound//female//wickedsick.wav", NULL, 0, 0); break;
- default:
- mciSendString("play C://sound//female//holyshit.wav", NULL, 0, 0);
- break;
- }
- }
- }
- else
- {
- if ((g_pGlobalVars->curtime - lastkilltime) < 5.0f)
- {
- switch (killstreak)
- {
- case 1:
- mciSendString("play C://sound//UT99//firstblood.wav", NULL, 0, 0); break;
- case 2:
- mciSendString("play C://sound//UT2k4//Double_Kill.wav", NULL, 0, 0); break;
- case 3:
- mciSendString("play C://sound//Quake3//quake_tripplekill.wav", NULL, 0, 0); break;
- case 4:
- mciSendString("play C://sound//UT99//multikill.wav", NULL, 0, 0); break;
- case 5:
- mciSendString("play C://sound//UT2k4//MegaKill.wav", NULL, 0, 0); break;
- case 6:
- mciSendString("play C://sound//UT99//ultrakill.wav", NULL, 0, 0); break;
- case 7:
- mciSendString("play C://sound//UT99//monsterkill.wav", NULL, 0, 0); break;
- case 8:
- mciSendString("play C://sound//UT2k4//LudicrousKill.wav", NULL, 0, 0); break;
- default:
- mciSendString("play C://sound//UT2k4//HolyShit.wav", NULL, 0, 0);
- break;
- }
- }
- }
- if (Shonax.newfeatures.soundcoolest[1])
- if (g::pLocalEntity)
- if (g::pLocalEntity->GetActiveWeapon()->IsKnife())
- if (Shonax.newfeatures.announcments_female)
- mciSendString("play C://sound//female//humiliation.wav", NULL, 0, 0);
- else
- mciSendString("play C://sound//Quake3//quake_humiliation.wav", NULL, 0, 0);
- if (Shonax.newfeatures.soundcoolest[2])
- if (g::pLocalEntity)
- {
- bool headshot = event->GetBool("headshot");
- if (headshot) if (Shonax.newfeatures.announcments_female) mciSendString("play C://sound//female//headshot.wav", NULL, 0, 0); else mciSendString("play C://sound//UT99//headshot.wav", NULL, 0, 0);
- }
- if (Shonax.newfeatures.soundcoolest[3])
- {
- if (killstreak > 0)
- {
- if (Shonax.newfeatures.announcments_female)
- {
- switch (killstreak)
- {
- case 5:
- mciSendString("play C://sound//female//killingspree.wav", NULL, 0, 0); break;
- case 10:
- mciSendString("play C://sound//female//rampage.wav", NULL, 0, 0);
- break;
- case 15:
- mciSendString("play C://sound//female//dominating.wav", NULL, 0, 0);
- break;
- case 20:
- mciSendString("play C://sound//female//unstoppable.wav", NULL, 0, 0);
- break;
- default:
- if (killstreak % 5 == 0)
- mciSendString("play C://sound//female//godlike.wav", NULL, 0, 0);
- }
- }
- else
- {
- switch (killstreak)
- {
- case 5:
- mciSendString("play C://sound//UT99//killingspree.wav", NULL, 0, 0); break;
- case 10:
- mciSendString("play C://sound//UT99//rampage.wav", NULL, 0, 0);
- break;
- case 15:
- mciSendString("play C://sound//UT2k4//Dominating.wav", NULL, 0, 0);
- break;
- case 20:
- mciSendString("play C://sound//UT99//unstoppable.wav", NULL, 0, 0);
- break;
- default:
- if (killstreak % 5 == 0)
- mciSendString("play C://sound//UT99//godlike.wav", NULL, 0, 0);
- }
- }
- }
- }
- }
- if (Shonax.Misc.UI)
- GUI.Feed.AddDeath(DeathInfo(event->GetInt("attacker"), event->GetInt("userid"), (char*)event->GetString("weapon"), event->GetInt("headshot")));
- if (Shonax.Visuals.eventkilling)
- {
- /*FEATURES::MISC::InGameLogger::Log log;
- log.color_line.PushBack(("[shonax] "), Color(0, 83, 138, 255));
- if (killstreak == 1)
- log.color_line.PushBack(" FIRSTKILL ", Color(255, 83, 138, 255));
- if (killstreak == 2)
- log.color_line.PushBack(" DOUBLEKILL ", Color(255, 83, 138, 255));
- if (killstreak == 3)
- log.color_line.PushBack(" THRIPLEKILL ", Color(255, 83, 138, 255));
- if (killstreak == 4)
- log.color_line.PushBack(" MULTIKILL ", Color(255, 83, 138, 255));
- if (killstreak == 5)
- log.color_line.PushBack(" RAMPAGE ", Color(255, 83, 138, 255));
- if (killstreak > 5)
- log.color_line.PushBack(" HOLYSHEET ", Color(255, 83, 138, 255));
- FEATURES::MISC::in_game_logger.AddLog(log);*/
- }
- lastkilltime = g_pGlobalVars->curtime;
- PlayerInfo_s player_info;
- g_pEngine->GetPlayerInfo(g_pEngine->GetPlayerForUserID(event->GetInt("userid")), &player_info);
- //change what you want xd
- std::string zalupa1 = "say tap nn dog -> ";
- std::string zalupa2 = player_info.szName;
- std::string zalupa3 = zalupa1 + zalupa2;
- //its not my ofc
- if (Shonax.Misc.trashtalk)
- g_pEngine->ExecuteClientCmd(zalupa3.c_str());
- }
- if (Shonax.Visuals.bullet_tracer)
- bullettracers::get().events(event);
- }
- int C_HookedEvents::GetEventDebugID(void)
- {
- return EVENT_DEBUG_ID_INIT;
- }
- void C_HookedEvents::RegisterSelf()
- {
- g_pEventManager->AddListener(this, "player_footstep", false);
- g_pEventManager->AddListener(this, "player_jump", false);
- g_pEventManager->AddListener(this, "player_falldamage", false);
- g_pEventManager->AddListener(this, "player_hurt", false);
- g_pEventManager->AddListener(this, "item_purchase", false);
- g_pEventManager->AddListener(this, "bomb_beginplant", false);
- g_pEventManager->AddListener(this, "bomb_begindefuse", false);
- g_pEventManager->AddListener(this, "bullet_impact", false);
- g_pEventManager->AddListener(this, "round_prestart", false);
- g_pEventManager->AddListener(this, "round_freeze_end", false);
- g_pEventManager->AddListener(this, "player_death", false);
- g_pEventManager->AddListener(this, "player_say", false);
- }
- void C_HookedEvents::RemoveSelf()
- {
- g_pEventManager->RemoveListener(this);
- }
- void __fastcall Hooks::Hooked_findmdl(void* ecx, void* edx, char* FilePath)
- {
- //static auto original_fn = g_Hooks.pModels->GetOriginal<FindMDL_t>(vtable_indexes::model_cache);
- //for video xd
- return oFindMDL_t->GetTrampoline()(ecx, FilePath);
- }
- void __fastcall Hooks::Hooked_Postscreeneffects(void * thisptr, void * edx, CViewSetup * setup) {
- static auto run_glow = []() -> void
- {
- if (!(g_pEngine->IsInGame() && g_pEngine->IsConnected()) || !g::pLocalEntity) {
- return;
- }
- for (int i = 0; i < g_pGlow->m_GlowObjectDefinitions.Count(); i++)
- {
- if (g_pGlow->m_GlowObjectDefinitions[i].IsUnused() || !g_pGlow->m_GlowObjectDefinitions[i].GetEnt()) {
- continue;
- }
- auto * object = &g_pGlow->m_GlowObjectDefinitions[i];
- auto entity = reinterpret_cast<C_BaseEntity*>(object->GetEnt());
- if (!entity || entity->IsDormant()) {
- continue;
- }
- if (entity == g::pLocalEntity && Shonax.Visuals.localglow && g_Misc.in_tp/*наху нам глоу на себя когда мы не в 3 лице блят*/)
- {
- if (entity->GetClientClass()->ClassID == (int)EClassIds::CCSPlayer)
- {
- object->Set(Shonax.Visuals.glowlocal[0], Shonax.Visuals.glowlocal[1], Shonax.Visuals.glowlocal[2],
- Shonax.Visuals.glowlocal[3],
- Shonax.Visuals.glowlocal[3],
- Shonax.Visuals.glowlocaltype);
- }
- }
- else
- {
- if (Shonax.Visuals.glow)
- {
- float color[4];
- if (!entity
- || !entity->IsAlive()
- || entity->IsDormant()
- || entity->GetTeam() == g::pLocalEntity->GetTeam())
- continue;
- for (int i = 0; i <= 3; i++)
- color[i] = Shonax.Visuals.glowcolor[i];
- if (entity->GetClientClass()->ClassID == (int)EClassIds::CCSPlayer)
- {
- object->Set(color[0], color[1], color[2],
- color[3],
- color[3],
- Shonax.Visuals.glowtype);
- }
- }
- if (Shonax.Visuals.weaponglow)
- {
- if (entity->GetClientClass()->ClassID == (int)EClassIds::CDEagle)
- {
- object->Set(Shonax.Visuals.weaponglowcolor[0], Shonax.Visuals.weaponglowcolor[1], Shonax.Visuals.weaponglowcolor[2],
- Shonax.Visuals.weaponglowcolor[3],
- Shonax.Visuals.weaponglowcolor[3],
- Shonax.Visuals.weaponglowtype);
- }
- }
- }
- }
- };
- //static auto original_fn = g_Hooks.pClientModeHook->GetOriginal<DoPostScreenEffects_t>(vtable_indexes::dopostscreeneffects);
- if (Shonax.Visuals.glow || Shonax.Visuals.localglow || Shonax.Visuals.weaponglow)
- run_glow();
- return oDoPostScreenEffects_t->GetTrampoline()(thisptr, setup);
- }
- static auto CAM_THINK = Utils::FindSignature("client_panorama.dll", "85 C0 75 30 38 86");
- bool __fastcall Hooks::HookedGetBool(void* pConVar, void* edx)
- {
- //static auto original_get_bool = g_Hooks.pSv_cheats->GetOriginal<SvCheatsGetBoolFn>(vtable_indexes::sv_cheats);
- if ((uintptr_t)_ReturnAddress() == CAM_THINK)
- return true;
- return oSvCheatsGetBoolFn->GetTrampoline()(pConVar);
- }
- #include "Features/bulletbeams/BeamInfo.hpp"
- #include "SDK/IVRenderBeam.h"
- void soundesp::draw_circle(Color color, Vector position)
- {
- BeamInfo_t beamInfo;
- beamInfo.m_nType = TE_BEAMRINGPOINT;
- beamInfo.m_pszModelName = "sprites/purplelaser1.vmt";
- beamInfo.m_nModelIndex = g_pModelInfo->GetModelIndex("sprites/purplelaser1.vmt");
- beamInfo.m_pszHaloName = "sprites/purplelaser1.vmt";
- beamInfo.m_nHaloIndex = g_pModelInfo->GetModelIndex("sprites/purplelaser1.vmt");
- beamInfo.m_flHaloScale = 5;
- beamInfo.m_flLife = 2.50f;
- beamInfo.m_flWidth = 12.f;
- beamInfo.m_flFadeLength = 1.0f;
- beamInfo.m_flAmplitude = 0.f;
- beamInfo.m_flRed = color.red;
- beamInfo.m_flGreen = color.green;
- beamInfo.m_flBlue = color.blue;
- beamInfo.m_flBrightness = 255;
- beamInfo.m_flSpeed = 1.f;
- beamInfo.m_nStartFrame = 0;
- beamInfo.m_flFrameRate = 1;
- beamInfo.m_nSegments = 1;
- beamInfo.m_bRenderable = true;
- beamInfo.m_nFlags = 0;
- beamInfo.m_vecCenter = position + Vector(0, 0, 5);
- beamInfo.m_flStartRadius = 1;
- beamInfo.m_flEndRadius = 350;
- auto beam = g_pIViewRenderBeams->CreateBeamRingPoint(beamInfo);
- if (beam) g_pIViewRenderBeams->DrawBeam(beam);
- }
- void soundesp::draw()
- {
- if (!Shonax.Visuals.SoundEsp)
- return;
- if (!g_pEngine->IsInGame() || !g_pEngine->IsConnected())
- return;
- for (unsigned int i = 0; i < sound_logs.size(); i++)
- {
- g_soundesp.draw_circle(Color(Shonax.Visuals.SoundEspColor[0] * 255, Shonax.Visuals.SoundEspColor[1] * 255, Shonax.Visuals.SoundEspColor[2] * 255, Shonax.Visuals.SoundEspColor[3] * 255), sound_logs[i].position);
- if (Shonax.Visuals.LocalSoundEsp)
- g_soundesp.draw_circle(Color(Shonax.Visuals.SoundEspColor[0] * 255, Shonax.Visuals.SoundEspColor[1] * 255, Shonax.Visuals.SoundEspColor[2] * 255, Shonax.Visuals.SoundEspColor[3] * 255), sound_logs[i].position);
- sound_logs.erase(sound_logs.begin() + i);
- }
- if (Shonax.Visuals.LocalSoundEsp)
- {
- for (unsigned int i = 0; i < sound_logs_local.size(); i++)
- {
- g_soundesp.draw_circle(Color(Shonax.Visuals.LocalSoundEspColor[0] * 255, Shonax.Visuals.LocalSoundEspColor[1] * 255, Shonax.Visuals.LocalSoundEspColor[2] * 255, Shonax.Visuals.LocalSoundEspColor[3] * 255), sound_logs_local[i].position);
- if (Shonax.Visuals.LocalSoundEsp)
- g_soundesp.draw_circle(Color(Shonax.Visuals.LocalSoundEspColor[0] * 255, Shonax.Visuals.LocalSoundEspColor[1] * 255, Shonax.Visuals.LocalSoundEspColor[2] * 255, Shonax.Visuals.LocalSoundEspColor[3] * 255), sound_logs_local[i].position);
- sound_logs_local.erase(sound_logs_local.begin() + i);
- }
- }
- }
- float GetTextWitdh(char *text, LPD3DXFONT fnt)
- {
- RECT fontRect = { 0,0,0,0 };
- fnt->DrawText(NULL, text, strlen(text), &fontRect, DT_CALCRECT, D3DCOLOR_XRGB(0, 0, 0));
- return fontRect.right - fontRect.left;
- }
- void DrawStringWithFont(LPD3DXFONT fnt, float x, float y, D3DCOLOR color, char *format, ...)
- {
- char buffer[256];
- RECT fontRect = { (int)x, (int)y, (int)x, (int)y };
- va_list va_argList;
- va_start(va_argList, format);
- wvsprintf(buffer, format, va_argList);
- va_end(va_argList);
- fnt->DrawText(NULL, buffer, strlen(buffer), &fontRect, DT_NOCLIP, color);
- }
- #define D3D_COLOR_BLACK(a) D3DCOLOR_ARGB(a, 0, 0, 0)
- void DamageESP::Draw()
- {
- if (Shonax.Visuals.damageesp || Shonax.Visuals.damagegroup)
- for (int i = 0; i < MAX_FLOATING_TEXTS; i++)
- {
- FloatingText *txt = &floatingTexts[i % MAX_FLOATING_TEXTS];
- if (!txt->valid)
- continue;
- float endTime = txt->startTime + 1.1f;
- if (endTime < g_pGlobalVars->curtime)
- {
- txt->valid = false;
- continue;
- }
- Vector2D screen;
- if (Utils::WorldToScreen(txt->hitPosition, screen))
- {
- float t = 1.0f - (endTime - g_pGlobalVars->curtime) / (endTime - txt->startTime);
- screen.y -= t * (35.0f);
- screen.x -= (float)txt->randomIdx * t * 3.0f;
- if (Shonax.Visuals.damageesp)
- {
- char msg[12];
- sprintf_s(msg, 12, "-%dHP", txt->damage);
- int width = GetTextWitdh(msg, fntVerdana10);
- DrawStringWithFont(fntVerdana10, screen.x - width / 2, screen.y - 11 + 1, D3D_COLOR_BLACK((int)((1.0f - t) * (float)255)), msg);
- DrawStringWithFont(fntVerdana10, screen.x - width / 2, screen.y - 11, D3DCOLOR_ARGB(int(Shonax.Visuals.damageespcolor[3] * 255), int(Shonax.Visuals.damageespcolor[0] * 255), int(Shonax.Visuals.damageespcolor[1] * 255), int(Shonax.Visuals.damageespcolor[2] * 255)), msg);
- }
- if (Shonax.Visuals.damagegroup)
- {
- char msgxd[12];
- sprintf_s(msgxd, 12, GetHitgroupName(gitgrp)); //gitgrp
- int widthxd = GetTextWitdh(msgxd, fntVerdana10);
- DrawStringWithFont(fntVerdana10, screen.x - widthxd / 2, screen.y - 63 + 1, D3D_COLOR_BLACK((int)((1.0f - t) * (float)255)), msgxd);
- DrawStringWithFont(fntVerdana10, screen.x - widthxd / 2, screen.y - 63, D3DCOLOR_ARGB(int(Shonax.Visuals.damagegroupcolor[3] * 255), int(Shonax.Visuals.damagegroupcolor[0] * 255), int(Shonax.Visuals.damagegroupcolor[1] * 255), int(Shonax.Visuals.damagegroupcolor[2] * 255)), msgxd);
- }
- }
- }
- }
- struct Vertex
- {
- float x, y, z, rhw;
- DWORD color;
- };
- #define COL2DWORD(x) (D3DCOLOR_ARGB(x.alpha, x.red, x.green, x.blue))
- void Triangle(SPoint pos1, SPoint pos2, SPoint pos3, Color color, IDirect3DDevice9* pDevice)
- {
- D3DCOLOR dwColor = COL2DWORD(color);
- Vertex vert[4] =
- {
- { float(pos1.x), float(pos1.y), 0.0f, 1.0f, dwColor },
- { float(pos2.x), float(pos2.y), 0.0f, 1.0f, dwColor },
- { float(pos3.x), float(pos3.y), 0.0f, 1.0f, dwColor },
- { float(pos1.x), float(pos1.y), 0.0f, 1.0f, dwColor }
- };
- pDevice->SetTexture(0, nullptr);
- pDevice->SetRenderState(D3DRS_MULTISAMPLEANTIALIAS, FALSE);
- pDevice->DrawPrimitiveUP(D3DPT_LINESTRIP, 3, &vert, sizeof(Vertex));
- pDevice->SetRenderState(D3DRS_MULTISAMPLEANTIALIAS, FALSE);
- }
- void TriangleFilled(SPoint pos1, SPoint pos2, SPoint pos3, Color color, IDirect3DDevice9* pDevice)
- {
- D3DCOLOR dwColor = COL2DWORD(color);
- Vertex vert[3] =
- {
- { float(pos1.x), float(pos1.y), 0.0f, 1.0f, dwColor },
- { float(pos2.x), float(pos2.y), 0.0f, 1.0f, dwColor },
- { float(pos3.x), float(pos3.y), 0.0f, 1.0f, dwColor }
- };
- pDevice->SetTexture(0, nullptr);
- pDevice->SetRenderState(D3DRS_MULTISAMPLEANTIALIAS, FALSE);
- pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 1, &vert, sizeof(Vertex));
- pDevice->SetRenderState(D3DRS_MULTISAMPLEANTIALIAS, FALSE);
- }
- void OffscreenESP(Color colour, IDirect3DDevice9* pDevice)
- {
- if (!g_pEngine->IsInGame() || !g_pEngine->IsConnected())
- return;
- int screen_width, screen_height;
- g_pEngine->GetScreenSize(screen_width, screen_height);
- static bool pulse = true;
- static int alpha = 150;
- const auto screen_center_x = screen_width / 2;
- const auto screen_center_y = screen_height / 2;
- const auto radius = 45;
- const auto size = 26;
- if (g::pLocalEntity == nullptr)
- return;
- if (!g::pLocalEntity->IsAlive())
- return;
- if (pulse)
- {
- alpha += 1;
- if (alpha == 255) pulse = false;
- }
- else
- {
- alpha -= 1;
- if (alpha == 150) pulse = true;
- }
- const auto screenTransform = [](Vector &origin, Vector &screen) -> bool
- {
- static std::uintptr_t pViewMatrix;
- if (!pViewMatrix)
- {
- pViewMatrix = static_cast<std::uintptr_t>(Utils::FindSignature("client_panorama.dll", "0F 10 05 ? ? ? ? 8D 85 ? ? ? ? B9"));
- pViewMatrix += 3;
- pViewMatrix = *reinterpret_cast<std::uintptr_t*>(pViewMatrix);
- pViewMatrix += 176;
- }
- const VMatrix& w2sMatrix = *reinterpret_cast<VMatrix*>(pViewMatrix);
- screen.x = w2sMatrix.m[0][0] * origin.x + w2sMatrix.m[0][1] * origin.y + w2sMatrix.m[0][2] * origin.z + w2sMatrix.m[0][3];
- screen.y = w2sMatrix.m[1][0] * origin.x + w2sMatrix.m[1][1] * origin.y + w2sMatrix.m[1][2] * origin.z + w2sMatrix.m[1][3];
- screen.z = 0.0f;
- float w = w2sMatrix.m[3][0] * origin.x + w2sMatrix.m[3][1] * origin.y + w2sMatrix.m[3][2] * origin.z + w2sMatrix.m[3][3];
- if (w < 0.001f)
- {
- screen.x *= 100000;
- screen.y *= 100000;
- return true;
- }
- float invw = 1.f / w;
- screen.x *= invw;
- screen.y *= invw;
- return false;
- };
- for (auto i = 1; i < g_pEntityList->GetHighestEntityIndex(); i++)
- {
- auto* entity = g_pEntityList->GetClientEntity(i);
- if (!entity)
- return;
- if (!entity->GetClientClass()->ClassID == (int)EClassIds::CCSPlayer)
- continue;
- if (entity->IsDormant())
- continue;
- if (!g::pLocalEntity)
- continue;
- if (entity->GetTeam() == g::pLocalEntity->GetTeam())
- continue;
- Vector screen_point;
- screenTransform(entity->GetOrigin(), screen_point);
- if (!screenTransform(entity->GetOrigin(), screen_point))
- continue;
- if (screen_point.x < 0 || screen_point.y < 0 || screen_point.x > screen_width || screen_point.y > screen_height)
- {
- auto angle = Vector();
- g_Math.VectorAngles_2(
- Vector(screen_center_x - screen_point.x, screen_center_y - screen_point.y, 0), angle);
- const auto angle_yaw_rad = g_Math.deg_2_rad(angle.y + 180.f);
- const auto new_point_x = screen_center_x +
- radius * 8 * cosf(angle_yaw_rad);
- const auto new_point_y = screen_center_y +
- radius * 8 * sinf(angle_yaw_rad);
- std::array<Vector2D, 3> points{
- Vector2D(new_point_x - size / 2, new_point_y - size / 2),
- Vector2D(new_point_x + size / 4, new_point_y),
- Vector2D(new_point_x - size / 2, new_point_y + size / 2)
- };
- g_Math.RotateTriangle(points, angle.y + 180.f);
- TriangleFilled(SPoint(points.at(0).x, points.at(0).y), SPoint(points.at(1).x, points.at(1).y), SPoint(points.at(2).x, points.at(2).y), colour(alpha), pDevice);
- Triangle(SPoint(points.at(0).x, points.at(0).y), SPoint(points.at(1).x, points.at(1).y), SPoint(points.at(2).x, points.at(2).y), colour(alpha), pDevice);
- }
- }
- }
- void ESP::DrawTaserRange()
- {
- if (!g_pEngine->IsConnected() || !g_pEngine->IsInGame())
- return;
- //need more subs
- }
- void Hooks::Init()
- {
- // Get window handle
- while (!(g_Hooks.hCSGOWindow = FindWindowA("Valve001", nullptr)))
- {
- using namespace std::literals::chrono_literals;
- std::this_thread::sleep_for(10ms);
- }
- interfaces::Init(); // Get interfaces
- g_pNetvars = std::make_unique<NetvarTree>();// Get netvars after getting interfaces as we use them
- if (g_Hooks.hCSGOWindow) // Hook WNDProc to capture mouse / keyboard input
- g_Hooks.pOriginalWNDProc = reinterpret_cast<WNDPROC>(SetWindowLongPtr(g_Hooks.hCSGOWindow, GWLP_WNDPROC,
- reinterpret_cast<LONG_PTR>(g_Hooks.WndProc)));
- //dont edit here or gay
- DWORD setupbonesfix;
- DWORD shaderapidx9 = **(DWORD**)(Utils::FindSignature("shaderapidx9.dll", "A1 ?? ?? ?? ?? 50 8B 08 FF 51 0C") + 1);
- if (!Shonax.Visuals.ilovethat)
- setupbonesfix = **(DWORD**)(Utils::FindSignature("client_panorama.dll", "55 8B EC 83 E4 F8 83 EC 18 56 57 8B F9 89 7C 24 0C") + 0x4B);
- auto sv_cheats = g_pCvar->FindVar("sv_cheats");
- // trampoline
- auto& shonaxhook = cContext::GetInstance();
- PVOID* panelhook = *reinterpret_cast<PVOID**>(g_pPanel);
- PVOID* lockcursor = *reinterpret_cast<PVOID**>(g_pSurface);
- PVOID* d3d9 = *reinterpret_cast<PVOID**>(shaderapidx9);
- PVOID* inputkeysystem = *reinterpret_cast<PVOID**>(g_ppInputSystem);
- PVOID* svcheats = *reinterpret_cast<PVOID**>(sv_cheats);
- PVOID* clientdll = *reinterpret_cast<PVOID**>(g_pClientDll);
- PVOID* rankchanger = *reinterpret_cast<PVOID**>(g_SteamGameCoordinator);
- PVOID* clientmode = *reinterpret_cast<PVOID**>(g_pClientMode);
- PVOID* modelrender = *reinterpret_cast<PVOID**>(g_pModelRender);
- PVOID* eventmanager = *reinterpret_cast<PVOID**>(g_pEventManager);
- PVOID* modelchanger = *reinterpret_cast<PVOID**>(g_pModelCache);
- //hooking shonax
- shonaxhook.ApplyDetour<Hooks::PaintTraverse_t>(static_cast<Hooks::PaintTraverse_t>(panelhook[vtable_indexes::paint]), reinterpret_cast<Hooks::PaintTraverse_t>(Hooks::PaintTraverse), &oPaintTraverse_t);
- shonaxhook.ApplyDetour<Hooks::LockCursor_t>(static_cast<Hooks::LockCursor_t>(lockcursor[vtable_indexes::lockCursor]), reinterpret_cast<Hooks::LockCursor_t>(Hooks::LockCursor), &oLockCursor_t);
- shonaxhook.ApplyDetour<Hooks::EndSceneFn>(static_cast<Hooks::EndSceneFn>(d3d9[vtable_indexes::d3d9menu]), reinterpret_cast<Hooks::EndSceneFn>(Hooks::Hooked_EndScene), &oEndSceneFn);
- shonaxhook.ApplyDetour<Hooks::EndSceneResetFn>(static_cast<Hooks::EndSceneResetFn>(d3d9[vtable_indexes::d3d9reset]), reinterpret_cast<Hooks::EndSceneResetFn>(Hooks::Hooked_EndScene_Reset), &oEndSceneResetFn);
- shonaxhook.ApplyDetour<Hooks::D3D9FEATURES>(static_cast<Hooks::D3D9FEATURES>(d3d9[vtable_indexes::d3d9features]), reinterpret_cast<Hooks::D3D9FEATURES>(Hooks::Hooked_features), &oD3D9FEATURES);
- shonaxhook.ApplyDetour<Hooks::SetMouseCodeState_t>(static_cast<Hooks::SetMouseCodeState_t>(inputkeysystem[vtable_indexes::mousecode]), reinterpret_cast<Hooks::SetMouseCodeState_t>(Hooks::SetMouseCodeState_h), &oSetMouseCodeState_t);
- shonaxhook.ApplyDetour<Hooks::SetKeyCodeState_t>(static_cast<Hooks::SetKeyCodeState_t>(inputkeysystem[vtable_indexes::keycode]), reinterpret_cast<Hooks::SetKeyCodeState_t>(Hooks::SetKeyCodeState_h), &oSetKeyCodeState_t);
- shonaxhook.ApplyDetour<Hooks::SvCheatsGetBoolFn>(static_cast<Hooks::SvCheatsGetBoolFn>(svcheats[vtable_indexes::sv_cheats]), reinterpret_cast<Hooks::SvCheatsGetBoolFn>(Hooks::HookedGetBool), &oSvCheatsGetBoolFn);
- shonaxhook.ApplyDetour<Hooks::FrameStageNotify_t>(static_cast<Hooks::FrameStageNotify_t>(clientdll[vtable_indexes::frameStage]), reinterpret_cast<Hooks::FrameStageNotify_t>(Hooks::FrameStageNotify), &oFrameStageNotify_t);
- shonaxhook.ApplyDetour<Hooks::GCSendMessage>(static_cast<Hooks::GCSendMessage>(rankchanger[vtable_indexes::send_message]), reinterpret_cast<Hooks::GCSendMessage>(hkGCSendMessage), &oGCSendMessage);
- shonaxhook.ApplyDetour<Hooks::GCRetrieveMessage>(static_cast<Hooks::GCRetrieveMessage>(rankchanger[vtable_indexes::retrieve_message]), reinterpret_cast<Hooks::GCRetrieveMessage>(hkGCRetrieveMessage), &oGCRetrieveMessage);
- shonaxhook.ApplyDetour<Hooks::CreateMove_t>(static_cast<Hooks::CreateMove_t>(clientmode[vtable_indexes::createMove]), reinterpret_cast<Hooks::CreateMove_t>(Hooks::CreateMove), &oCreateMove_t);
- shonaxhook.ApplyDetour<Hooks::OverrideView_t>(static_cast<Hooks::OverrideView_t>(clientmode[vtable_indexes::view]), reinterpret_cast<Hooks::OverrideView_t>(Hooks::OverrideView), &oOverrideView_t);
- shonaxhook.ApplyDetour<Hooks::DoPostScreenEffects_t>(static_cast<Hooks::DoPostScreenEffects_t>(clientmode[vtable_indexes::dopostscreeneffects]), reinterpret_cast<Hooks::DoPostScreenEffects_t>(Hooks::Hooked_Postscreeneffects), &oDoPostScreenEffects_t);
- shonaxhook.ApplyDetour<Hooks::DrawModelExecute_t>(static_cast<Hooks::DrawModelExecute_t>(modelrender[vtable_indexes::dme]), reinterpret_cast<Hooks::DrawModelExecute_t>(Hooks::DrawModelExecute), &oDrawModelExecute_t);
- shonaxhook.ApplyDetour<Hooks::FireEventClientSide>(static_cast<Hooks::FireEventClientSide>(eventmanager[vtable_indexes::event_scene]), reinterpret_cast<Hooks::FireEventClientSide>(Hooks::Hooked_FireEventClientSide), &oFireEventClientSide);
- shonaxhook.ApplyDetour<Hooks::FindMDL_t>(static_cast<Hooks::FindMDL_t>(modelchanger[vtable_indexes::model_cache]), reinterpret_cast<Hooks::FindMDL_t>(Hooks::Hooked_findmdl), &oFindMDL_t);
- shonaxhook.ApplyDetour<Hooks::DispatchUserMessageFn>(static_cast<Hooks::DispatchUserMessageFn>(clientdll[38]), reinterpret_cast<Hooks::DispatchUserMessageFn>(hkDispatchUserMessage), &oDispatchUserMessageFn);
- //hkDispatchUserMessage
- setviewmovelscallback();
- hooked_events.RegisterSelf();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement