├── Dainsleif ├── pch.cpp ├── Vector.cpp ├── Hacks │ ├── AntiRecoil.h │ ├── Triggerbot.h │ ├── AntiAFK.h │ ├── Bunnyhop.h │ ├── MinimapHack.cpp │ ├── MinimapHack.h │ ├── Aimbot.h │ ├── Bunnyhop.cpp │ ├── Glow.h │ ├── Esp.h │ ├── AntiAFK.cpp │ ├── Glow.cpp │ ├── Triggerbot.cpp │ ├── AntiRecoil.cpp │ ├── Aimbot.cpp │ └── Esp.cpp ├── Interfaces │ ├── IBaseClientDll.h │ ├── ISurface.h │ ├── IVEngineClient.h │ ├── CInterfaceList.cpp │ ├── CInput.h │ ├── CInterfaceList.h │ └── IClientModeShared.h ├── Hook │ ├── Hooks.h │ ├── ImGuiTheme.h │ ├── ControlCursor.h │ ├── GraphicHook.h │ ├── DrawGUI.h │ ├── ControlCursor.cpp │ ├── Hooks.cpp │ ├── ImGuiTheme.cpp │ ├── GraphicHook.cpp │ └── DrawGUI.cpp ├── Weapon.cpp ├── Modules.h ├── Save │ ├── TabStateToml.h │ ├── SettingsToml.h │ ├── OffsetsToml.h │ ├── TabStateToml.cpp │ ├── SettingsToml.cpp │ └── OffsetsToml.cpp ├── Modules.cpp ├── PatternScanner.h ├── pch.h ├── Vector.h ├── Entity.h ├── DefaultSettings.h ├── Weapon.h ├── Offsets.cpp ├── Entity.cpp ├── Offsets.h ├── dllmain.h ├── Player.h ├── Utils.h ├── PatternScanner.cpp ├── Player.cpp ├── dllmain.cpp └── ClientClass.h ├── compile.bat ├── .gitattributes ├── .gitmodules ├── Dependencies └── toml11 │ ├── toml │ ├── from.hpp │ ├── into.hpp │ ├── storage.hpp │ ├── exception.hpp │ ├── color.hpp │ ├── utility.hpp │ ├── literal.hpp │ ├── types.hpp │ ├── string.hpp │ ├── source_location.hpp │ ├── combinator.hpp │ ├── traits.hpp │ ├── lexer.hpp │ └── region.hpp │ └── toml.hpp ├── LICENSE ├── .all-contributorsrc ├── CMakeLists.txt ├── README_jp.md ├── .gitignore └── README.md /Dainsleif/pch.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | -------------------------------------------------------------------------------- /Dainsleif/Vector.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "Vector.h" -------------------------------------------------------------------------------- /Dainsleif/Hacks/AntiRecoil.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace AntiRecoil { 4 | void Run(); 5 | } 6 | -------------------------------------------------------------------------------- /compile.bat: -------------------------------------------------------------------------------- 1 | mkdir build 2 | cd build 3 | cmake .. -A Win32 4 | cmake --build . 5 | dir debug 6 | cd .. -------------------------------------------------------------------------------- /Dainsleif/Interfaces/IBaseClientDll.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class IBaseClientDll 4 | { 5 | public: 6 | 7 | }; 8 | -------------------------------------------------------------------------------- /Dainsleif/Hook/Hooks.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Hooks 4 | { 5 | void Initialize(); 6 | void Restore(); 7 | } -------------------------------------------------------------------------------- /Dainsleif/Hacks/Triggerbot.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../Player.h" 3 | 4 | namespace Triggerbot { 5 | void Run(); 6 | } 7 | -------------------------------------------------------------------------------- /Dainsleif/Hacks/AntiAFK.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace AntiAFK 4 | { 5 | void Run(bool *bAntiAFK); 6 | void MakeMeaninglessMoves(); 7 | } -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.lib filter=lfs diff=lfs merge=lfs -text 2 | *.dll filter=lfs diff=lfs merge=lfs -text 3 | *.pdb filter=lfs diff=lfs merge=lfs -text 4 | -------------------------------------------------------------------------------- /Dainsleif/Hook/ImGuiTheme.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by PC on 2020/07/31. 3 | // 4 | 5 | #include "imgui.h" 6 | 7 | void LoadTheme(); 8 | void LoadFont(ImGuiIO io); -------------------------------------------------------------------------------- /Dainsleif/Weapon.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "Weapon.h" 3 | 4 | WeaponID Weapon::GetWeaponID() 5 | { 6 | return ReadValue(m_iItemDefinitionIndex); 7 | } -------------------------------------------------------------------------------- /Dainsleif/Hook/ControlCursor.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../Interfaces/ISurface.h" 4 | 5 | using tLockCursor = void(__thiscall*) ( ISurface* ); 6 | 7 | void HookLockCursor ( ); 8 | -------------------------------------------------------------------------------- /Dainsleif/Hacks/Bunnyhop.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../pch.h" 3 | #include "../Player.h" 4 | #include "../dllmain.h" 5 | 6 | namespace Bhop 7 | { 8 | void Run(); 9 | void ForceJump(); 10 | } -------------------------------------------------------------------------------- /Dainsleif/Interfaces/ISurface.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../Utils.h" 3 | 4 | class ISurface 5 | { 6 | public: 7 | CALL_VFUNC ( 66, UnlockCursor(), void(__thiscall*)(ISurface*) ) ( ) 8 | }; 9 | -------------------------------------------------------------------------------- /Dainsleif/Modules.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Modules 5 | { 6 | extern uintptr_t client; 7 | extern uintptr_t engine; 8 | 9 | void Initialize(); 10 | } -------------------------------------------------------------------------------- /Dainsleif/Hacks/MinimapHack.cpp: -------------------------------------------------------------------------------- 1 | #include "MinimapHack.h" 2 | 3 | void Minimap::Run(std::vector playerList) { 4 | for (auto& player : playerList) { 5 | player->WriteValue(m_bSpotted, true); 6 | } 7 | } -------------------------------------------------------------------------------- /Dainsleif/Interfaces/IVEngineClient.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../Utils.h" 4 | 5 | class IVEngineClient 6 | { 7 | public: 8 | CALL_VFUNC ( 196, IsActiveApp(), bool(__thiscall*)(IVEngineClient*) ) ( ); 9 | }; 10 | -------------------------------------------------------------------------------- /Dainsleif/Hacks/MinimapHack.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../pch.h" 3 | #include "../Player.h" 4 | 5 | namespace Minimap 6 | { 7 | void Run(std::vector playerList); 8 | void Stop(std::vector playerList); 9 | } -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "Dependencies/minhook"] 2 | path = Dependencies/minhook 3 | url = https://github.com/TsudaKageyu/minhook.git 4 | [submodule "Dependencies/imgui"] 5 | path = Dependencies/imgui 6 | url = https://github.com/ocornut/imgui.git 7 | -------------------------------------------------------------------------------- /Dainsleif/Save/TabStateToml.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../Hook/GraphicHook.h" 3 | #include "../pch.h" 4 | #include "../dllmain.h" 5 | 6 | namespace TabStateToml { 7 | void Save(std::string& filename); 8 | void Fetch(std::string& filename); 9 | } -------------------------------------------------------------------------------- /Dainsleif/Hacks/Aimbot.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../pch.h" 4 | #include "../Player.h" 5 | 6 | namespace Aimbot 7 | { 8 | //AimBot lets local player aim at enemy's head with full precision. 9 | void Run(std::vector playerList); 10 | } -------------------------------------------------------------------------------- /Dainsleif/Save/SettingsToml.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "../pch.h" 4 | #include "../PatternScanner.h" 5 | #include "../dllmain.h" 6 | #include "../Hook/GraphicHook.h" 7 | 8 | namespace SettingsToml { 9 | void Fetch(std::string& filename); 10 | void Save(std::string& filename); 11 | } -------------------------------------------------------------------------------- /Dainsleif/Modules.cpp: -------------------------------------------------------------------------------- 1 | #include "Modules.h" 2 | #include 3 | 4 | namespace Modules 5 | { 6 | uintptr_t client; 7 | uintptr_t engine; 8 | 9 | void Initialize() 10 | { 11 | client = reinterpret_cast(GetModuleHandle("client.dll")); 12 | engine = reinterpret_cast(GetModuleHandle("engine.dll")); 13 | } 14 | } -------------------------------------------------------------------------------- /Dainsleif/Save/OffsetsToml.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../pch.h" 3 | #include 4 | #include 5 | #include "SettingsToml.h" 6 | #include "../PatternScanner.h" 7 | 8 | namespace OffsetsToml { 9 | std::map Fetch(std::string& filename); 10 | void Update(std::string& filename); 11 | void Initialize(std::string& filename); 12 | } 13 | -------------------------------------------------------------------------------- /Dainsleif/Hacks/Bunnyhop.cpp: -------------------------------------------------------------------------------- 1 | #include "Bunnyhop.h" 2 | 3 | void Bhop::ForceJump() 4 | { 5 | auto* forceJump = reinterpret_cast(Modules::client + dwForceJump); 6 | *forceJump = 6; 7 | } 8 | 9 | void Bhop::Run() 10 | { 11 | Player* localPlayer = Player::GetLocalPlayer(); 12 | uintptr_t flags = localPlayer->GetFlags(); 13 | if (flags & (1 << 0)) 14 | { 15 | Bhop::ForceJump(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Dainsleif/Hook/GraphicHook.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../pch.h" 3 | #include "ImGuiTheme.h" 4 | #include "GraphicHook.h" 5 | #include "DrawGUI.h" 6 | #include 7 | 8 | namespace HackFlags { 9 | extern bool bEsp, bLineOverlay, bRectOverlay; 10 | } 11 | 12 | struct WindowSize { 13 | int w; 14 | int h; 15 | }; 16 | 17 | void InitializeGraphicHook(); 18 | void ShutDownGraphicHook(); 19 | 20 | extern std::map visibleHacks; -------------------------------------------------------------------------------- /Dependencies/toml11/toml/from.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Toru Niina 2019. 2 | // Distributed under the MIT License. 3 | #ifndef TOML11_FROM_HPP 4 | #define TOML11_FROM_HPP 5 | #include "traits.hpp" 6 | 7 | namespace toml 8 | { 9 | 10 | template 11 | struct from; 12 | // { 13 | // static T from_toml(const toml::value& v) 14 | // { 15 | // // User-defined conversions ... 16 | // } 17 | // }; 18 | 19 | } // toml 20 | #endif // TOML11_FROM_HPP 21 | -------------------------------------------------------------------------------- /Dependencies/toml11/toml/into.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Toru Niina 2019. 2 | // Distributed under the MIT License. 3 | #ifndef TOML11_INTO_HPP 4 | #define TOML11_INTO_HPP 5 | #include "traits.hpp" 6 | 7 | namespace toml 8 | { 9 | 10 | template 11 | struct into; 12 | // { 13 | // static toml::value into_toml(const T& user_defined_type) 14 | // { 15 | // // User-defined conversions ... 16 | // } 17 | // }; 18 | 19 | } // toml 20 | #endif // TOML11_INTO_HPP 21 | -------------------------------------------------------------------------------- /Dainsleif/Hook/DrawGUI.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | enum Hack_label { 7 | ALL, 8 | AIMBOT, 9 | GLOWHACK, 10 | ANTIRECOIL, 11 | TRIGGERBOT, 12 | BUNNYHOP, 13 | ANTIAFK, 14 | FOV, 15 | ESP, 16 | MINIMAPHACK 17 | }; 18 | 19 | void ShowMenuBar(std::map& visibleHacks); 20 | void ShowTabMenu(std::map& visibleHacks); 21 | void HelpMarker(const char* title, const std::string& desc); 22 | -------------------------------------------------------------------------------- /Dainsleif/PatternScanner.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | class PatternScanner { 8 | char* moduleName; 9 | const char* pattern; 10 | int offset; 11 | 12 | //FindPattern basically find passed pattern and return the 4 bytes address. 13 | std::optional FindPattern(); 14 | public: 15 | PatternScanner(char* moduleName, const char* pattern, int offset) 16 | : moduleName(moduleName), pattern(pattern), offset(offset) 17 | { 18 | } 19 | 20 | uintptr_t CalculateOffset(uintptr_t base, int extra); 21 | }; -------------------------------------------------------------------------------- /Dainsleif/pch.h: -------------------------------------------------------------------------------- 1 | #ifndef PCH_H 2 | #define PCH_H 3 | 4 | //standard library 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | 17 | //my header 18 | #include "Hook/ImGuiTheme.h" 19 | #include "Vector.h" 20 | #include "DefaultSettings.h" 21 | #include "Offsets.h" 22 | #include "Modules.h" 23 | #include "Utils.h" 24 | 25 | //external library 26 | #include "imgui.h" 27 | #include "imgui_impl_dx9.h" 28 | #include "imgui_impl_win32.h" 29 | #include "toml.hpp" 30 | 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /Dainsleif/Hook/ControlCursor.cpp: -------------------------------------------------------------------------------- 1 | #include "ControlCursor.h" 2 | 3 | #include "../Interfaces/CInterfaceList.h" 4 | #include "../dllmain.h" 5 | 6 | tLockCursor oLockCursor; 7 | 8 | void __fastcall hLockCursor ( ISurface* surface, uintptr_t edx ) 9 | { 10 | if ( g_ShowMenu ) 11 | { 12 | g_csgo.surface->UnlockCursor ( ); 13 | return; 14 | } 15 | oLockCursor ( g_csgo.surface ); 16 | } 17 | 18 | void HookLockCursor ( ) 19 | { 20 | void* lockCursor = Utils::GetVirtualFunction(g_csgo.surface, 67); 21 | if (MH_CreateHookEx(lockCursor, &hLockCursor, &oLockCursor) != MH_OK) 22 | { 23 | throw std::runtime_error("Failed to hook LockCursor!"); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Dainsleif/Hacks/Glow.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../Player.h" 3 | 4 | namespace Glow { 5 | void Run(Player* player); 6 | } 7 | 8 | struct GlowObject { 9 | int m_nNextFreeSlot; 10 | Entity* m_pEntity; 11 | float r; 12 | float g; 13 | float b; 14 | float a; 15 | bool m_bGlowAlphaCappedByRenderAlpha; 16 | std::byte pad0[0x3]; 17 | float m_flGlowAlphaFunctionOfMaxVelocity; 18 | float m_flGlowAlphaMax; 19 | float m_flGlowPulseOverdrive; 20 | bool m_bRenderWhenOccluded; 21 | bool m_bRenderWhenUnoccluded; 22 | bool m_bFullBloomRender; 23 | std::byte pad1[0x1]; 24 | int m_nFullBloomStencilTestValue; 25 | int m_nRenderStyle; 26 | int m_nSplitScreenSlot; 27 | }; -------------------------------------------------------------------------------- /Dainsleif/Vector.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class Vector3 { 4 | public: 5 | float x, y, z; 6 | 7 | Vector3& operator+(Vector3 arg) 8 | { 9 | x += arg.x; 10 | y += arg.y; 11 | z += arg.z; 12 | return *this; 13 | } 14 | 15 | Vector3& operator-(Vector3 arg) 16 | { 17 | x -= arg.x; 18 | y -= arg.y; 19 | z -= arg.z; 20 | return *this; 21 | } 22 | 23 | Vector3& operator*(float arg) 24 | { 25 | x *= arg; 26 | y *= arg; 27 | z *= arg; 28 | return *this; 29 | } 30 | 31 | void Normalize() { 32 | while (y > 180) 33 | y -= 360; 34 | while (y < -180) 35 | y += 360; 36 | 37 | if (x > 89.f) 38 | x = 89.f; 39 | else if (x < -89.f) 40 | x = -89.f; 41 | } 42 | }; 43 | 44 | class Vector2 { 45 | public: 46 | float x, y; 47 | }; 48 | 49 | class Vector4 { 50 | public: 51 | float x, y, z, w; 52 | }; -------------------------------------------------------------------------------- /Dainsleif/Entity.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "pch.h" 3 | #include "ClientClass.h" 4 | 5 | class Entity 6 | { 7 | public: 8 | static Entity* GetByIndex(int index); 9 | 10 | static std::vector GetAll(); 11 | 12 | template 13 | T ReadValue(std::ptrdiff_t offset) 14 | { 15 | return *reinterpret_cast(this + offset); 16 | } 17 | 18 | template 19 | void WriteValue(std::ptrdiff_t offset, T value) 20 | { 21 | *reinterpret_cast(this + offset) = value; 22 | } 23 | 24 | template 25 | T Cast() 26 | { 27 | return reinterpret_cast(this); 28 | } 29 | 30 | void* GetClientNetworkable(); 31 | ClientClass* GetClientClass(); 32 | bool IsDormant(); 33 | }; 34 | 35 | struct EntInfo 36 | { 37 | Entity* m_pEntity; 38 | int m_SerialNumber; 39 | EntInfo* m_pPrev; 40 | EntInfo* m_pNext; 41 | }; -------------------------------------------------------------------------------- /Dainsleif/Interfaces/CInterfaceList.cpp: -------------------------------------------------------------------------------- 1 | #include "CInterfaceList.h" 2 | 3 | CInterfaceList g_csgo; 4 | 5 | void CInterfaceList::Initialize ( ) 6 | { 7 | const fnCreateInterface clientFactory = GetModuleFactory(GetModuleHandleA("client.dll")); 8 | const fnCreateInterface engineFactory = GetModuleFactory ( GetModuleHandleA ( "engine.dll" ) ); 9 | const fnCreateInterface surfaceFactory = GetModuleFactory ( GetModuleHandleA ( "vguimatsurface.dll" ) ); 10 | 11 | client = GetInterface(clientFactory, "VClient018"); 12 | clientMode = **reinterpret_cast(Utils::GetVirtualFunction(client, 10) + 0x5); //CHLClient::HudProcessInput + 0x5 13 | engine = GetInterface< IVEngineClient > ( engineFactory, "VEngineClient014" ); 14 | surface = GetInterface< ISurface > ( surfaceFactory, "VGUI_Surface031" ); 15 | 16 | #if _DEBUG 17 | PrintInterfaces ( ); 18 | #endif 19 | } 20 | -------------------------------------------------------------------------------- /Dainsleif/DefaultSettings.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "imgui.h" 3 | 4 | 5 | namespace Default { 6 | //Aimbot 7 | const bool bAimbot = false; 8 | const float aimSmoothness = 0.2f; 9 | const float range = 10.f; 10 | 11 | //Glow hack 12 | const bool bGlowhack = false; 13 | const ImVec4 enemyGlowColor = ImVec4(0.8f,0.1f,0.15f,1.f); 14 | const ImVec4 localGlowColor = ImVec4(0.f,0.255f,0.7f,1.f); 15 | 16 | //Anti Recoil 17 | const bool bAntiRecoil = false; 18 | 19 | //Trigger bot 20 | const bool bTriggerBot = false; 21 | 22 | //Bunnyhop 23 | const bool bBunnyhop = false; 24 | 25 | //FOV 26 | const int fov = 90; 27 | 28 | //Anti AFK 29 | const bool bAntiAFK = false; 30 | 31 | //ESP 32 | const bool bEsp = false; 33 | const bool bLineOverlay = false; 34 | const bool bRectOverlay = false; 35 | 36 | //Minimap hack 37 | const bool bMinimapHack = false; 38 | } -------------------------------------------------------------------------------- /Dainsleif/Weapon.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "pch.h" 3 | #include "Entity.h" 4 | 5 | enum WeaponID { 6 | NULLWEAPON = 0, 7 | KNIFE = 59, 8 | C4 = 49, 9 | 10 | HG_GLOCK = 4, 11 | HG_DUAL_BERETTAS = 2, 12 | HG_P250 = 36, 13 | HG_TEC9 = 30, 14 | HG_DESERT_EAGLE = 1, 15 | 16 | SG_NOVA = 35, 17 | SG_XM1014 = 25, 18 | SG_SAWED_OFF = 29, 19 | 20 | HEAVY_M249 = 14, 21 | HEAVY_NEGEV = 28, 22 | 23 | SMG_MAC10 = 17, 24 | SMG_MP7 = 33, 25 | SMG_UMP45 = 24, 26 | SMG_P90 = 19, 27 | SMG_PP_BIZON = 26, 28 | 29 | AR_GALIL = 13, 30 | AR_AK47 = 7, 31 | AR_SG553 = 39, 32 | 33 | SR_SSG08 = 40, 34 | SR_AWP = 9, 35 | SR_G3SG1 = 11, 36 | 37 | GN_MOLOTOV = 46, 38 | GN_DECOY = 47, 39 | GN_FLASH_ = 43, 40 | GN_HE = 44, 41 | GN_SMOKE = 45, 42 | 43 | ZEUS_X27 = 31, 44 | }; 45 | 46 | class Weapon : public Entity 47 | { 48 | public: 49 | WeaponID GetWeaponID(); 50 | }; -------------------------------------------------------------------------------- /Dainsleif/Offsets.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | uintptr_t dwClientState; 4 | uintptr_t dwClientState_State; 5 | uintptr_t dwClientState_MaxPlayer; 6 | uintptr_t dwClientState_ViewAngles; 7 | uintptr_t dwppDirect3DDevice9; 8 | uintptr_t dwEntityList; 9 | uintptr_t dwLocalPlayer; 10 | uintptr_t dwGlowObjectManager; 11 | uintptr_t dwForceAttack; 12 | uintptr_t dwForceForward; 13 | uintptr_t dwForceBackward; 14 | uintptr_t dwForceRight; 15 | uintptr_t dwForceLeft; 16 | uintptr_t dwForceJump; 17 | uintptr_t dwViewMatrix; 18 | 19 | uintptr_t m_vecOrigin; 20 | uintptr_t m_iHealth; 21 | uintptr_t m_fFlags; 22 | uintptr_t m_vecViewOffset; 23 | uintptr_t m_dwBoneMatrix; 24 | uintptr_t m_iTeamNum; 25 | uintptr_t m_iGlowIndex; 26 | uintptr_t m_aimPunchAngle; 27 | uintptr_t m_iShotsFired; 28 | uintptr_t m_iCrosshairId; 29 | uintptr_t m_iFOV; 30 | uintptr_t m_bDormant; 31 | uintptr_t m_hActiveWeapon; 32 | uintptr_t m_iItemDefinitionIndex; 33 | uintptr_t m_bSpotted; 34 | uintptr_t m_bIsScoped; 35 | -------------------------------------------------------------------------------- /Dainsleif/Hacks/Esp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../pch.h" 3 | #include "../Player.h" 4 | #include "../Hook/GraphicHook.h" 5 | #include 6 | #include 7 | 8 | std::optional WorldToScreen(Vector3 entPos, WindowSize& windowSize); 9 | class Esp { 10 | const int& localTeamNum; 11 | std::vector& playerList; 12 | IDirect3DDevice9& pDevice; 13 | WindowSize& windowSize; 14 | 15 | void DrawOutLineRect(Vector2 top, Vector2 bottom, int thickness, D3DCOLOR color); 16 | void DrawLine(int x1, int y1, int x2, int y2, int thickness, D3DCOLOR color); 17 | void DrawFilledRect(Vector2 top, Vector2 bottom, D3DCOLOR color); 18 | 19 | public: 20 | Esp(const int& localTeamNum, std::vector& playerList, IDirect3DDevice9& pDevice, WindowSize& windowSize) 21 | : localTeamNum(localTeamNum), playerList(playerList), pDevice(pDevice), windowSize(windowSize){} 22 | 23 | void LineOverlay(); 24 | void RectangleOverlay(); 25 | void HealthOverlay(); 26 | }; 27 | -------------------------------------------------------------------------------- /Dainsleif/Entity.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "Entity.h" 3 | 4 | Entity* Entity::GetByIndex(int index) 5 | { 6 | return *reinterpret_cast(Modules::client + dwEntityList + sizeof(EntInfo) * index); 7 | } 8 | 9 | std::vector Entity::GetAll() 10 | { 11 | std::vector allEntities; 12 | for (EntInfo* entInfo = reinterpret_cast(Modules::client + dwEntityList); entInfo; entInfo = entInfo->m_pNext) 13 | { 14 | if (entInfo->m_pEntity == nullptr) 15 | { 16 | continue; 17 | } 18 | 19 | allEntities.push_back(entInfo->m_pEntity); 20 | 21 | if (entInfo->m_pNext == nullptr || entInfo->m_pNext == entInfo->m_pPrev) 22 | { 23 | break; 24 | } 25 | } 26 | return allEntities; 27 | } 28 | 29 | void* Entity::GetClientNetworkable() 30 | { 31 | return this + 0x8; 32 | } 33 | 34 | ClientClass* Entity::GetClientClass() 35 | { 36 | return Utils::CallVirtualFunction(GetClientNetworkable(), 2); 37 | } 38 | 39 | bool Entity::IsDormant() 40 | { 41 | return ReadValue(m_bDormant); 42 | } -------------------------------------------------------------------------------- /Dainsleif/Interfaces/CInput.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../Utils.h" 3 | #include "../Vector.h" 4 | 5 | class CUserCmd; 6 | struct CVerifiedUserCmd; 7 | 8 | class CInput 9 | { 10 | public: 11 | void* vTable; 12 | bool trackIrAvailable; 13 | bool mouseInitialized; 14 | bool mouseActive; 15 | bool joyStickAdvancedInit; 16 | char m_pad_0x08[ 0x2C ]; 17 | void* keys; 18 | char m_pad_0x38[ 0x64 ]; 19 | int m_pad_0x41; 20 | int m_pad_0x42; 21 | int m_pad_0x43; 22 | int m_pad_0x44; 23 | bool cameraInterceptingMouse; 24 | bool cameraInThirdperson; 25 | bool cameraMovingWithMouse; 26 | Vector3 cameraOffset; 27 | bool cameraDistanceMove; 28 | int cameraOldX; 29 | int cameraOldY; 30 | int cameraX; 31 | int cameraY; 32 | bool cameraIsOrthographic; 33 | Vector3 previousViewAngles; 34 | Vector3 previousViewAnglesTilt; 35 | float lastForwardMove; 36 | int clearInputState; 37 | CUserCmd* userCommands; 38 | CVerifiedUserCmd* verifiedUserCommands; 39 | 40 | CALL_VFUNC(39, ResetInputState(), void(__thiscall*)(CInput*)) () 41 | }; 42 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 S3pt3mb3r 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Dainsleif/Offsets.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern uintptr_t dwppDirect3DDevice9; 4 | extern uintptr_t dwEntityList; 5 | extern uintptr_t dwLocalPlayer; 6 | extern uintptr_t dwGlowObjectManager; 7 | extern uintptr_t dwForceAttack; 8 | extern uintptr_t dwForceForward; 9 | extern uintptr_t dwForceBackward; 10 | extern uintptr_t dwForceRight; 11 | extern uintptr_t dwForceLeft; 12 | extern uintptr_t dwForceJump; 13 | extern uintptr_t dwViewMatrix; 14 | 15 | extern uintptr_t m_vecOrigin; 16 | extern uintptr_t m_iHealth; 17 | extern uintptr_t m_fFlags; 18 | extern uintptr_t m_vecViewOffset; 19 | extern uintptr_t m_dwBoneMatrix; 20 | extern uintptr_t m_iTeamNum; 21 | extern uintptr_t m_iGlowIndex; 22 | extern uintptr_t m_aimPunchAngle; 23 | extern uintptr_t m_iShotsFired; 24 | extern uintptr_t m_iCrosshairId; 25 | extern uintptr_t m_iFOV; 26 | extern uintptr_t m_bDormant; 27 | extern uintptr_t m_hActiveWeapon; 28 | extern uintptr_t m_iItemDefinitionIndex; 29 | extern uintptr_t dwClientState; 30 | extern uintptr_t dwClientState_State; 31 | extern uintptr_t dwClientState_MaxPlayer; 32 | extern uintptr_t dwClientState_ViewAngles; 33 | extern uintptr_t m_bSpotted; 34 | extern uintptr_t m_bIsScoped; 35 | -------------------------------------------------------------------------------- /Dainsleif/Save/TabStateToml.cpp: -------------------------------------------------------------------------------- 1 | #include "TabStateToml.h" 2 | 3 | //When you add new tab, modify visibleHacks in GraphicHook.cpp 4 | void TabStateToml::Save(std::string& filename) 5 | { 6 | const toml::value data = visibleHacks; 7 | std::ofstream file; 8 | file.open(filename, std::ios::out); 9 | file << data; 10 | file.close(); 11 | } 12 | 13 | void TabStateToml::Fetch(std::string& filename) 14 | { 15 | auto prevTabState = toml::parse(filename); 16 | TabFlags::t_aimBot = toml::find_or(prevTabState, "Aim Bot", true); 17 | TabFlags::t_glowHack = toml::find_or(prevTabState, "Glow Hack", true); 18 | TabFlags::t_antiRecoil = toml::find_or(prevTabState, "Anti Recoil", true); 19 | TabFlags::t_triggerBot = toml::find_or(prevTabState, "Trigger Bot", true); 20 | TabFlags::t_triggerBot = toml::find_or(prevTabState, "Bunnyhop", true); 21 | TabFlags::t_antiAFK = toml::find_or(prevTabState, "Anti AFK", false); 22 | TabFlags::t_fov = toml::find_or(prevTabState, "Fov", false); 23 | TabFlags::t_esp = toml::find_or(prevTabState, "Esp", false); 24 | TabFlags::t_minimapHack = toml::find_or(prevTabState, "Minimap Hack", false); 25 | } -------------------------------------------------------------------------------- /.all-contributorsrc: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | "README.md" 4 | ], 5 | "imageSize": 100, 6 | "commit": false, 7 | "contributors": [ 8 | { 9 | "login": "l1m0n3", 10 | "name": "L1m0n3", 11 | "avatar_url": "https://avatars1.githubusercontent.com/u/13360351?v=4", 12 | "profile": "https://github.com/l1m0n3", 13 | "contributions": [ 14 | "code", 15 | "maintenance" 16 | ] 17 | }, 18 | { 19 | "login": "tomsa000", 20 | "name": "tomsa", 21 | "avatar_url": "https://avatars2.githubusercontent.com/u/45645938?v=4", 22 | "profile": "https://github.com/tomsa000", 23 | "contributions": [ 24 | "code", 25 | "bug", 26 | "ideas" 27 | ] 28 | }, 29 | { 30 | "login": "0xZeno", 31 | "name": "Peter Hackersøn", 32 | "avatar_url": "https://avatars.githubusercontent.com/u/79898692?v=4", 33 | "profile": "https://0xzeno.github.io/", 34 | "contributions": [ 35 | "maintenance", 36 | "ideas" 37 | ] 38 | } 39 | ], 40 | "contributorsPerLine": 7, 41 | "projectName": "Dainsleif", 42 | "projectOwner": "s3pt3mb3r", 43 | "repoType": "github", 44 | "repoHost": "https://github.com", 45 | "skipCi": true 46 | } 47 | -------------------------------------------------------------------------------- /Dainsleif/dllmain.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Save/SettingsToml.h" 4 | #include "Save/OffsetsToml.h" 5 | #include "Hacks/Aimbot.h" 6 | #include "Hacks/Glow.h" 7 | #include "Hacks/AntiRecoil.h" 8 | #include "Hacks/Triggerbot.h" 9 | #include "Hacks/AntiAFK.h" 10 | #include "Hacks/MinimapHack.h" 11 | #include "Hacks/Bunnyhop.h" 12 | #include "Save/TabStateToml.h" 13 | #include 14 | 15 | //#define DEBUG 16 | 17 | #ifdef DEBUG 18 | #define LOGHEX(name, val) std::cout << name << ": " << std::hex << val << std::endl; 19 | #define LOG(x) std::cout << x << std::endl; 20 | #define ALLOCCONSOLE()\ 21 | {\ 22 | AllocConsole();\ 23 | freopen_s(reinterpret_cast(stdout), "CONOUT$", "w", stdout);\ 24 | } 25 | #define FREECONSOLE()\ 26 | {\ 27 | fclose(stdout);\ 28 | FreeConsole();\ 29 | } 30 | #else 31 | #define LOGHEX(name, val) 32 | #define ALLOCCONSOLE() 33 | #define FREECONSOLE() 34 | #endif 35 | 36 | namespace HackFlags { 37 | extern bool bQuit, bAimbot, bGlowHack, bAntiRecoil, bTriggerBot, bBunnyhop, bAntiAFK, bMinimapHack; 38 | } 39 | 40 | namespace TabFlags { 41 | extern bool t_aimBot, t_glowHack, t_antiRecoil, t_triggerBot, t_bunnyHop, t_antiAFK, t_fov, t_esp, t_minimapHack; 42 | } 43 | 44 | extern bool g_ShowMenu; 45 | 46 | int loadSettingsFiles(); -------------------------------------------------------------------------------- /Dainsleif/Player.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "pch.h" 3 | #include "Entity.h" 4 | #include "Weapon.h" 5 | 6 | class Player : public Entity 7 | { 8 | public: 9 | static Player* GetLocalPlayer(); 10 | 11 | static std::vector GetAll(); 12 | 13 | static std::vector GetLivingOpponents(); 14 | 15 | static int GetMaxPlayers(); 16 | 17 | uintptr_t GetBoneMatrix(); 18 | 19 | uintptr_t GetGlowIndex(); 20 | 21 | //GetBodyPosition retrieves where player's body is as vector3. 22 | Vector3 GetBodyPosition(); 23 | 24 | //GetViewOffset returns the distance between the body position and the actual sight of player. 25 | Vector3 GetViewOffset(); 26 | 27 | Vector3 GetAimPunchAngle(); 28 | 29 | 30 | Vector3 GetBonePosition(); 31 | 32 | //GetHeadPosition calculates head position by view offset and body position. 33 | Vector3 GetHeadPosition(); 34 | 35 | //GetHealth retrieves player's health. 36 | int GetHealth(); 37 | 38 | //GetTeam returns teamNumber so that I can distinguish either the player is friendly or hostile. 39 | int GetTeam(); 40 | 41 | int GetShotsFired(); 42 | 43 | int GetCrosshairID(); 44 | 45 | Weapon* GetActiveWeapon(); 46 | 47 | void SetFOV(int fov); 48 | 49 | uintptr_t GetFlags(); 50 | 51 | bool isScoped(); 52 | }; -------------------------------------------------------------------------------- /Dainsleif/Hacks/AntiAFK.cpp: -------------------------------------------------------------------------------- 1 | #include "../pch.h" 2 | #include "AntiAFK.h" 3 | #include 4 | 5 | using namespace std::literals::chrono_literals; 6 | 7 | void AntiAFK::MakeMeaninglessMoves() 8 | { 9 | int* forceBackward = reinterpret_cast(Modules::client + dwForceBackward); 10 | int* forceForward = reinterpret_cast(Modules::client + dwForceForward); 11 | int* forceRight = reinterpret_cast(Modules::client + dwForceRight); 12 | int* forceLeft = reinterpret_cast(Modules::client + dwForceLeft); 13 | int* forceJump = reinterpret_cast(Modules::client + dwForceJump); 14 | 15 | *forceBackward = 1; 16 | std::this_thread::sleep_for(1s); 17 | *forceBackward = 0; 18 | 19 | *forceForward = 1; 20 | std::this_thread::sleep_for(1s); 21 | *forceForward = 0; 22 | 23 | *forceJump = 5; 24 | 25 | *forceLeft = 1; 26 | std::this_thread::sleep_for(1.5s); 27 | *forceLeft = 0; 28 | *forceJump = 4; 29 | 30 | *forceRight = 1; 31 | std::this_thread::sleep_for(1.5s); 32 | *forceRight = 0; 33 | } 34 | 35 | void AntiAFK::Run(bool *bAntiAFK) { 36 | while(*bAntiAFK) { 37 | std::this_thread::sleep_for(50s); 38 | if (*bAntiAFK) { // Checking if bAntiAFK hasn't been changed to false during this sleep. 39 | MakeMeaninglessMoves(); 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /Dependencies/toml11/toml/storage.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Toru Niina 2017. 2 | // Distributed under the MIT License. 3 | #ifndef TOML11_STORAGE_HPP 4 | #define TOML11_STORAGE_HPP 5 | #include "utility.hpp" 6 | 7 | namespace toml 8 | { 9 | namespace detail 10 | { 11 | 12 | // this contains pointer and deep-copy the content if copied. 13 | // to avoid recursive pointer. 14 | template 15 | struct storage 16 | { 17 | using value_type = T; 18 | 19 | explicit storage(value_type const& v): ptr(toml::make_unique(v)) {} 20 | explicit storage(value_type&& v): ptr(toml::make_unique(std::move(v))) {} 21 | ~storage() = default; 22 | storage(const storage& rhs): ptr(toml::make_unique(*rhs.ptr)) {} 23 | storage& operator=(const storage& rhs) 24 | { 25 | this->ptr = toml::make_unique(*rhs.ptr); 26 | return *this; 27 | } 28 | storage(storage&&) = default; 29 | storage& operator=(storage&&) = default; 30 | 31 | bool is_ok() const noexcept {return static_cast(ptr);} 32 | 33 | value_type& value() & noexcept {return *ptr;} 34 | value_type const& value() const& noexcept {return *ptr;} 35 | value_type&& value() && noexcept {return std::move(*ptr);} 36 | 37 | private: 38 | std::unique_ptr ptr; 39 | }; 40 | 41 | } // detail 42 | } // toml 43 | #endif// TOML11_STORAGE_HPP 44 | -------------------------------------------------------------------------------- /Dainsleif/Hacks/Glow.cpp: -------------------------------------------------------------------------------- 1 | #include "../pch.h" 2 | #include "Glow.h" 3 | 4 | ImVec4 enemyGlowColor, localGlowColor; 5 | 6 | uintptr_t GetGlowObjectManager() { 7 | return *reinterpret_cast(Modules::client + dwGlowObjectManager); 8 | } 9 | 10 | void Glow::Run(Player* player) 11 | { 12 | uintptr_t glowObjectManager = GetGlowObjectManager(); 13 | uintptr_t glowIndex = player->GetGlowIndex(); 14 | GlowObject* glowObject = reinterpret_cast(glowObjectManager + (glowIndex * sizeof(GlowObject))); 15 | 16 | Player* localPlayer = Player::GetLocalPlayer(); 17 | 18 | int teamNum = player->GetTeam(); 19 | 20 | if (teamNum == localPlayer->GetTeam()) 21 | { 22 | glowObject->r = localGlowColor.x; 23 | glowObject->g = localGlowColor.y; 24 | glowObject->b = localGlowColor.z; 25 | glowObject->a = localGlowColor.w; 26 | } 27 | else if (teamNum != localPlayer->GetTeam() && !player->IsDormant()) 28 | { 29 | glowObject->r = enemyGlowColor.x; 30 | glowObject->g = enemyGlowColor.y; 31 | glowObject->b = enemyGlowColor.z; 32 | glowObject->a = enemyGlowColor.w; 33 | } 34 | glowObject->m_bRenderWhenOccluded = true; //If I set this to false, the entire glow disappear 35 | glowObject->m_bRenderWhenUnoccluded = false; //if i set this true, the damage indicater go out of the outline. 36 | } -------------------------------------------------------------------------------- /Dainsleif/Utils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace Utils 6 | { 7 | template < typename T > 8 | T GetVirtualFunction ( void* baseClass, int index ) 9 | { 10 | return ( *static_cast< T** > ( baseClass ) )[ index ]; 11 | } 12 | 13 | template < typename T, typename ... Args > 14 | T CallVirtualFunction ( void* baseClass, int index, Args ... args ) 15 | { 16 | return GetVirtualFunction< T(__thiscall*) (void*, Args ... ) > ( baseClass, index )(baseClass, args...); 17 | } 18 | } 19 | 20 | template 21 | inline MH_STATUS MH_CreateHookEx(LPVOID pTarget, LPVOID pDetour, T** ppOriginal) { 22 | return MH_CreateHook(pTarget, pDetour, reinterpret_cast(ppOriginal)); 23 | } 24 | 25 | #define MEMBER_FUNC_ARGS(...) (this, __VA_ARGS__); }; 26 | #define CALL_VFUNC(index, func, type) __forceinline auto func { return Utils::GetVirtualFunction(this, index) MEMBER_FUNC_ARGS 27 | 28 | /*EXAMPLE OF USING CALL_VFUNC: 29 | * PARAMS: index, func, type 30 | * $param(index): the index of the virtual function you want to call. 31 | * $param(func): the name of the function, and its parameters if any. 32 | * $param(type): the type of the function (usually a __thiscall*, but others can be used aswell.) 33 | * CALL_VFUNC(25, some_func(int arg1, int arg2), void(__thiscall*)(type*, int, int)) (arg1, arg2) 34 | */ 35 | -------------------------------------------------------------------------------- /Dainsleif/Hacks/Triggerbot.cpp: -------------------------------------------------------------------------------- 1 | #include "../pch.h" 2 | #include "Triggerbot.h" 3 | #include "../dllmain.h" 4 | 5 | void Triggerbot::Run() 6 | { 7 | Player* localPlayer = Player::GetLocalPlayer(); 8 | Weapon* weapon = localPlayer->GetActiveWeapon(); 9 | WeaponID weaponId = weapon->GetWeaponID(); 10 | static const WeaponID rejectWeaponList[8] = {KNIFE, C4, GN_DECOY, GN_FLASH_, GN_HE, GN_MOLOTOV, GN_SMOKE}; 11 | for (auto& rejW : rejectWeaponList) { 12 | if (rejW == weaponId) 13 | return; 14 | } 15 | 16 | //if bFreeMouse is false, mouse move will set to be free. 17 | static bool bFreeMouse; 18 | auto* forceAttack = reinterpret_cast(Modules::client + dwForceAttack); 19 | int crosshairID = localPlayer->GetCrosshairID(); 20 | if (crosshairID != 0) { 21 | //When you kill all enemy, it's somehow gonna be a number more than 300. 22 | 23 | Entity* target = Entity::GetByIndex(crosshairID - 1); 24 | if (target->GetClientClass()->m_ClassID == ClassID::CCSPlayer && localPlayer->GetTeam() != target->Cast()->GetTeam()) 25 | { 26 | bFreeMouse = false; 27 | if (HackFlags::bAimbot && *forceAttack == 4) 28 | { 29 | Sleep(60); 30 | } 31 | *forceAttack = 5; 32 | } 33 | } 34 | 35 | 36 | if (crosshairID == 0 && !bFreeMouse) { 37 | *forceAttack = 4; 38 | bFreeMouse = true; 39 | } 40 | } -------------------------------------------------------------------------------- /Dainsleif/Interfaces/CInterfaceList.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../pch.h" 3 | 4 | #include "IBaseClientDll.h" 5 | #include "IClientModeShared.h" 6 | #include "IVEngineClient.h" 7 | #include "ISurface.h" 8 | #include "CInput.h" 9 | 10 | #define PRINT_INTERFACE(inter) std::cout << #inter << ": " << "0x" << ##inter << "\n"; 11 | 12 | class CInterfaceList 13 | { 14 | public: 15 | void Initialize ( ); 16 | public: 17 | IBaseClientDll* client = nullptr; 18 | IClientModeShared* clientMode = nullptr; 19 | IVEngineClient* engine = nullptr; 20 | ISurface* surface = nullptr; 21 | CInput* input = nullptr; 22 | private: 23 | using fnCreateInterface = void*(*) ( const char*, int* ); 24 | private: 25 | template < typename T > 26 | static T* GetInterface ( const fnCreateInterface createInterface, const std::string_view& version ) 27 | { 28 | return static_cast< T* > ( createInterface ( version.data ( ), nullptr ) ); 29 | } 30 | 31 | static fnCreateInterface GetModuleFactory ( const HMODULE mod ) 32 | { 33 | return reinterpret_cast< fnCreateInterface > ( GetProcAddress ( mod, "CreateInterface" ) ); 34 | } 35 | 36 | __forceinline void PrintInterfaces ( ) 37 | { 38 | PRINT_INTERFACE(client); 39 | PRINT_INTERFACE(clientMode); 40 | PRINT_INTERFACE ( engine ); 41 | PRINT_INTERFACE ( surface ); 42 | PRINT_INTERFACE ( input ); 43 | } 44 | }; 45 | 46 | extern CInterfaceList g_csgo; 47 | -------------------------------------------------------------------------------- /Dainsleif/Interfaces/IClientModeShared.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../Vector.h" 3 | 4 | class IClientModeShared 5 | { 6 | public: 7 | 8 | }; 9 | 10 | struct ViewSetup 11 | { 12 | int m_iX; 13 | int m_iUnscaledX; 14 | int m_iY; 15 | int m_iUnscaledY; 16 | int m_iWidth; 17 | int m_iUnscaledWidth; 18 | int m_iHeight; 19 | int m_iUnscaledHeight; 20 | bool m_bOrtho; 21 | float m_flOrthoLeft; 22 | float m_flOrthoTop; 23 | float m_flOrthoRight; 24 | float m_flOrthoBottom; 25 | std::byte m_pad0[0x7C]; 26 | float m_flFOV; 27 | float m_flViewModelFOV; 28 | Vector3 m_vecOrigin; 29 | Vector3 m_angView; 30 | float m_flNearZ; 31 | float m_flFarZ; 32 | float m_flNearViewmodelZ; 33 | float m_flFarViewmodelZ; 34 | float m_flAspectRatio; 35 | float m_flNearBlurDepth; 36 | float m_flNearFocusDepth; 37 | float m_flFarFocusDepth; 38 | float m_flFarBlurDepth; 39 | float m_flNearBlurRadius; 40 | float m_flFarBlurRadius; 41 | float m_flDoFQuality; 42 | int m_nMotionBlurMode; 43 | float m_flShutterTime; 44 | Vector3 m_vecShutterOpenPosition; 45 | Vector3 m_vecShutterOpenAngles; 46 | Vector3 m_vecShutterClosePosition; 47 | Vector3 m_vecShutterCloseAngles; 48 | float m_flOffCenterTop; 49 | float m_flOffCenterBottom; 50 | float m_flOffCenterLeft; 51 | float m_flOffCenterRight; 52 | bool m_bOffCenter : 1; 53 | bool m_bRenderToSubrectOfLargerScreen : 1; 54 | bool m_bDoBloomAndToneMapping : 1; 55 | bool m_bDoDepthOfField : 1; 56 | bool m_bHDRTarget : 1; 57 | bool m_bDrawWorldNormal : 1; 58 | bool m_bCullFontFaces : 1; 59 | bool m_bCacheFullSceneState : 1; 60 | bool m_bCSMView : 1; 61 | }; 62 | -------------------------------------------------------------------------------- /Dependencies/toml11/toml.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017 Toru Niina 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #ifndef TOML_FOR_MODERN_CPP 26 | #define TOML_FOR_MODERN_CPP 27 | 28 | #ifndef __cplusplus 29 | # error "__cplusplus is not defined" 30 | #endif 31 | 32 | #if __cplusplus < 201103L && _MSC_VER < 1900 33 | # error "toml11 requires C++11 or later." 34 | #endif 35 | 36 | #define TOML11_VERSION_MAJOR 3 37 | #define TOML11_VERSION_MINOR 5 38 | #define TOML11_VERSION_PATCH 0 39 | 40 | #include "toml/parser.hpp" 41 | #include "toml/literal.hpp" 42 | #include "toml/serializer.hpp" 43 | #include "toml/get.hpp" 44 | 45 | #endif// TOML_FOR_MODERN_CPP 46 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.16) 2 | project(Dainsleif) 3 | 4 | set(CMAKE_CXX_STANDARD 17) 5 | 6 | if(CMAKE_GENERATOR MATCHES "Visual Studio") 7 | set_property(GLOBAL PROPERTY USE_FOLDERS ON) 8 | file(GLOB_RECURSE SOURCE_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} CONFIGURE_DEPENDS *.c *.cpp *.h *.hpp) 9 | source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${SOURCE_LIST}) 10 | endif() 11 | 12 | #main directory and its sub-directories 13 | file(GLOB_RECURSE MAIN CONFIGURE_DEPENDS 14 | ${CMAKE_CURRENT_LIST_DIR}/Dainsleif/*.cpp 15 | ${CMAKE_CURRENT_LIST_DIR}/Dainsleif/*.h) 16 | 17 | #minhook 18 | file(GLOB_RECURSE MINHOOK CONFIGURE_DEPENDS 19 | ${CMAKE_CURRENT_LIST_DIR}/Dependencies/minhook/*.c 20 | ${CMAKE_CURRENT_LIST_DIR}/Dependencies/minhook/*.h) 21 | 22 | #imgui 23 | file(GLOB IMGUI CONFIGURE_DEPENDS 24 | ${CMAKE_CURRENT_LIST_DIR}/Dependencies/imgui/*.cpp 25 | ${CMAKE_CURRENT_LIST_DIR}/Dependencies/imgui/*.h 26 | ${CMAKE_CURRENT_LIST_DIR}/Dependencies/imgui/backends/imgui_impl_dx9.* 27 | ${CMAKE_CURRENT_LIST_DIR}/Dependencies/imgui/backends/imgui_impl_win32.*) 28 | 29 | #toml11 30 | file(GLOB_RECURSE TOML CONFIGURE_DEPENDS 31 | ${CMAKE_CURRENT_LIST_DIR}/Dependencies/toml11/*.hpp) 32 | 33 | set(DEPENDENCIES 34 | ${MINHOOK} 35 | ${IMGUI} 36 | ${TOML}) 37 | 38 | add_library(Dainsleif SHARED ${MAIN} ${DEPENDENCIES}) 39 | 40 | target_include_directories(Dainsleif PRIVATE 41 | ${CMAKE_CURRENT_LIST_DIR}/Dependencies/imgui 42 | ${CMAKE_CURRENT_LIST_DIR}/Dependencies/imgui/backends 43 | ${CMAKE_CURRENT_LIST_DIR}/Dependencies/minhook/include 44 | ${CMAKE_CURRENT_LIST_DIR}/Dependencies/toml11 45 | $ENV{DXSDK_DIR}/Include) 46 | 47 | find_library(D3D9 d3d9.lib $ENV{DXSDK_DIR}/Lib/x86) 48 | find_library(D3DX9 d3dx9.lib $ENV{DXSDK_DIR}/Lib/x86) 49 | target_link_libraries(Dainsleif ${D3D9} ${D3DX9}) -------------------------------------------------------------------------------- /Dainsleif/Hacks/AntiRecoil.cpp: -------------------------------------------------------------------------------- 1 | #include "../pch.h" 2 | #include "../Player.h" 3 | #include "AntiRecoil.h" 4 | 5 | Vector3 oldPunch = { 0, 0, 0 }; 6 | int oldShotCount = 0; 7 | 8 | void AntiRecoil::Run() { 9 | static const WeaponID rejectWeaponList[19] = { KNIFE, C4, GN_DECOY, GN_FLASH_, GN_HE, GN_MOLOTOV, GN_SMOKE, HG_GLOCK, HG_DUAL_BERETTAS, HG_P250, HG_TEC9,HG_DESERT_EAGLE, 10 | SG_NOVA, SG_XM1014, SG_SAWED_OFF, SR_SSG08, SR_AWP, SR_G3SG1 }; 11 | Player* localPlayer = Player::GetLocalPlayer(); 12 | Weapon* activeWeapon = localPlayer->GetActiveWeapon(); 13 | WeaponID activeWeaponID = activeWeapon->GetWeaponID(); 14 | for (WeaponID rejW : rejectWeaponList) { 15 | if (rejW == activeWeaponID) { 16 | return; 17 | } 18 | } 19 | 20 | int shotCount = localPlayer->GetShotsFired(); 21 | 22 | if (shotCount >= 1) { 23 | if (shotCount != oldShotCount) { 24 | //This refers to the cursor position after local player shot. Bullet's gonna be shot out over the cursor by twice. 25 | Vector3 aimPunchAngle = localPlayer->GetAimPunchAngle(); 26 | Vector3* viewAngle = reinterpret_cast(*reinterpret_cast(Modules::engine + dwClientState) + dwClientState_ViewAngles); 27 | Vector3 rcsAngle{}; 28 | rcsAngle.y = viewAngle->y + (oldPunch.y - aimPunchAngle.y * 2.f); 29 | rcsAngle.x = viewAngle->x + (oldPunch.x - aimPunchAngle.x * 2.f); 30 | 31 | viewAngle->Normalize(); 32 | 33 | oldPunch.y = aimPunchAngle.y * 2.f; 34 | oldPunch.x = aimPunchAngle.x * 2.f; 35 | viewAngle->y = rcsAngle.y; 36 | viewAngle->x = rcsAngle.x; 37 | oldShotCount = shotCount; 38 | } 39 | } 40 | else { 41 | oldPunch = { 0, 0, 0 }; 42 | oldShotCount = 0; 43 | } 44 | } -------------------------------------------------------------------------------- /Dependencies/toml11/toml/exception.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Toru Niina 2017. 2 | // Distributed under the MIT License. 3 | #ifndef TOML11_EXCEPTION_HPP 4 | #define TOML11_EXCEPTION_HPP 5 | #include 6 | #include 7 | 8 | #include "source_location.hpp" 9 | 10 | namespace toml 11 | { 12 | 13 | struct exception : public std::exception 14 | { 15 | public: 16 | explicit exception(const source_location& loc): loc_(loc) {} 17 | virtual ~exception() noexcept override = default; 18 | virtual const char* what() const noexcept override {return "";} 19 | virtual source_location const& location() const noexcept {return loc_;} 20 | 21 | protected: 22 | source_location loc_; 23 | }; 24 | 25 | struct syntax_error : public toml::exception 26 | { 27 | public: 28 | explicit syntax_error(const std::string& what_arg, const source_location& loc) 29 | : exception(loc), what_(what_arg) 30 | {} 31 | virtual ~syntax_error() noexcept override = default; 32 | virtual const char* what() const noexcept override {return what_.c_str();} 33 | 34 | protected: 35 | std::string what_; 36 | }; 37 | 38 | struct type_error : public toml::exception 39 | { 40 | public: 41 | explicit type_error(const std::string& what_arg, const source_location& loc) 42 | : exception(loc), what_(what_arg) 43 | {} 44 | virtual ~type_error() noexcept override = default; 45 | virtual const char* what() const noexcept override {return what_.c_str();} 46 | 47 | protected: 48 | std::string what_; 49 | }; 50 | 51 | struct internal_error : public toml::exception 52 | { 53 | public: 54 | explicit internal_error(const std::string& what_arg, const source_location& loc) 55 | : exception(loc), what_(what_arg) 56 | {} 57 | virtual ~internal_error() noexcept override = default; 58 | virtual const char* what() const noexcept override {return what_.c_str();} 59 | 60 | protected: 61 | std::string what_; 62 | }; 63 | 64 | } // toml 65 | #endif // TOML_EXCEPTION 66 | -------------------------------------------------------------------------------- /Dainsleif/Hook/Hooks.cpp: -------------------------------------------------------------------------------- 1 | #include "Hooks.h" 2 | #include 3 | #include 4 | #include "ControlCursor.h" 5 | #include "GraphicHook.h" 6 | #include "../Interfaces/CInterfaceList.h" 7 | #include "../Utils.h" 8 | #include "../Player.h" 9 | 10 | extern int fov; //declared in dllmain.cpp 11 | 12 | namespace Hooks 13 | { 14 | using FnOverrideView = void (__thiscall*)(IClientModeShared* clientMode, ViewSetup* setup); 15 | FnOverrideView originalOverrideView = nullptr; 16 | 17 | void __fastcall HookedOverrideView(IClientModeShared* clientMode, int edx, ViewSetup* setup) 18 | { 19 | Player* localPlayer = Player::GetLocalPlayer(); 20 | if (!localPlayer || localPlayer->isScoped()) { 21 | originalOverrideView(clientMode, setup); 22 | return; 23 | } 24 | 25 | setup->m_flFOV = fov; 26 | originalOverrideView(clientMode, setup); 27 | } 28 | 29 | void Initialize() 30 | { 31 | if (MH_Initialize() != MH_OK) 32 | { 33 | throw std::runtime_error("Failed to initialize minhook!"); 34 | } 35 | 36 | InitializeGraphicHook(); 37 | HookLockCursor(); 38 | 39 | void* overrideView = Utils::GetVirtualFunction(g_csgo.clientMode, 18); 40 | if (MH_CreateHookEx(overrideView, &HookedOverrideView, &originalOverrideView) != MH_OK) 41 | { 42 | throw std::runtime_error("Failed to hook OverrideView!"); 43 | } 44 | 45 | if (MH_EnableHook(MH_ALL_HOOKS) != MH_OK) 46 | { 47 | throw std::runtime_error("Failed to enable hooks!"); 48 | } 49 | } 50 | 51 | void Restore() 52 | { 53 | if (MH_DisableHook(MH_ALL_HOOKS) != MH_OK) 54 | { 55 | throw std::runtime_error("Failed to disable hooks!"); 56 | } 57 | 58 | ShutDownGraphicHook(); 59 | 60 | if (MH_Uninitialize() != MH_OK) 61 | { 62 | throw std::runtime_error("Failed to uninitialize minhook!"); 63 | } 64 | } 65 | } -------------------------------------------------------------------------------- /Dainsleif/PatternScanner.cpp: -------------------------------------------------------------------------------- 1 | #include "PatternScanner.h" 2 | #include 3 | 4 | //FindPattern expects an input like this -> \x0F\x11\x05????\x83\xC8\x01 5 | //For example: BB [0C45572F] 83 FF 01 -> offset should be 1. offset has to be the number of byte before address we need. 6 | std::optional PatternScanner::FindPattern() 7 | { 8 | HMODULE hModule = GetModuleHandle(this->moduleName); 9 | if (!hModule) 10 | return std::nullopt; 11 | MODULEINFO moduleInfo; 12 | if (!GetModuleInformation(GetCurrentProcess(), hModule, &moduleInfo, sizeof(moduleInfo))) 13 | return std::nullopt; 14 | 15 | auto beginningOfModule = static_cast(moduleInfo.lpBaseOfDll); 16 | const auto end = beginningOfModule + moduleInfo.SizeOfImage; //This is the last element of beginningOfModule array. 17 | 18 | auto current = beginningOfModule; 19 | auto patternCopy = this->pattern; 20 | 21 | while (current < end && *patternCopy) { 22 | //*current refers to the each element of current array and basically cycle through the char array to check if they are matched. 23 | if (*current == *patternCopy || *patternCopy == '?') { 24 | ++current; 25 | ++patternCopy; 26 | } else { 27 | current = ++beginningOfModule; //increment beginningOfModule value and assign to current 28 | patternCopy = this->pattern; //"pattern" variable holds the original value of pattern. 29 | } 30 | } 31 | 32 | // If nothing found, return optional containing nothing 33 | if (beginningOfModule == end){ 34 | return std::nullopt; 35 | } 36 | 37 | //back to the address of where current was located by subtracting the length of original pattern. 38 | current -= strlen(this->pattern); 39 | 40 | return *reinterpret_cast(reinterpret_cast(current) + this->offset); 41 | } 42 | 43 | //Sometimes desired pointer is not illustrated in the module, so find an address which is located near desired one, and add extra bytes to reach the address. 44 | uintptr_t PatternScanner::CalculateOffset(uintptr_t base, int extra) { 45 | std::optional o_pattern = FindPattern(); 46 | if (o_pattern) { 47 | return o_pattern.value() - base + extra; 48 | } else { 49 | return 0000000; 50 | } 51 | } -------------------------------------------------------------------------------- /Dependencies/toml11/toml/color.hpp: -------------------------------------------------------------------------------- 1 | #ifndef TOML11_COLOR_HPP 2 | #define TOML11_COLOR_HPP 3 | #include 4 | #include 5 | 6 | #ifdef TOML11_COLORIZE_ERROR_MESSAGE 7 | #define TOML11_ERROR_MESSAGE_COLORIZED true 8 | #else 9 | #define TOML11_ERROR_MESSAGE_COLORIZED false 10 | #endif 11 | 12 | namespace toml 13 | { 14 | 15 | // put ANSI escape sequence to ostream 16 | namespace color_ansi 17 | { 18 | namespace detail 19 | { 20 | inline int colorize_index() 21 | { 22 | static const int index = std::ios_base::xalloc(); 23 | return index; 24 | } 25 | } // detail 26 | 27 | inline std::ostream& colorize(std::ostream& os) 28 | { 29 | // by default, it is zero. 30 | os.iword(detail::colorize_index()) = 1; 31 | return os; 32 | } 33 | inline std::ostream& nocolorize(std::ostream& os) 34 | { 35 | os.iword(detail::colorize_index()) = 0; 36 | return os; 37 | } 38 | inline std::ostream& reset (std::ostream& os) 39 | {if(os.iword(detail::colorize_index()) == 1) {os << "\033[00m";} return os;} 40 | inline std::ostream& bold (std::ostream& os) 41 | {if(os.iword(detail::colorize_index()) == 1) {os << "\033[01m";} return os;} 42 | inline std::ostream& grey (std::ostream& os) 43 | {if(os.iword(detail::colorize_index()) == 1) {os << "\033[30m";} return os;} 44 | inline std::ostream& red (std::ostream& os) 45 | {if(os.iword(detail::colorize_index()) == 1) {os << "\033[31m";} return os;} 46 | inline std::ostream& green (std::ostream& os) 47 | {if(os.iword(detail::colorize_index()) == 1) {os << "\033[32m";} return os;} 48 | inline std::ostream& yellow (std::ostream& os) 49 | {if(os.iword(detail::colorize_index()) == 1) {os << "\033[33m";} return os;} 50 | inline std::ostream& blue (std::ostream& os) 51 | {if(os.iword(detail::colorize_index()) == 1) {os << "\033[34m";} return os;} 52 | inline std::ostream& magenta(std::ostream& os) 53 | {if(os.iword(detail::colorize_index()) == 1) {os << "\033[35m";} return os;} 54 | inline std::ostream& cyan (std::ostream& os) 55 | {if(os.iword(detail::colorize_index()) == 1) {os << "\033[36m";} return os;} 56 | inline std::ostream& white (std::ostream& os) 57 | {if(os.iword(detail::colorize_index()) == 1) {os << "\033[37m";} return os;} 58 | } // color_ansi 59 | 60 | // ANSI escape sequence is the only and default colorization method currently 61 | namespace color = color_ansi; 62 | 63 | } // toml 64 | #endif// TOML11_COLOR_HPP 65 | -------------------------------------------------------------------------------- /Dependencies/toml11/toml/utility.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Toru Niina 2017. 2 | // Distributed under the MIT License. 3 | #ifndef TOML11_UTILITY_HPP 4 | #define TOML11_UTILITY_HPP 5 | #include 6 | #include 7 | #include 8 | 9 | #include "traits.hpp" 10 | 11 | #if __cplusplus >= 201402L 12 | # define TOML11_MARK_AS_DEPRECATED(msg) [[deprecated(msg)]] 13 | #elif defined(__GNUC__) 14 | # define TOML11_MARK_AS_DEPRECATED(msg) __attribute__((deprecated(msg))) 15 | #elif defined(_MSC_VER) 16 | # define TOML11_MARK_AS_DEPRECATED(msg) __declspec(deprecated(msg)) 17 | #else 18 | # define TOML11_MARK_AS_DEPRECATED 19 | #endif 20 | 21 | namespace toml 22 | { 23 | 24 | #if __cplusplus >= 201402L 25 | 26 | using std::make_unique; 27 | 28 | #else 29 | 30 | template 31 | inline std::unique_ptr make_unique(Ts&& ... args) 32 | { 33 | return std::unique_ptr(new T(std::forward(args)...)); 34 | } 35 | 36 | #endif // __cplusplus >= 2014 37 | 38 | namespace detail 39 | { 40 | template 41 | void try_reserve_impl(Container& container, std::size_t N, std::true_type) 42 | { 43 | container.reserve(N); 44 | return; 45 | } 46 | template 47 | void try_reserve_impl(Container&, std::size_t, std::false_type) noexcept 48 | { 49 | return; 50 | } 51 | } // detail 52 | 53 | template 54 | void try_reserve(Container& container, std::size_t N) 55 | { 56 | if(N <= container.size()) {return;} 57 | detail::try_reserve_impl(container, N, detail::has_reserve_method{}); 58 | return; 59 | } 60 | 61 | namespace detail 62 | { 63 | inline std::string concat_to_string_impl(std::ostringstream& oss) 64 | { 65 | return oss.str(); 66 | } 67 | template 68 | std::string concat_to_string_impl(std::ostringstream& oss, T&& head, Ts&& ... tail) 69 | { 70 | oss << std::forward(head); 71 | return concat_to_string_impl(oss, std::forward(tail) ... ); 72 | } 73 | } // detail 74 | 75 | template 76 | std::string concat_to_string(Ts&& ... args) 77 | { 78 | std::ostringstream oss; 79 | oss << std::boolalpha << std::fixed; 80 | return detail::concat_to_string_impl(oss, std::forward(args) ...); 81 | } 82 | 83 | template 84 | T from_string(const std::string& str, T opt) 85 | { 86 | T v(opt); 87 | std::istringstream iss(str); 88 | iss >> v; 89 | return v; 90 | } 91 | 92 | }// toml 93 | #endif // TOML11_UTILITY 94 | -------------------------------------------------------------------------------- /Dependencies/toml11/toml/literal.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Toru Niina 2019. 2 | // Distributed under the MIT License. 3 | #ifndef TOML11_LITERAL_HPP 4 | #define TOML11_LITERAL_HPP 5 | #include "parser.hpp" 6 | 7 | namespace toml 8 | { 9 | inline namespace literals 10 | { 11 | inline namespace toml_literals 12 | { 13 | 14 | inline ::toml::value operator"" _toml(const char* str, std::size_t len) 15 | { 16 | ::toml::detail::location 17 | loc(/* filename = */ std::string("TOML literal encoded in a C++ code"), 18 | /* contents = */ std::vector(str, str + len)); 19 | 20 | // if there are some comments or empty lines, skip them. 21 | using skip_line = ::toml::detail::repeat, 23 | ::toml::detail::maybe<::toml::detail::lex_comment>, 24 | ::toml::detail::lex_newline 25 | >, ::toml::detail::at_least<1>>; 26 | skip_line::invoke(loc); 27 | 28 | // if there are some whitespaces before a value, skip them. 29 | using skip_ws = ::toml::detail::repeat< 30 | ::toml::detail::lex_ws, ::toml::detail::at_least<1>>; 31 | skip_ws::invoke(loc); 32 | 33 | // to distinguish arrays and tables, first check it is a table or not. 34 | // 35 | // "[1,2,3]"_toml; // this is an array 36 | // "[table]"_toml; // a table that has an empty table named "table" inside. 37 | // "[[1,2,3]]"_toml; // this is an array of arrays 38 | // "[[table]]"_toml; // this is a table that has an array of tables inside. 39 | // 40 | // "[[1]]"_toml; // this can be both... (currently it becomes a table) 41 | // "1 = [{}]"_toml; // this is a table that has an array of table named 1. 42 | // "[[1,]]"_toml; // this is an array of arrays. 43 | // "[[1],]"_toml; // this also. 44 | 45 | const auto the_front = loc.iter(); 46 | 47 | const bool is_table_key = ::toml::detail::lex_std_table::invoke(loc); 48 | loc.reset(the_front); 49 | 50 | const bool is_aots_key = ::toml::detail::lex_array_table::invoke(loc); 51 | loc.reset(the_front); 52 | 53 | // If it is neither a table-key or a array-of-table-key, it may be a value. 54 | if(!is_table_key && !is_aots_key) 55 | { 56 | if(auto data = ::toml::detail::parse_value<::toml::value>(loc)) 57 | { 58 | return data.unwrap(); 59 | } 60 | } 61 | 62 | // Note that still it can be a table, because the literal might be something 63 | // like the following. 64 | // ```cpp 65 | // R"( // c++11 raw string literals 66 | // key = "value" 67 | // int = 42 68 | // )"_toml; 69 | // ``` 70 | // It is a valid toml file. 71 | // It should be parsed as if we parse a file with this content. 72 | 73 | if(auto data = ::toml::detail::parse_toml_file<::toml::value>(loc)) 74 | { 75 | return data.unwrap(); 76 | } 77 | else // none of them. 78 | { 79 | throw ::toml::syntax_error(data.unwrap_err(), source_location(loc)); 80 | } 81 | } 82 | 83 | } // toml_literals 84 | } // literals 85 | } // toml 86 | #endif//TOML11_LITERAL_HPP 87 | -------------------------------------------------------------------------------- /Dainsleif/Save/SettingsToml.cpp: -------------------------------------------------------------------------------- 1 | #include "SettingsToml.h" 2 | 3 | 4 | extern ImVec4 enemyGlowColor, localGlowColor; 5 | extern float aimSmoothness; //declared in Hacks/Aimbot.cpp 6 | extern int fov; //declared in dllmain.cpp 7 | extern float range; 8 | 9 | void SettingsToml::Fetch(std::string& filename) 10 | { 11 | auto saveData = toml::parse(filename); 12 | 13 | // find specified values associated with one keys, and assign them into each variable. 14 | HackFlags::bAimbot = toml::find_or(saveData, "bAimbot", Default::bAimbot); 15 | aimSmoothness = toml::find_or(saveData, "aimSmoothness", Default::aimSmoothness); 16 | range = toml::find_or(saveData, "range", Default::range); 17 | HackFlags::bGlowHack = toml::find_or(saveData, "bGlowHack", Default::bGlowhack); 18 | HackFlags::bAntiRecoil = toml::find_or(saveData, "bAntiRecoil", Default::bAntiRecoil); 19 | HackFlags::bTriggerBot = toml::find_or(saveData, "bTriggerBot", Default::bTriggerBot); 20 | HackFlags::bBunnyhop = toml::find_or(saveData, "bBunnyhop", Default::bBunnyhop); 21 | HackFlags::bAntiAFK = toml::find_or(saveData, "bAntiAFK", Default::bAntiAFK); 22 | fov = toml::find_or(saveData, "fov", Default::fov); 23 | HackFlags::bEsp = toml::find_or(saveData, "bEsp", Default::bEsp); 24 | HackFlags::bLineOverlay = toml::find_or(saveData, "bLineOverlay", Default::bLineOverlay); 25 | HackFlags::bRectOverlay = toml::find_or(saveData, "bRectOverlay", Default::bRectOverlay); 26 | HackFlags::bMinimapHack = toml::find_or(saveData, "bMinimapHack", Default::bMinimapHack); 27 | 28 | auto& enemyGlowColorTable = toml::find_or(saveData, "enemyGlowColor", {}); 29 | enemyGlowColor = ImVec4(toml::find_or(enemyGlowColorTable, "Red", Default::enemyGlowColor.x), toml::find_or(enemyGlowColorTable, "Green", Default::enemyGlowColor.y), toml::find_or(enemyGlowColorTable, "Blue", Default::enemyGlowColor.z), toml::find_or(enemyGlowColorTable, "Alpha", Default::enemyGlowColor.w)); 30 | 31 | auto& localGlowColorTable = toml::find_or(saveData, "localGlowColor", {}); 32 | localGlowColor = ImVec4(toml::find_or(localGlowColorTable, "Red", Default::localGlowColor.x), toml::find_or(localGlowColorTable, "Green", Default::localGlowColor.y), toml::find_or(localGlowColorTable, "Blue", Default::localGlowColor.z), toml::find_or(localGlowColorTable, "Alpha", Default::localGlowColor.w)); 33 | 34 | } 35 | 36 | void SettingsToml::Save(std::string& filename) 37 | { 38 | //Make a variable that holds keys and values. 39 | const toml::value data 40 | { 41 | {"bAimbot", HackFlags::bAimbot}, 42 | {"bGlowHack", HackFlags::bGlowHack}, 43 | {"bAntiRecoil", HackFlags::bAntiRecoil}, 44 | {"bTriggerBot", HackFlags::bTriggerBot}, 45 | {"bBunnyhop", HackFlags::bBunnyhop}, 46 | {"bAntiAFK", HackFlags::bAntiAFK}, 47 | {"fov", fov}, 48 | {"enemyGlowColor",{ 49 | {"Red", enemyGlowColor.x}, 50 | {"Green", enemyGlowColor.y}, 51 | {"Blue", enemyGlowColor.z}, 52 | {"Alpha", enemyGlowColor.w} 53 | }}, 54 | {"localGlowColor", { 55 | {"Red", localGlowColor.x}, 56 | {"Green", localGlowColor.y}, 57 | {"Blue", localGlowColor.z}, 58 | {"Alpha", localGlowColor.w} 59 | }}, 60 | {"aimSmoothness", aimSmoothness}, 61 | {"range", range}, 62 | {"bEsp", HackFlags::bEsp}, 63 | {"bLineOverlay", HackFlags::bLineOverlay}, 64 | {"bRectOverlay", HackFlags::bRectOverlay}, 65 | {"bMinimapHack", HackFlags::bMinimapHack} 66 | }; 67 | //Open file and write it in toml syntax. 68 | std::ofstream file; 69 | file.open(filename, std::ios::out); 70 | file << data; 71 | file.close(); 72 | } 73 | 74 | -------------------------------------------------------------------------------- /Dainsleif/Hook/ImGuiTheme.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by PC on 2020/07/31. 3 | // 4 | #include "imgui.h" 5 | 6 | void LoadTheme() { 7 | ImGuiStyle * style = &ImGui::GetStyle(); 8 | 9 | style->WindowPadding = ImVec2(15, 15); 10 | style->WindowRounding = 5.0f; 11 | style->FramePadding = ImVec2(5, 5); 12 | style->FrameRounding = 4.0f; 13 | style->ItemSpacing = ImVec2(12, 8); 14 | style->ItemInnerSpacing = ImVec2(8, 6); 15 | style->IndentSpacing = 25.0f; 16 | style->ScrollbarSize = 15.0f; 17 | style->ScrollbarRounding = 9.0f; 18 | style->GrabMinSize = 5.0f; 19 | style->GrabRounding = 3.0f; 20 | 21 | style->Colors[ImGuiCol_Text] = ImVec4(0.80f, 0.80f, 0.83f, 1.00f); 22 | style->Colors[ImGuiCol_TextDisabled] = ImVec4(0.24f, 0.23f, 0.29f, 1.00f); 23 | style->Colors[ImGuiCol_WindowBg] = ImVec4(0.06f, 0.05f, 0.07f, 1.00f); 24 | style->Colors[ImGuiCol_PopupBg] = ImVec4(0.07f, 0.07f, 0.09f, 1.00f); 25 | style->Colors[ImGuiCol_Border] = ImVec4(0.80f, 0.80f, 0.83f, 0.88f); 26 | style->Colors[ImGuiCol_BorderShadow] = ImVec4(0.92f, 0.91f, 0.88f, 0.00f); 27 | style->Colors[ImGuiCol_FrameBg] = ImVec4(0.10f, 0.09f, 0.12f, 1.00f); 28 | style->Colors[ImGuiCol_FrameBgHovered] = ImVec4(0.24f, 0.23f, 0.29f, 1.00f); 29 | style->Colors[ImGuiCol_FrameBgActive] = ImVec4(0.56f, 0.56f, 0.58f, 1.00f); 30 | style->Colors[ImGuiCol_TitleBg] = ImVec4(0.10f, 0.09f, 0.12f, 1.00f); 31 | style->Colors[ImGuiCol_TitleBgCollapsed] = ImVec4(1.00f, 0.98f, 0.95f, 0.75f); 32 | style->Colors[ImGuiCol_TitleBgActive] = ImVec4(0.07f, 0.07f, 0.09f, 1.00f); 33 | style->Colors[ImGuiCol_MenuBarBg] = ImVec4(0.10f, 0.09f, 0.12f, 1.00f); 34 | style->Colors[ImGuiCol_ScrollbarBg] = ImVec4(0.10f, 0.09f, 0.12f, 1.00f); 35 | style->Colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.80f, 0.80f, 0.83f, 0.31f); 36 | style->Colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.56f, 0.56f, 0.58f, 1.00f); 37 | style->Colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.06f, 0.05f, 0.07f, 1.00f); 38 | style->Colors[ImGuiCol_CheckMark] = ImVec4(0.80f, 0.80f, 0.83f, 0.31f); 39 | style->Colors[ImGuiCol_SliderGrab] = ImVec4(0.80f, 0.80f, 0.83f, 0.31f); 40 | style->Colors[ImGuiCol_SliderGrabActive] = ImVec4(0.06f, 0.05f, 0.07f, 1.00f); 41 | style->Colors[ImGuiCol_Button] = ImVec4(0.10f, 0.09f, 0.12f, 1.00f); 42 | style->Colors[ImGuiCol_ButtonHovered] = ImVec4(0.24f, 0.23f, 0.29f, 1.00f); 43 | style->Colors[ImGuiCol_ButtonActive] = ImVec4(0.56f, 0.56f, 0.58f, 1.00f); 44 | style->Colors[ImGuiCol_Header] = ImVec4(0.10f, 0.09f, 0.12f, 1.00f); 45 | style->Colors[ImGuiCol_HeaderHovered] = ImVec4(0.56f, 0.56f, 0.58f, 1.00f); 46 | style->Colors[ImGuiCol_HeaderActive] = ImVec4(0.06f, 0.05f, 0.07f, 1.00f); 47 | style->Colors[ImGuiCol_ResizeGrip] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f); 48 | style->Colors[ImGuiCol_ResizeGripHovered] = ImVec4(0.56f, 0.56f, 0.58f, 1.00f); 49 | style->Colors[ImGuiCol_ResizeGripActive] = ImVec4(0.06f, 0.05f, 0.07f, 1.00f); 50 | style->Colors[ImGuiCol_PlotLines] = ImVec4(0.40f, 0.39f, 0.38f, 0.63f); 51 | style->Colors[ImGuiCol_PlotLinesHovered] = ImVec4(0.25f, 1.00f, 0.00f, 1.00f); 52 | style->Colors[ImGuiCol_PlotHistogram] = ImVec4(0.40f, 0.39f, 0.38f, 0.63f); 53 | style->Colors[ImGuiCol_PlotHistogramHovered] = ImVec4(0.25f, 1.00f, 0.00f, 1.00f); 54 | style->Colors[ImGuiCol_TextSelectedBg] = ImVec4(0.25f, 1.00f, 0.00f, 0.43f); 55 | style->Colors[ImGuiCol_ModalWindowDimBg] = ImVec4(1.00f, 0.98f, 0.95f, 0.73f); 56 | } 57 | 58 | void LoadFont(ImGuiIO io) { 59 | io.Fonts->AddFontFromFileTTF("C:/Windows/Fonts/calibrib.ttf", 13); 60 | io.Fonts->AddFontFromFileTTF("C:/Windows/Fonts/calibrib.ttf", 11); 61 | io.Fonts->AddFontFromFileTTF("C:/Windows/Fonts/calibrib.ttf", 15); 62 | io.Fonts->AddFontFromFileTTF("C:/Windows/Fonts/calibrib.ttf", 19); 63 | } -------------------------------------------------------------------------------- /Dainsleif/Player.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "Player.h" 3 | 4 | Player* Player::GetLocalPlayer() 5 | { 6 | return *reinterpret_cast(Modules::client + dwLocalPlayer); 7 | } 8 | 9 | std::vector Player::GetAll() 10 | { 11 | std::vector allPlayers; 12 | for (int i = 1; i <= GetMaxPlayers(); i++) 13 | { 14 | Entity* entity = Entity::GetByIndex(i); 15 | if (!entity || entity->GetClientClass()->m_ClassID != ClassID::CCSPlayer) 16 | { 17 | continue; 18 | } 19 | 20 | Player* player = entity->Cast(); 21 | allPlayers.push_back(player); 22 | } 23 | return allPlayers; 24 | } 25 | 26 | // FilterOutIrrelevant basically filter out the dead enemies and allies from playerList. 27 | void FilterOutIrrelevant(std::vector& playerList, Player* localPlayer) 28 | { 29 | for (int i = 0;i < static_cast(playerList.size());) { 30 | if (playerList[i]->GetTeam() == localPlayer->GetTeam() || !playerList[i]->GetHealth()) { 31 | playerList.erase(playerList.begin() + i); 32 | } else { 33 | ++i; 34 | } 35 | } 36 | } 37 | 38 | std::vector Player::GetLivingOpponents() { 39 | Player* localPlayer = GetLocalPlayer(); 40 | std::vector playerList = GetAll(); 41 | FilterOutIrrelevant(playerList, localPlayer); 42 | return playerList; 43 | } 44 | 45 | int Player::GetMaxPlayers() 46 | { 47 | uintptr_t clientState = *reinterpret_cast(Modules::engine + dwClientState); 48 | return *reinterpret_cast(clientState + dwClientState_MaxPlayer); 49 | } 50 | 51 | uintptr_t Player::GetBoneMatrix() 52 | { 53 | return ReadValue(m_dwBoneMatrix); 54 | } 55 | 56 | uintptr_t Player::GetGlowIndex() 57 | { 58 | return ReadValue(m_iGlowIndex); 59 | } 60 | 61 | Vector3 Player::GetBodyPosition() 62 | { 63 | return ReadValue(m_vecOrigin); 64 | } 65 | 66 | Vector3 Player::GetViewOffset() 67 | { 68 | return ReadValue(m_vecViewOffset); 69 | } 70 | 71 | Vector3 Player::GetAimPunchAngle() 72 | { 73 | return ReadValue(m_aimPunchAngle); 74 | } 75 | 76 | #define boneID 8 77 | Vector3 Player::GetBonePosition() 78 | { 79 | uintptr_t boneMatrix = GetBoneMatrix(); 80 | if (!boneMatrix) //When the game starts with bAimbot on, the game is gonna crash. 81 | { 82 | return {}; 83 | } 84 | return {*reinterpret_cast(boneMatrix + 0x30 * boneID + 0x0C), 85 | *reinterpret_cast(boneMatrix + 0x30 * boneID + 0x1C), 86 | *reinterpret_cast(boneMatrix + 0x30 * boneID + 0x2C)}; 87 | } 88 | 89 | Vector3 Player::GetHeadPosition() 90 | { 91 | return GetBodyPosition() + GetViewOffset(); 92 | } 93 | 94 | int Player::GetHealth() 95 | { 96 | return ReadValue(m_iHealth); 97 | } 98 | 99 | int Player::GetTeam() 100 | { 101 | return ReadValue(m_iTeamNum); 102 | } 103 | 104 | int Player::GetShotsFired() 105 | { 106 | return ReadValue(m_iShotsFired); 107 | } 108 | 109 | int Player::GetCrosshairID() 110 | { 111 | return ReadValue(m_iCrosshairId); 112 | } 113 | 114 | Weapon* Player::GetActiveWeapon() 115 | { 116 | uintptr_t activeWeaponHandle = ReadValue(m_hActiveWeapon); 117 | int index = (activeWeaponHandle & 0xFFF) - 1; 118 | return Entity::GetByIndex(index)->Cast(); 119 | } 120 | 121 | void Player::SetFOV(int fov) 122 | { 123 | if (this) 124 | WriteValue(m_iFOV, fov); 125 | } 126 | 127 | uintptr_t Player::GetFlags() 128 | { 129 | uintptr_t flags = ReadValue(m_fFlags); 130 | return flags; 131 | } 132 | 133 | bool Player::isScoped() 134 | { 135 | return ReadValue(m_bIsScoped); 136 | } 137 | -------------------------------------------------------------------------------- /Dainsleif/Hacks/Aimbot.cpp: -------------------------------------------------------------------------------- 1 | #include "Aimbot.h" 2 | 3 | const double PI = 3.14159265358; 4 | float aimSmoothness = 0.2f; 5 | float range; 6 | 7 | // sign() checks if the argument is positive or negative 8 | int sign(float A) 9 | { 10 | return (A > 0) - (A < 0); 11 | } 12 | 13 | float GetDistance(Vector3 targetPos, Vector3 basePos, Vector3& deltaVector) 14 | { 15 | deltaVector = targetPos - basePos; 16 | return sqrt(deltaVector.x * deltaVector.x + deltaVector.y * deltaVector.y + deltaVector.z * deltaVector.z); 17 | } 18 | 19 | Player* GetClosestEnemyFromCrosshair(std::vector playerList, Player* localPlayer) 20 | { 21 | float closestDistance = 1000000.f; 22 | int closestPlayerIndex = -1; 23 | auto* viewAngles = reinterpret_cast(*reinterpret_cast(Modules::engine + dwClientState) + dwClientState_ViewAngles); 24 | for (int i = 0; i < playerList.size(); ++i) 25 | { 26 | Vector3 delta{}; 27 | 28 | if (!playerList[i]->GetBoneMatrix()) continue; //null pointer check 29 | 30 | Vector3 playerHeadPosition = playerList[i]->GetBonePosition(); 31 | 32 | GetDistance(playerHeadPosition, localPlayer->GetHeadPosition(), delta); 33 | float yaw = atan2(delta.y, delta.x) * (180 / static_cast(PI)); 34 | float yawDistance = fabs(yaw - viewAngles->y); 35 | 36 | if (yawDistance < closestDistance) { 37 | closestDistance = yawDistance; 38 | closestPlayerIndex = i; 39 | } 40 | } 41 | if (closestPlayerIndex == -1 || playerList[closestPlayerIndex]->IsDormant()) 42 | { 43 | return nullptr; 44 | } 45 | return playerList[closestPlayerIndex]; 46 | } 47 | 48 | void Aimbot::Run(std::vector playerList) 49 | { 50 | 51 | Player* localPlayer = Player::GetLocalPlayer(); 52 | static const WeaponID rejectWeaponList[11] = { KNIFE, C4, GN_DECOY, GN_FLASH_, GN_HE, GN_MOLOTOV, GN_SMOKE, SR_SSG08, SR_AWP, SR_G3SG1 }; 53 | Weapon* activeWeapon = localPlayer->GetActiveWeapon(); 54 | WeaponID activeWeaponID = activeWeapon->GetWeaponID(); 55 | for (WeaponID rejW : rejectWeaponList) { 56 | if (rejW == activeWeaponID) { 57 | return; 58 | } 59 | } 60 | static auto* viewAngles = reinterpret_cast(*reinterpret_cast(Modules::engine + dwClientState) + dwClientState_ViewAngles); 61 | 62 | Player* closestEnt = GetClosestEnemyFromCrosshair(playerList, localPlayer); 63 | if (!closestEnt) 64 | return; 65 | 66 | Vector3 delta{}; 67 | float hypotenuse = GetDistance(closestEnt->GetBonePosition(), localPlayer->GetHeadPosition(), delta); 68 | float pitch = -asin(delta.z / hypotenuse) * (180 / static_cast(PI)); 69 | float yaw = atan2(delta.y, delta.x) * (180 / static_cast(PI)); 70 | 71 | if (pitch >= -89 && pitch <= 89 && yaw >= -180 && yaw <= 180) 72 | { 73 | float pitchDistance = fabs(pitch - viewAngles->x); 74 | float yawDistance = fabs(yaw - viewAngles->y); 75 | if (pitchDistance >= range || yawDistance >= range) { 76 | return; 77 | } 78 | 79 | float num = aimSmoothness / max(pitchDistance, yawDistance); 80 | float x = num * min(pitchDistance, yawDistance); 81 | 82 | /* 83 | aimSmoothness is a base of how smooth the aim pulling should be. 84 | num * max == 0.5f. 85 | Bigger:0.5 = Smoller:x 86 | */ 87 | float pf, yf; 88 | if (pitchDistance > yawDistance) 89 | { 90 | pf = aimSmoothness; 91 | yf = x; 92 | } 93 | else { 94 | pf = x; 95 | yf = aimSmoothness; 96 | } 97 | 98 | float rangeAimFix = aimSmoothness * 0.5f; //rangeAimFix holds the value representing area around enemy's head that allows viewAngle to be free. 99 | if (aimSmoothness <= 0.2) 100 | rangeAimFix = 0.1f; 101 | 102 | if (pitchDistance > rangeAimFix) { 103 | if (viewAngles->x < pitch) //my view is smaller than pitch. 104 | { 105 | viewAngles->x += pf; 106 | } 107 | else if (viewAngles->x > pitch) 108 | { 109 | viewAngles->x -= pf; 110 | } 111 | } 112 | 113 | if (yawDistance > rangeAimFix) { 114 | if (viewAngles->y < yaw) 115 | { 116 | if (sign(viewAngles->y) == -1 && sign(yaw) == 1 && viewAngles->y <= -90) //When yaw is like 170 and viewAngle steps over -180 117 | { 118 | viewAngles->y -= yf; 119 | } 120 | else { 121 | viewAngles->y += yf; 122 | } 123 | } 124 | else if (viewAngles->y > yaw) { 125 | if (sign(viewAngles->y) == 1 && sign(yaw) == -1 && viewAngles->y >= 90) //When yaw is like -170 and viewAngle steps over 180 126 | { 127 | viewAngles->y += yf; 128 | } 129 | else { 130 | viewAngles->y -= yf; 131 | } 132 | 133 | } 134 | } 135 | } 136 | } -------------------------------------------------------------------------------- /Dainsleif/Hacks/Esp.cpp: -------------------------------------------------------------------------------- 1 | #include "Esp.h" 2 | #include 3 | 4 | std::optional WorldToScreen(Vector3 entPos, WindowSize& windowSize) { 5 | float viewMatrix[4][4]; 6 | memcpy(&viewMatrix, (PBYTE*)(Modules::client + dwViewMatrix), sizeof(viewMatrix)); 7 | Vector4 clipCoords{}; 8 | clipCoords.x = entPos.x * viewMatrix[0][0] + entPos.y * viewMatrix[0][1] + entPos.z * viewMatrix[0][2] + viewMatrix[0][3]; 9 | clipCoords.y = entPos.x * viewMatrix[1][0] + entPos.y * viewMatrix[1][1] + entPos.z * viewMatrix[1][2] + viewMatrix[1][3]; 10 | clipCoords.z = entPos.x * viewMatrix[2][0] + entPos.y * viewMatrix[2][1] + entPos.z * viewMatrix[2][2] + viewMatrix[2][3]; 11 | clipCoords.w = entPos.x * viewMatrix[3][0] + entPos.y * viewMatrix[3][1] + entPos.z * viewMatrix[3][2] + viewMatrix[3][3]; 12 | 13 | if (clipCoords.w < 0.1f) 14 | return {}; 15 | 16 | Vector3 NDC{}; 17 | NDC.x = clipCoords.x / clipCoords.w; 18 | NDC.y = clipCoords.y / clipCoords.w; 19 | NDC.z = clipCoords.z / clipCoords.w; 20 | std::optional screen = Vector2{}; 21 | screen->x = (windowSize.w / 2 * NDC.x) + (NDC.x + windowSize.w / 2); 22 | screen->y = -(windowSize.h / 2 * NDC.y) + (NDC.y + windowSize.h / 2); 23 | return screen; 24 | } 25 | 26 | void Esp::DrawLine(int x1, int y1, int x2, int y2, int thickness, D3DCOLOR color) { 27 | ID3DXLine* LineL; 28 | D3DXCreateLine(&this->pDevice, &LineL); 29 | 30 | D3DXVECTOR2 Line[2]; 31 | Line[0] = D3DXVECTOR2(x1, y1); 32 | Line[1] = D3DXVECTOR2(x2, y2); 33 | LineL->SetWidth(thickness); 34 | LineL->Draw(Line, 2, color); 35 | LineL->Release(); 36 | } 37 | 38 | void Esp::DrawOutLineRect(Vector2 top, Vector2 bottom, int thickness, D3DCOLOR color) { 39 | ID3DXLine* LineL; 40 | D3DXCreateLine(&this->pDevice, &LineL); 41 | 42 | float height = fabs(top.y - bottom.y); 43 | 44 | // apparently, height / 2 is the horizontal length of the rectangle. 45 | // top.x and bottom.x is located at the center of the entity 46 | // so x coordinate -(+) height / 4 should be the left and right end of the rectangle. 47 | D3DXVECTOR2 topLine[2] = {D3DXVECTOR2(top.x - height / 4, top.y), D3DXVECTOR2(top.x + height / 4, top.y)}; 48 | D3DXVECTOR2 bottomLine[2] = {D3DXVECTOR2(bottom.x - height / 4, bottom.y), D3DXVECTOR2(bottom.x + height / 4, bottom.y)}; 49 | D3DXVECTOR2 rightLine[2] = {D3DXVECTOR2(top.x + height / 4, top.y), D3DXVECTOR2(bottom.x + height / 4, bottom.y)}; 50 | D3DXVECTOR2 leftLine[2] = {D3DXVECTOR2(top.x - height / 4, top.y), D3DXVECTOR2(bottom.x - height / 4, bottom.y)}; 51 | 52 | LineL->SetWidth(thickness); 53 | LineL->Draw(topLine, 2, color); 54 | LineL->Draw(bottomLine, 2, color); 55 | LineL->Draw(rightLine, 2, color); 56 | LineL->Draw(leftLine, 2, color); 57 | LineL->Release(); 58 | } 59 | 60 | void Esp::DrawFilledRect(Vector2 top, Vector2 bottom, D3DCOLOR color) { 61 | float height = fabs(top.y - bottom.y); 62 | 63 | LONG width = (static_cast(bottom.x + height / 4)) - (static_cast(top.x + height / 4)); 64 | 65 | D3DRECT rect = {static_cast(top.x + height / 4), static_cast(top.y), static_cast(bottom.x + height / 4), static_cast(bottom.y)}; 66 | this->pDevice.Clear(1, &rect, D3DCLEAR_TARGET, color, 0, 0); 67 | } 68 | 69 | void Esp::LineOverlay() { 70 | for (auto& player : this->playerList) { 71 | if (player->GetHealth() && !player->IsDormant()) { 72 | std::optional entFootPos2D = WorldToScreen(player->GetBodyPosition(), this->windowSize); 73 | if (entFootPos2D) { 74 | D3DCOLOR color; 75 | if (player->GetTeam() == this->localTeamNum) 76 | color = D3DCOLOR_ARGB(255, 0, 255, 0); 77 | else 78 | color = D3DCOLOR_ARGB(255, 255, 0, 0); 79 | DrawLine(entFootPos2D->x, entFootPos2D->y, windowSize.w / 2, windowSize.h, 2, color); 80 | } 81 | } 82 | } 83 | } 84 | 85 | void Esp::RectangleOverlay() { 86 | for (auto& player : this->playerList) { 87 | if (player->GetHealth() && !player->IsDormant()) { 88 | std::optional entHeadPos2D = WorldToScreen(player->GetBonePosition(), this->windowSize); 89 | std::optional entFootPos2D = WorldToScreen(player->GetBodyPosition(), this->windowSize); 90 | if (entHeadPos2D && entFootPos2D) { 91 | D3DCOLOR color; 92 | if (player->GetTeam() == this->localTeamNum) 93 | color = D3DCOLOR_ARGB(255, 0, 255, 0); 94 | else 95 | color = D3DCOLOR_ARGB(255, 255, 0, 0); 96 | DrawOutLineRect(*entHeadPos2D, *entFootPos2D, 1, color); 97 | } 98 | } 99 | } 100 | } 101 | 102 | void Esp::HealthOverlay() { 103 | for (auto& player : this->playerList) { 104 | if (player->GetHealth() && !player->IsDormant()) { 105 | std::optional entHeadPos2D = WorldToScreen(player->GetBonePosition(), this->windowSize); 106 | std::optional entFootPos2D = WorldToScreen(player->GetBodyPosition(), this->windowSize); 107 | if (entHeadPos2D && entFootPos2D) { 108 | this->DrawFilledRect(*entHeadPos2D, *entFootPos2D, D3DCOLOR_ARGB(255, 255, 51, 51)); 109 | } 110 | } 111 | } 112 | } -------------------------------------------------------------------------------- /README_jp.md: -------------------------------------------------------------------------------- 1 | ![cpp](https://img.shields.io/badge/C%2B%2B-17-%23ff40d9.svg?style=flat) 2 | ![cmake](https://img.shields.io/badge/cmake-3.16-yellow) 3 | ![Game](https://img.shields.io/badge/Game-CS%3AGO-blue.svg?style=flat) 4 | ![License](http://img.shields.io/badge/license-MIT-yellowgreen.svg?style=flat) 5 | 6 | **[README in English](https://github.com/s3pt3mb3r/Dainsleif/blob/master/README.md)** 7 | 8 | ![Banner](https://user-images.githubusercontent.com/33578715/90953346-22056a00-e49d-11ea-9b63-56f33187e667.png) 9 | この絵は僕の親友である[@suzuharuR](https://twitter.com/suzuharuR)から頂いたものです。 10 | 11 | # :zap: Dainsleif 12 | 13 | まず初めに、もしこのプロジェクトが気に入ったら **:star: 星 :star:** をつけてくださると幸いです。 14 | 15 | Dainsleifは _Counter-Strike: Global Offensive_ 用のチートプログラムです。 16 | ただし、これはあくまでも僕の個人的な知識欲で作っているものであって実戦(マルチプレイヤーモード)で使うことは想定されていません。 17 | 明示的な対策を行っているわけではないのでBANされる可能性が多分にあります。 **このソフトウェアによって発生したいかなる問題に対しても、開発者一同は責任を負いかねます。** 注意してご使用ください。 18 | ただ、ボット戦で使うことは可能ですし、実際のチートと同じ手法で作られていてとてもシンプルなためコードの参考にはなるかと思います。 19 | 20 | もしこのプロジェクトについて質問等ありましたら気軽に [issue](https://github.com/s3pt3mb3r/Dainsleif/issues) ください! 21 | 暇なのですぐ答えます。 22 | 23 | # :two_hearts: サポート 24 | このプロジェクトにStarする、このアカウントをフォローする、プルリクエストを送るなどしていただけるととても励みになります。 25 | 26 | # :pushpin: 目次 27 | 28 | - [:syringe: ビルド方法](#syringe-ビルド方法) 29 | - [:rotating_light: トラブルシューティング](#rotating_light-トラブルシューティング) 30 | - [:scroll: ハックメニュー](#scroll-ハックメニュー) 31 | - [:computer: ハック](#computer-ハック) 32 | - [エイムボット](#エイムボットaimbot) 33 | - [発光ハック](#発光ハックglow-hack) 34 | - [ESPハック](#ESPハックesp) 35 | - [トリガーボット](#トリガーボットtrigger-bot) 36 | - [アンチリコイル](#アンチリコイルanti-recoil) 37 | - [ミニマップハック](#ミニマップハックminimap-hack) 38 | - [視野角調整](#視野角調整field-of-view) 39 | - [アンチ放置キック](#アンチ放置キックanti-afk) 40 | - [:busts_in_silhouette: 共同開発者](#busts_in_silhouette-共同開発者) 41 | 42 | # :syringe: ビルド方法 43 | 44 | 必要なもの 45 | - [DirectxSDK](https://www.microsoft.com/en-au/download/details.aspx?id=6812) 46 | - Visual Studio 2019 47 | 48 | DirectxSDKとVisual Studio以外の必要なものはあらかじめ含まれているため用意する必要はありません。 49 | 50 | Visual Studioをインストールした際に自動で追加される、Developer Command Prompt for Visual Studioを開いてください。 51 | 52 | その上で、お好きなフォルダー内で以下のコマンドを実行してください。 53 | 54 | ```Shell 55 | $ git clone https://github.com/s3pt3mb3r/Dainsleif.git --recursive 56 | $ cd Dainsleif 57 | ``` 58 | 59 | ビルドに必要なコマンドをバッチファイルにまとめてあるので、あとはそれを叩けば自動でビルドしてくれます。 60 | 61 | ```Shell 62 | $ .\compile.bat 63 | ``` 64 | 65 | これでdebugフォルダの中に`Dainsleif.dll` が生成されるはずです。 66 | 67 | `Dainsleif.dll`を生成出来たら、あとは [GH injector](https://guidedhacking.com/resources/guided-hacking-dll-injector.4/) などのお好きなDLL injectorを使ってインジェクトしてください。 68 | 69 | # :rotating_light: トラブルシューティング 70 | 71 | ハックがうまく動きませんか? 大丈夫です、そんなときのために[Wiki](https://github.com/s3pt3mb3r/Dainsleif/wiki/Trouble-shooting)を用意してあります。 72 | 73 | # :scroll: ハックメニュー 74 | 75 | ハックメニューへはINSERTキーを押すことでアクセスできます。 76 | 77 | 各タブを押すことで各ハックのオン/オフや細かい調整ができます。 78 | 調整項目はこれから増やしていく予定です。 79 | 80 | ![Hack menu](https://user-images.githubusercontent.com/33578715/89070761-09c39300-d3a8-11ea-9aac-18cf2749b622.gif) 81 | 82 | メニューバーからタブのオンオフを切り替えることができます。 83 | いくつかのハックはデフォルトでオフになっています。 84 | ![menu visible](https://user-images.githubusercontent.com/33578715/91351549-0f7f8d80-e81b-11ea-9216-e7d77a0566d1.png) 85 | 86 | # :computer: ハック 87 | 88 | ## エイムボット (Aimbot) 89 | 90 | これが、現在のDainsleifの機能の中で一番完成度が高いです。(自負) 91 | 92 | この機能をオンにすると、クロスヘアから一番近い敵の頭にエイムが吸い付きます。 93 | Smoothnessという項目を変えると、吸い付きのゆるふわ度を変えることができます。 94 | Rangeの項目を変えると、エイムボットが反応する範囲を変えることができます。 95 | 96 | ![aimbot](https://user-images.githubusercontent.com/33578715/89108283-b31e8d80-d469-11ea-8e55-e4e469d74576.gif) 97 | 98 | ## 発光ハック (Glow hack) 99 | 100 | この機能をオンにすると、敵と味方の輪郭が光り壁を通して見れるようになります。簡単に言うとウォールハックですね。 101 | 102 | 敵と味方の光る色はハックメニューから自由にカスタマイズできます。 103 | 104 | ![Glow hack](https://user-images.githubusercontent.com/33578715/89087560-48b51100-d3c7-11ea-9ada-8ef04acfa52c.png) 105 | 106 | ## ESPハック (Esp) 107 | 108 | これはESPハックです。味方や敵に対して長方形のオーバーレイを表示します。 109 | 110 | また、自分から各プレイヤーに対して直線を引きます。 111 | 112 | ![esp](https://user-images.githubusercontent.com/33578715/92253522-30726d80-ef02-11ea-80d3-fdb7045851d0.png) 113 | 114 | ## トリガーボット(Trigger bot) 115 | 116 | これは、クロスヘアが敵と重なった瞬間に自動的に発砲するようになるハックです。 117 | 118 | 一応エイムボットと併用して使うことを想定してデザインされています。今後単体でも十分使えるように改良していきます。 119 | 120 | ## アンチリコイル(Anti recoil) 121 | 122 | これは、銃を発砲する際などに発生するリコイルを自動で制御してくれるハックです。 123 | 124 | ただ、100%完全に集弾するわけではありません。 125 | 126 | 実際のスプレー結果↓ 127 | 128 | ![Anti recoil](https://user-images.githubusercontent.com/33578715/89087634-769a5580-d3c7-11ea-83b1-dc31345e7424.png) 129 | 130 | ## ミニマップハック(Minimap hack) 131 | 132 | ミニマップハックは全ての敵をミニマップ上で赤点でとして表示してくれます。 133 | 通常のCSGOなら赤点は敵がプレイヤーの視野内に入った場合のみに表示されますが、このハックを使うと視野の外の敵や壁越しの敵を赤点で表示することができます。 134 | 135 | ![Minimap hack](https://user-images.githubusercontent.com/33578715/96349413-0c4da300-10e2-11eb-8ba9-b1965b1a7dfb.png) 136 | 137 | ## 視野角調整(Field of view) 138 | 139 | このハックでは、本来変更できないプレイヤーの視野角を60~120まで調整できるようにするものです。 140 | 141 | ## アンチ放置キック(Anti AFK) 142 | 143 | このハックをオンにすると、50秒ごとにプレイヤーを自動で動かすことによって放置キックされないようなります。 144 | 145 | # :busts_in_silhouette: アンインストール 146 | 147 | このチートは設定ファイルを生成するため、綺麗にアンインストールするには以下のフォルダを削除する必要があります。 148 | 149 | `C:\Users\Public\Documents\Dainsleif` 150 | 151 | もちろんexeファイル本体の削除もお忘れなく。 152 | 153 | # :busts_in_silhouette: 共同開発者 154 | 155 | 彼なしでは間違いなくここまで来れませんでした。感謝します。 ([emoji key](https://allcontributors.org/docs/en/emoji-key)): 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 |

L1m0n3

💻 🚧
165 | 166 | 167 | 168 | 169 | -------------------------------------------------------------------------------- /Dainsleif/Hook/GraphicHook.cpp: -------------------------------------------------------------------------------- 1 | #include "GraphicHook.h" 2 | 3 | #include "../Interfaces/CInterfaceList.h" 4 | #include "../Hacks/Esp.h" 5 | #include "../dllmain.h" 6 | 7 | namespace HackFlags 8 | { 9 | bool bEsp, bLineOverlay, bRectOverlay; 10 | } 11 | 12 | extern bool inGame; //decleard in dllmain.cpp 13 | 14 | extern IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler ( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ); 15 | 16 | using FnEndScene = HRESULT (__stdcall*)(IDirect3DDevice9* pDevice); 17 | FnEndScene originalEndScene = nullptr; //An original endscene which is null now. 18 | 19 | using FnReset = HRESULT (__stdcall*)(IDirect3DDevice9* pDevice, D3DPRESENT_PARAMETERS* pPresentationParameters); 20 | FnReset originalReset = nullptr; 21 | 22 | HWND window = nullptr; 23 | WNDPROC originalWndProc = nullptr; 24 | 25 | LRESULT WINAPI WndProc ( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ) 26 | { 27 | if ( g_ShowMenu ) 28 | { 29 | if ( ImGui_ImplWin32_WndProcHandler ( hWnd, msg, wParam, lParam ) ) 30 | return true; 31 | 32 | if ( g_csgo.engine->IsActiveApp ( ) ) 33 | { 34 | switch ( msg ) 35 | { 36 | case WM_KEYDOWN: 37 | case WM_KEYUP: 38 | case WM_MOUSEHWHEEL: 39 | case WM_MOUSEACTIVATE: 40 | case WM_MOVE: 41 | case WM_MOVING: 42 | case WM_MOUSEMOVE: 43 | case WM_NCMOUSEMOVE: 44 | case WM_SYSKEYDOWN: 45 | case WM_SYSKEYUP: 46 | case WM_CHAR: 47 | case WM_DEADCHAR: 48 | case WM_SYSCHAR: 49 | case WM_SYSDEADCHAR: 50 | case WM_RBUTTONUP: 51 | case WM_LBUTTONDOWN: 52 | case WM_LBUTTONUP: 53 | case WM_LBUTTONDBLCLK: 54 | case WM_RBUTTONDOWN: 55 | case WM_RBUTTONDBLCLK: 56 | case WM_MBUTTONDOWN: 57 | case WM_MBUTTONUP: 58 | case WM_MBUTTONDBLCLK: 59 | case WM_MOUSEWHEEL: 60 | return 0; 61 | 62 | default: ; 63 | } 64 | } 65 | } 66 | return CallWindowProc ( originalWndProc, hWnd, msg, wParam, lParam ); 67 | } 68 | 69 | void InitImGui ( IDirect3DDevice9* pDevice ) 70 | { 71 | IMGUI_CHECKVERSION ( ); 72 | ImGui::CreateContext ( ); 73 | ImGui::CreateContext ( ); 74 | ImGuiIO& io = ImGui::GetIO ( ); 75 | LoadFont ( io ); 76 | 77 | ImGui::StyleColorsDark ( ); 78 | 79 | ImGui_ImplWin32_Init ( window ); 80 | ImGui_ImplDX9_Init ( pDevice ); 81 | } 82 | 83 | void ShutdownImGui ( ) 84 | { 85 | ImGui_ImplDX9_Shutdown ( ); 86 | ImGui_ImplWin32_Shutdown ( ); 87 | ImGui::DestroyContext ( ); 88 | } 89 | 90 | WindowSize GetWindowSize ( ) 91 | { 92 | RECT size; 93 | WindowSize windowSize{ }; 94 | GetWindowRect ( window, &size ); 95 | windowSize.w = size.right - size.left; 96 | windowSize.w -= 5; //removing pixels sidebar has. 97 | windowSize.h = size.bottom - size.top; 98 | windowSize.h -= 29; //removing pixels topbar has. 99 | return windowSize; 100 | } 101 | 102 | extern std::map< std::string, bool > visibleHacks; 103 | 104 | HRESULT __stdcall HookedEndScene ( IDirect3DDevice9* pDevice ) //A function containing a bunch of rendering process, that is gonna be hooked. 105 | { 106 | static Player* oldLocalPlayer = nullptr; 107 | Player* localPlayer = Player::GetLocalPlayer ( ); 108 | int gameState = *reinterpret_cast< int* > ( *reinterpret_cast< uintptr_t* > ( Modules::engine + dwClientState ) + dwClientState_State ); 109 | 110 | if ( localPlayer != oldLocalPlayer && localPlayer && HackFlags::bEsp ) 111 | { 112 | std::vector< Player* > playerList = Player::GetAll ( ); 113 | WindowSize ws = GetWindowSize ( ); 114 | Esp esp = Esp ( localPlayer->GetTeam ( ), playerList, *pDevice, ws ); 115 | if ( HackFlags::bLineOverlay ) 116 | { 117 | esp.LineOverlay ( ); 118 | } 119 | 120 | if ( HackFlags::bRectOverlay ) 121 | esp.RectangleOverlay ( ); 122 | } 123 | 124 | if ( gameState != 6 && inGame ) 125 | { 126 | oldLocalPlayer = localPlayer; 127 | inGame = false; 128 | } 129 | 130 | 131 | if ( g_ShowMenu ) 132 | { 133 | ImGui_ImplDX9_NewFrame ( ); 134 | ImGui_ImplWin32_NewFrame ( ); 135 | ImGui::NewFrame ( ); 136 | 137 | LoadTheme ( ); 138 | 139 | ImGuiWindowFlags window_flags = ImGuiWindowFlags_MenuBar; 140 | ImGui::Begin ( "Dainsleif", &g_ShowMenu, window_flags ); 141 | 142 | ShowMenuBar ( visibleHacks ); //tab 143 | 144 | ShowTabMenu ( visibleHacks ); //main view 145 | 146 | 147 | ImGui::Separator ( ); 148 | ImGui::Spacing ( ); 149 | ImGui::Spacing ( ); 150 | ImGui::Spacing ( ); 151 | HelpMarker ( "[HACK NOT WORKING?]", "Click \"Update offset\" in the menu bar" ); 152 | ImGui::End ( ); 153 | 154 | ImGui::EndFrame ( ); 155 | ImGui::Render ( ); 156 | ImGui_ImplDX9_RenderDrawData ( ImGui::GetDrawData ( ) ); 157 | } 158 | return originalEndScene ( pDevice ); 159 | } 160 | 161 | HRESULT __stdcall HookedReset(IDirect3DDevice9* pDevice, D3DPRESENT_PARAMETERS* pPresentationParameters) { 162 | ImGui_ImplDX9_InvalidateDeviceObjects(); 163 | 164 | HRESULT result = originalReset(pDevice, pPresentationParameters); 165 | if (result == D3D_OK) 166 | { 167 | ImGui_ImplDX9_CreateDeviceObjects(); 168 | } 169 | 170 | return result; 171 | } 172 | 173 | void InitializeGraphicHook ( ) 174 | { 175 | auto shaderapidx9 = reinterpret_cast< uintptr_t > ( GetModuleHandle ( "shaderapidx9.dll" ) ); 176 | IDirect3DDevice9* pDevice = *reinterpret_cast< IDirect3DDevice9** > ( shaderapidx9 + dwppDirect3DDevice9 ); 177 | 178 | D3DDEVICE_CREATION_PARAMETERS parameters; 179 | pDevice->GetCreationParameters ( ¶meters ); 180 | 181 | window = parameters.hFocusWindow; 182 | originalWndProc = reinterpret_cast< WNDPROC > ( SetWindowLongPtr ( window, GWLP_WNDPROC, reinterpret_cast< LONG_PTR > ( WndProc ) ) ); 183 | 184 | InitImGui ( pDevice ); 185 | 186 | void* endScene = Utils::GetVirtualFunction(pDevice, 42); 187 | if (MH_CreateHookEx(endScene, &HookedEndScene, &originalEndScene) != MH_OK) 188 | { 189 | throw std::runtime_error("Failed to hook EndScene!"); 190 | } 191 | 192 | void* reset = Utils::GetVirtualFunction(pDevice, 16); 193 | if (MH_CreateHookEx(reset, &HookedReset, &originalReset) != MH_OK) 194 | { 195 | throw std::runtime_error("Failed to hook Reset!"); 196 | } 197 | } 198 | 199 | void ShutDownGraphicHook ( ) 200 | { 201 | SetWindowLong ( window, GWL_WNDPROC, reinterpret_cast< LONG > ( originalWndProc ) ); 202 | 203 | ShutdownImGui ( ); 204 | } 205 | -------------------------------------------------------------------------------- /Dainsleif/dllmain.cpp: -------------------------------------------------------------------------------- 1 | #include "dllmain.h" 2 | #include "pch.h" 3 | #include "Hook/Hooks.h" 4 | #include "Interfaces/CInterfaceList.h" 5 | 6 | namespace HackFlags 7 | { 8 | bool bQuit, bAimbot, bGlowHack, bAntiRecoil, bTriggerBot, bBunnyhop, bAntiAFK, bMinimapHack; 9 | } 10 | 11 | namespace TabFlags 12 | { 13 | bool t_aimBot = true, t_glowHack = true, t_antiRecoil = true, t_triggerBot = true, t_bunnyHop = true, t_antiAFK, t_fov, t_esp, t_minimapHack; 14 | } 15 | 16 | int fov; 17 | bool g_ShowMenu = false; 18 | bool inGame = false; 19 | 20 | std::string settingsFile; 21 | std::string offsetsFile; 22 | std::string tabStateFile; 23 | 24 | VOID WINAPI Detach ( ) 25 | { 26 | Hooks::Restore(); 27 | 28 | FREECONSOLE ( ); 29 | } 30 | 31 | std::map< std::string, bool > visibleHacks; 32 | 33 | int loadSettingsFiles() { 34 | 35 | TCHAR dir[ MAX_PATH ]; 36 | 37 | SHGetSpecialFolderPath ( NULL, dir, CSIDL_COMMON_DOCUMENTS, 0 ); //Find the Document directory location 38 | 39 | settingsFile = static_cast< std::string > ( dir ) + "/Dainsleif/savedata.toml"; //Set file path. 40 | offsetsFile = static_cast< std::string > ( dir ) + "/Dainsleif/offsets.toml"; 41 | tabStateFile = static_cast< std::string > ( dir ) + "/Dainsleif/tabstate.toml"; 42 | 43 | std::filesystem::path path1{ settingsFile }, path2{ offsetsFile }, path3{ tabStateFile }; 44 | std::filesystem::create_directories ( path1.parent_path ( ) ); 45 | 46 | if ( !std::filesystem::exists ( path1 ) ) 47 | { 48 | std::ofstream stream{ path1 }; 49 | stream.close ( ); 50 | LOGHEX("error loading file savedata.toml", 1); 51 | } 52 | 53 | if ( !std::filesystem::exists ( path2 ) ) 54 | { 55 | std::ofstream stream{ path2 }; 56 | OffsetsToml::Initialize ( offsetsFile ); 57 | stream.close ( ); 58 | LOGHEX("error loading file offsets.toml", 2); 59 | } 60 | 61 | if ( !std::filesystem::exists ( path3 ) ) 62 | { 63 | std::ofstream stream{ path3 }; 64 | stream.close ( ); 65 | LOGHEX("error loading file tabstate.toml", 3); 66 | } 67 | 68 | SettingsToml::Fetch ( settingsFile ); 69 | OffsetsToml::Fetch ( offsetsFile ); 70 | TabStateToml::Fetch ( tabStateFile ); 71 | return 0; 72 | } 73 | 74 | DWORD WINAPI fMain ( LPVOID lpParameter ) 75 | { 76 | ALLOCCONSOLE ( ); 77 | 78 | loadSettingsFiles(); 79 | 80 | visibleHacks = { 81 | { "Aim Bot", TabFlags::t_aimBot }, 82 | { "Glow Hack", TabFlags::t_glowHack }, 83 | { "Anti Recoil", TabFlags::t_antiRecoil }, 84 | { "Trigger Bot", TabFlags::t_triggerBot }, 85 | { "Bunnyhop", TabFlags::t_bunnyHop }, 86 | { "Anti AFK", TabFlags::t_antiAFK }, 87 | { "Fov", TabFlags::t_fov }, 88 | { "Esp", TabFlags::t_esp }, 89 | { "Minimap Hack", TabFlags::t_minimapHack } 90 | }; 91 | 92 | Modules::Initialize ( ); 93 | 94 | dwClientState = PatternScanner ( "engine.dll", "\xA1????\x8B?????\x85?\x74?\x8B?", 1 ).CalculateOffset ( Modules::engine, 0 ); 95 | 96 | LOGHEX ("client.dll", Modules::client); 97 | LOGHEX ("engine.dll", Modules::engine); 98 | 99 | g_csgo.Initialize(); 100 | 101 | Hooks::Initialize(); 102 | 103 | std::vector< Player* > playerList; 104 | 105 | //MUST save this to use as a flag cuz the value of local player's gonna be stored at the same address even the match ended. 106 | Player* oldLocalPlayer = nullptr; 107 | 108 | bool checkState_bAntiAFK = false; 109 | 110 | //Hack loop entry point. 111 | while (!(GetAsyncKeyState(VK_DELETE) & 1 || HackFlags::bQuit)) 112 | { 113 | int gameState = *reinterpret_cast( *reinterpret_cast(Modules::engine + dwClientState) + dwClientState_State); 114 | 115 | Player* localPlayer = Player::GetLocalPlayer(); 116 | 117 | if ( gameState != 6 && inGame ) 118 | { //Not 6 means user's in menu.//true means user used to be in game. 119 | SettingsToml::Save (settingsFile); 120 | TabStateToml::Save (tabStateFile); 121 | oldLocalPlayer = localPlayer; 122 | inGame = false; 123 | } 124 | 125 | if (GetAsyncKeyState (VK_INSERT) & 1) 126 | { 127 | g_ShowMenu = !g_ShowMenu; 128 | if (!g_ShowMenu) 129 | { 130 | SettingsToml::Save (settingsFile); 131 | TabStateToml::Save (tabStateFile); 132 | } 133 | } 134 | 135 | if (gameState != 6 || !localPlayer || localPlayer == oldLocalPlayer) 136 | continue; 137 | 138 | if (!localPlayer->GetActiveWeapon()) 139 | continue; 140 | 141 | //If we have values to set in initializing phase, have to be written here. 142 | if (!inGame) 143 | { 144 | inGame = true; 145 | } 146 | 147 | if (HackFlags::bBunnyhop && GetAsyncKeyState(VK_SPACE)) 148 | { 149 | Bhop::Run(); 150 | } 151 | 152 | if (HackFlags::bTriggerBot || HackFlags::bGlowHack || HackFlags::bAntiRecoil) 153 | { 154 | playerList = Player::GetAll(); 155 | } 156 | 157 | if (HackFlags::bTriggerBot) 158 | { 159 | Triggerbot::Run(); 160 | } 161 | 162 | if (HackFlags::bGlowHack) 163 | { 164 | for (Player* player : playerList) 165 | { 166 | Glow::Run (player); 167 | } 168 | } 169 | 170 | if (HackFlags::bAntiRecoil) 171 | { 172 | AntiRecoil::Run(); 173 | } 174 | 175 | std::vector< Player* > pl = Player::GetLivingOpponents (); 176 | 177 | if (HackFlags::bAimbot) 178 | { 179 | Aimbot::Run (pl); 180 | } 181 | 182 | if (HackFlags::bMinimapHack) 183 | { 184 | Minimap::Run (pl); 185 | } 186 | 187 | if ( !checkState_bAntiAFK && HackFlags::bAntiAFK ) 188 | { //First loop after user ticks the checkbox. 189 | std::thread worker ( AntiAFK::Run, &HackFlags::bAntiAFK ); 190 | worker.detach ( ); 191 | checkState_bAntiAFK = true; 192 | } 193 | else if ( checkState_bAntiAFK && !HackFlags::bAntiAFK ) 194 | { //First loop after user unticks the checkbox. 195 | checkState_bAntiAFK = false; 196 | } 197 | 198 | Sleep ( 1 ); //sleep for performance aspect 199 | } 200 | 201 | SettingsToml::Save(settingsFile); 202 | TabStateToml::Save(tabStateFile); 203 | 204 | FreeLibraryAndExitThread ( static_cast< HMODULE > ( lpParameter ), EXIT_SUCCESS ); 205 | } 206 | 207 | BOOL APIENTRY DllMain ( HMODULE hModule, DWORD dwReason, LPVOID lpReserved ) 208 | { 209 | if ( dwReason == DLL_PROCESS_ATTACH ) 210 | { 211 | DisableThreadLibraryCalls ( hModule ); 212 | 213 | HANDLE hThread = CreateThread ( nullptr, 0, fMain, hModule, 0, nullptr ); 214 | if ( hThread ) 215 | { 216 | CloseHandle ( hThread ); 217 | } 218 | } 219 | else if ( dwReason == DLL_PROCESS_DETACH && !lpReserved ) 220 | { 221 | Detach ( ); 222 | } 223 | return TRUE; 224 | } 225 | -------------------------------------------------------------------------------- /Dependencies/toml11/toml/types.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Toru Niina 2017. 2 | // Distributed under the MIT License. 3 | #ifndef TOML11_TYPES_HPP 4 | #define TOML11_TYPES_HPP 5 | #include 6 | #include 7 | 8 | #include "comments.hpp" 9 | #include "datetime.hpp" 10 | #include "string.hpp" 11 | #include "traits.hpp" 12 | 13 | namespace toml 14 | { 15 | 16 | template class Table, // map-like class 18 | template class Array> // vector-like class 19 | class basic_value; 20 | 21 | using character = char; 22 | using key = std::string; 23 | 24 | using boolean = bool; 25 | using integer = std::int64_t; 26 | using floating = double; // "float" is a keyward, cannot use it here. 27 | // the following stuffs are structs defined here, so aliases are not needed. 28 | // - string 29 | // - offset_datetime 30 | // - offset_datetime 31 | // - local_datetime 32 | // - local_date 33 | // - local_time 34 | 35 | // default toml::value and default array/table. these are defined after defining 36 | // basic_value itself. 37 | // using value = basic_value; 38 | // using array = typename value::array_type; 39 | // using table = typename value::table_type; 40 | 41 | enum class value_t : std::uint8_t 42 | { 43 | empty = 0, 44 | boolean = 1, 45 | integer = 2, 46 | floating = 3, 47 | string = 4, 48 | offset_datetime = 5, 49 | local_datetime = 6, 50 | local_date = 7, 51 | local_time = 8, 52 | array = 9, 53 | table = 10, 54 | }; 55 | 56 | template 57 | inline std::basic_ostream& 58 | operator<<(std::basic_ostream& os, value_t t) 59 | { 60 | switch(t) 61 | { 62 | case value_t::boolean : os << "boolean"; return os; 63 | case value_t::integer : os << "integer"; return os; 64 | case value_t::floating : os << "floating"; return os; 65 | case value_t::string : os << "string"; return os; 66 | case value_t::offset_datetime : os << "offset_datetime"; return os; 67 | case value_t::local_datetime : os << "local_datetime"; return os; 68 | case value_t::local_date : os << "local_date"; return os; 69 | case value_t::local_time : os << "local_time"; return os; 70 | case value_t::array : os << "array"; return os; 71 | case value_t::table : os << "table"; return os; 72 | case value_t::empty : os << "empty"; return os; 73 | default : os << "unknown"; return os; 74 | } 75 | } 76 | 77 | template, 79 | typename alloc = std::allocator> 80 | inline std::basic_string stringize(value_t t) 81 | { 82 | std::basic_ostringstream oss; 83 | oss << t; 84 | return oss.str(); 85 | } 86 | 87 | namespace detail 88 | { 89 | 90 | // helper to define a type that represents a value_t value. 91 | template 92 | using value_t_constant = std::integral_constant; 93 | 94 | // meta-function that convertes from value_t to the exact toml type that corresponds to. 95 | // It takes toml::basic_value type because array and table types depend on it. 96 | template struct enum_to_type {using type = void ;}; 97 | template struct enum_to_type{using type = void ;}; 98 | template struct enum_to_type{using type = boolean ;}; 99 | template struct enum_to_type{using type = integer ;}; 100 | template struct enum_to_type{using type = floating ;}; 101 | template struct enum_to_type{using type = string ;}; 102 | template struct enum_to_type{using type = offset_datetime ;}; 103 | template struct enum_to_type{using type = local_datetime ;}; 104 | template struct enum_to_type{using type = local_date ;}; 105 | template struct enum_to_type{using type = local_time ;}; 106 | template struct enum_to_type{using type = typename Value::array_type;}; 107 | template struct enum_to_type{using type = typename Value::table_type;}; 108 | 109 | // meta-function that converts from an exact toml type to the enum that corresponds to. 110 | template 111 | struct type_to_enum : std::conditional< 112 | std::is_same::value, // if T == array_type, 113 | value_t_constant, // then value_t::array 114 | typename std::conditional< // else... 115 | std::is_same::value, // if T == table_type 116 | value_t_constant, // then value_t::table 117 | value_t_constant // else value_t::empty 118 | >::type 119 | >::type {}; 120 | template struct type_to_enum: value_t_constant {}; 121 | template struct type_to_enum: value_t_constant {}; 122 | template struct type_to_enum: value_t_constant {}; 123 | template struct type_to_enum: value_t_constant {}; 124 | template struct type_to_enum: value_t_constant {}; 125 | template struct type_to_enum: value_t_constant {}; 126 | template struct type_to_enum: value_t_constant {}; 127 | template struct type_to_enum: value_t_constant {}; 128 | 129 | // meta-function that checks the type T is the same as one of the toml::* types. 130 | template 131 | struct is_exact_toml_type : disjunction< 132 | std::is_same, 133 | std::is_same, 134 | std::is_same, 135 | std::is_same, 136 | std::is_same, 137 | std::is_same, 138 | std::is_same, 139 | std::is_same, 140 | std::is_same, 141 | std::is_same 142 | >{}; 143 | template struct is_exact_toml_type : is_exact_toml_type{}; 144 | template struct is_exact_toml_type : is_exact_toml_type{}; 145 | template struct is_exact_toml_type : is_exact_toml_type{}; 146 | template struct is_exact_toml_type: is_exact_toml_type{}; 147 | 148 | } // detail 149 | } // toml 150 | #endif// TOML11_TYPES_H 151 | -------------------------------------------------------------------------------- /Dependencies/toml11/toml/string.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Toru Niina 2017. 2 | // Distributed under the MIT License. 3 | #ifndef TOML11_STRING_HPP 4 | #define TOML11_STRING_HPP 5 | #include 6 | 7 | #include 8 | #include 9 | 10 | #if __cplusplus >= 201703L 11 | #if __has_include() 12 | #include 13 | #endif 14 | #endif 15 | 16 | namespace toml 17 | { 18 | 19 | enum class string_t : std::uint8_t 20 | { 21 | basic = 0, 22 | literal = 1, 23 | }; 24 | 25 | struct string 26 | { 27 | string() = default; 28 | ~string() = default; 29 | string(const string& s) = default; 30 | string(string&& s) = default; 31 | string& operator=(const string& s) = default; 32 | string& operator=(string&& s) = default; 33 | 34 | string(const std::string& s): kind(string_t::basic), str(s){} 35 | string(const std::string& s, string_t k): kind(k), str(s){} 36 | string(const char* s): kind(string_t::basic), str(s){} 37 | string(const char* s, string_t k): kind(k), str(s){} 38 | 39 | string(std::string&& s): kind(string_t::basic), str(std::move(s)){} 40 | string(std::string&& s, string_t k): kind(k), str(std::move(s)){} 41 | 42 | string& operator=(const std::string& s) 43 | {kind = string_t::basic; str = s; return *this;} 44 | string& operator=(std::string&& s) 45 | {kind = string_t::basic; str = std::move(s); return *this;} 46 | 47 | operator std::string& () & noexcept {return str;} 48 | operator std::string const& () const& noexcept {return str;} 49 | operator std::string&& () && noexcept {return std::move(str);} 50 | 51 | string& operator+=(const char* rhs) {str += rhs; return *this;} 52 | string& operator+=(const char rhs) {str += rhs; return *this;} 53 | string& operator+=(const std::string& rhs) {str += rhs; return *this;} 54 | string& operator+=(const string& rhs) {str += rhs.str; return *this;} 55 | 56 | #if __cplusplus >= 201703L 57 | explicit string(std::string_view s): kind(string_t::basic), str(s){} 58 | string(std::string_view s, string_t k): kind(k), str(s){} 59 | 60 | string& operator=(std::string_view s) 61 | {kind = string_t::basic; str = s; return *this;} 62 | 63 | explicit operator std::string_view() const noexcept 64 | {return std::string_view(str);} 65 | 66 | string& operator+=(const std::string_view& rhs) {str += rhs; return *this;} 67 | #endif 68 | 69 | string_t kind; 70 | std::string str; 71 | }; 72 | 73 | inline bool operator==(const string& lhs, const string& rhs) 74 | { 75 | return lhs.kind == rhs.kind && lhs.str == rhs.str; 76 | } 77 | inline bool operator!=(const string& lhs, const string& rhs) 78 | { 79 | return !(lhs == rhs); 80 | } 81 | inline bool operator<(const string& lhs, const string& rhs) 82 | { 83 | return (lhs.kind == rhs.kind) ? (lhs.str < rhs.str) : (lhs.kind < rhs.kind); 84 | } 85 | inline bool operator>(const string& lhs, const string& rhs) 86 | { 87 | return rhs < lhs; 88 | } 89 | inline bool operator<=(const string& lhs, const string& rhs) 90 | { 91 | return !(rhs < lhs); 92 | } 93 | inline bool operator>=(const string& lhs, const string& rhs) 94 | { 95 | return !(lhs < rhs); 96 | } 97 | 98 | inline bool 99 | operator==(const string& lhs, const std::string& rhs) {return lhs.str == rhs;} 100 | inline bool 101 | operator!=(const string& lhs, const std::string& rhs) {return lhs.str != rhs;} 102 | inline bool 103 | operator< (const string& lhs, const std::string& rhs) {return lhs.str < rhs;} 104 | inline bool 105 | operator> (const string& lhs, const std::string& rhs) {return lhs.str > rhs;} 106 | inline bool 107 | operator<=(const string& lhs, const std::string& rhs) {return lhs.str <= rhs;} 108 | inline bool 109 | operator>=(const string& lhs, const std::string& rhs) {return lhs.str >= rhs;} 110 | 111 | inline bool 112 | operator==(const std::string& lhs, const string& rhs) {return lhs == rhs.str;} 113 | inline bool 114 | operator!=(const std::string& lhs, const string& rhs) {return lhs != rhs.str;} 115 | inline bool 116 | operator< (const std::string& lhs, const string& rhs) {return lhs < rhs.str;} 117 | inline bool 118 | operator> (const std::string& lhs, const string& rhs) {return lhs > rhs.str;} 119 | inline bool 120 | operator<=(const std::string& lhs, const string& rhs) {return lhs <= rhs.str;} 121 | inline bool 122 | operator>=(const std::string& lhs, const string& rhs) {return lhs >= rhs.str;} 123 | 124 | inline bool 125 | operator==(const string& lhs, const char* rhs) {return lhs.str == std::string(rhs);} 126 | inline bool 127 | operator!=(const string& lhs, const char* rhs) {return lhs.str != std::string(rhs);} 128 | inline bool 129 | operator< (const string& lhs, const char* rhs) {return lhs.str < std::string(rhs);} 130 | inline bool 131 | operator> (const string& lhs, const char* rhs) {return lhs.str > std::string(rhs);} 132 | inline bool 133 | operator<=(const string& lhs, const char* rhs) {return lhs.str <= std::string(rhs);} 134 | inline bool 135 | operator>=(const string& lhs, const char* rhs) {return lhs.str >= std::string(rhs);} 136 | 137 | inline bool 138 | operator==(const char* lhs, const string& rhs) {return std::string(lhs) == rhs.str;} 139 | inline bool 140 | operator!=(const char* lhs, const string& rhs) {return std::string(lhs) != rhs.str;} 141 | inline bool 142 | operator< (const char* lhs, const string& rhs) {return std::string(lhs) < rhs.str;} 143 | inline bool 144 | operator> (const char* lhs, const string& rhs) {return std::string(lhs) > rhs.str;} 145 | inline bool 146 | operator<=(const char* lhs, const string& rhs) {return std::string(lhs) <= rhs.str;} 147 | inline bool 148 | operator>=(const char* lhs, const string& rhs) {return std::string(lhs) >= rhs.str;} 149 | 150 | template 151 | std::basic_ostream& 152 | operator<<(std::basic_ostream& os, const string& s) 153 | { 154 | if(s.kind == string_t::basic) 155 | { 156 | if(std::find(s.str.cbegin(), s.str.cend(), '\n') != s.str.cend()) 157 | { 158 | // it contains newline. make it multiline string. 159 | os << "\"\"\"\n"; 160 | for(auto i=s.str.cbegin(), e=s.str.cend(); i!=e; ++i) 161 | { 162 | switch(*i) 163 | { 164 | case '\\': {os << "\\\\"; break;} 165 | case '\"': {os << "\\\""; break;} 166 | case '\b': {os << "\\b"; break;} 167 | case '\t': {os << "\\t"; break;} 168 | case '\f': {os << "\\f"; break;} 169 | case '\n': {os << '\n'; break;} 170 | case '\r': 171 | { 172 | // since it is a multiline string, 173 | // CRLF is not needed to be escaped. 174 | if(std::next(i) != e && *std::next(i) == '\n') 175 | { 176 | os << "\r\n"; 177 | ++i; 178 | } 179 | else 180 | { 181 | os << "\\r"; 182 | } 183 | break; 184 | } 185 | default: {os << *i; break;} 186 | } 187 | } 188 | os << "\\\n\"\"\""; 189 | return os; 190 | } 191 | // no newline. make it inline. 192 | os << "\""; 193 | for(const auto c : s.str) 194 | { 195 | switch(c) 196 | { 197 | case '\\': {os << "\\\\"; break;} 198 | case '\"': {os << "\\\""; break;} 199 | case '\b': {os << "\\b"; break;} 200 | case '\t': {os << "\\t"; break;} 201 | case '\f': {os << "\\f"; break;} 202 | case '\n': {os << "\\n"; break;} 203 | case '\r': {os << "\\r"; break;} 204 | default : {os << c; break;} 205 | } 206 | } 207 | os << "\""; 208 | return os; 209 | } 210 | // the string `s` is literal-string. 211 | if(std::find(s.str.cbegin(), s.str.cend(), '\n') != s.str.cend() || 212 | std::find(s.str.cbegin(), s.str.cend(), '\'') != s.str.cend() ) 213 | { 214 | // contains newline or single quote. make it multiline. 215 | os << "'''\n" << s.str << "'''"; 216 | return os; 217 | } 218 | // normal literal string 219 | os << '\'' << s.str << '\''; 220 | return os; 221 | } 222 | 223 | } // toml 224 | #endif// TOML11_STRING_H 225 | -------------------------------------------------------------------------------- /Dainsleif/ClientClass.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum class ClassID : int 4 | { 5 | CAI_BaseNPC = 0, 6 | CAK47, 7 | CBaseAnimating, 8 | CBaseAnimatingOverlay, 9 | CBaseAttributableItem, 10 | CBaseButton, 11 | CBaseCombatCharacter, 12 | CBaseCombatWeapon, 13 | CBaseCSGrenade, 14 | CBaseCSGrenadeProjectile, 15 | CBaseDoor, 16 | CBaseEntity, 17 | CBaseFlex, 18 | CBaseGrenade, 19 | CBaseParticleEntity, 20 | CBasePlayer, 21 | CBasePropDoor, 22 | CBaseTeamObjectiveResource, 23 | CBaseTempEntity, 24 | CBaseToggle, 25 | CBaseTrigger, 26 | CBaseViewModel, 27 | CBaseVPhysicsTrigger, 28 | CBaseWeaponWorldModel, 29 | CBeam, 30 | CBeamSpotlight, 31 | CBoneFollower, 32 | CBRC4Target, 33 | CBreachCharge, 34 | CBreachChargeProjectile, 35 | CBreakableProp, 36 | CBreakableSurface, 37 | CBumpMine, 38 | CBumpMineProjectile, 39 | CC4, 40 | CCascadeLight, 41 | CChicken, 42 | CColorCorrection, 43 | CColorCorrectionVolume, 44 | CCSGameRulesProxy, 45 | CCSPlayer, 46 | CCSPlayerResource, 47 | CCSRagdoll, 48 | CCSTeam, 49 | CDangerZone, 50 | CDangerZoneController, 51 | CDEagle, 52 | CDecoyGrenade, 53 | CDecoyProjectile, 54 | CDrone, 55 | CDronegun, 56 | CDynamicLight, 57 | CDynamicProp, 58 | CEconEntity, 59 | CEconWearable, 60 | CEmbers, 61 | CEntityDissolve, 62 | CEntityFlame, 63 | CEntityFreezing, 64 | CEntityParticleTrail, 65 | CEnvAmbientLight, 66 | CEnvDetailController, 67 | CEnvDOFController, 68 | CEnvGasCanister, 69 | CEnvParticleScript, 70 | CEnvProjectedTexture, 71 | CEnvQuadraticBeam, 72 | CEnvScreenEffect, 73 | CEnvScreenOverlay, 74 | CEnvTonemapController, 75 | CEnvWind, 76 | CFEPlayerDecal, 77 | CFireCrackerBlast, 78 | CFireSmoke, 79 | CFireTrail, 80 | CFish, 81 | CFists, 82 | CFlashbang, 83 | CFogController, 84 | CFootstepControl, 85 | CFunc_Dust, 86 | CFunc_LOD, 87 | CFuncAreaPortalWindow, 88 | CFuncBrush, 89 | CFuncConveyor, 90 | CFuncLadder, 91 | CFuncMonitor, 92 | CFuncMoveLinear, 93 | CFuncOccluder, 94 | CFuncReflectiveGlass, 95 | CFuncRotating, 96 | CFuncSmokeVolume, 97 | CFuncTrackTrain, 98 | CGameRulesProxy, 99 | CGrassBurn, 100 | CHandleTest, 101 | CHEGrenade, 102 | CHostage, 103 | CHostageCarriableProp, 104 | CIncendiaryGrenade, 105 | CInferno, 106 | CInfoLadderDismount, 107 | CInfoMapRegion, 108 | CInfoOverlayAccessor, 109 | CItem_Healthshot, 110 | CItemCash, 111 | CItemDogtags, 112 | CKnife, 113 | CKnifeGG, 114 | CLightGlow, 115 | CMaterialModifyControl, 116 | CMelee, 117 | CMolotovGrenade, 118 | CMolotovProjectile, 119 | CMovieDisplay, 120 | CParadropChopper, 121 | CParticleFire, 122 | CParticlePerformanceMonitor, 123 | CParticleSystem, 124 | CPhysBox, 125 | CPhysBoxMultiplayer, 126 | CPhysicsProp, 127 | CPhysicsPropMultiplayer, 128 | CPhysMagnet, 129 | CPhysPropAmmoBox, 130 | CPhysPropLootCrate, 131 | CPhysPropRadarJammer, 132 | CPhysPropWeaponUpgrade, 133 | CPlantedC4, 134 | CPlasma, 135 | CPlayerPing, 136 | CPlayerResource, 137 | CPointCamera, 138 | CPointCommentaryNode, 139 | CPointWorldText, 140 | CPoseController, 141 | CPostProcessController, 142 | CPrecipitation, 143 | CPrecipitationBlocker, 144 | CPredictedViewModel, 145 | CProp_Hallucination, 146 | CPropCounter, 147 | CPropDoorRotating, 148 | CPropJeep, 149 | CPropVehicleDriveable, 150 | CRagdollManager, 151 | CRagdollProp, 152 | CRagdollPropAttached, 153 | CRopeKeyframe, 154 | CSCAR17, 155 | CSceneEntity, 156 | CSensorGrenade, 157 | CSensorGrenadeProjectile, 158 | CShadowControl, 159 | CSlideshowDisplay, 160 | CSmokeGrenade, 161 | CSmokeGrenadeProjectile, 162 | CSmokeStack, 163 | CSnowball, 164 | CSnowballPile, 165 | CSnowballProjectile, 166 | CSpatialEntity, 167 | CSpotlightEnd, 168 | CSprite, 169 | CSpriteOriented, 170 | CSpriteTrail, 171 | CStatueProp, 172 | CSteamJet, 173 | CSun, 174 | CSunlightShadowControl, 175 | CSurvivalSpawnChopper, 176 | CTablet, 177 | CTeam, 178 | CTeamplayRoundBasedRulesProxy, 179 | CTEArmorRicochet, 180 | CTEBaseBeam, 181 | CTEBeamEntPoint, 182 | CTEBeamEnts, 183 | CTEBeamFollow, 184 | CTEBeamLaser, 185 | CTEBeamPoints, 186 | CTEBeamRing, 187 | CTEBeamRingPoint, 188 | CTEBeamSpline, 189 | CTEBloodSprite, 190 | CTEBloodStream, 191 | CTEBreakModel, 192 | CTEBSPDecal, 193 | CTEBubbles, 194 | CTEBubbleTrail, 195 | CTEClientProjectile, 196 | CTEDecal, 197 | CTEDust, 198 | CTEDynamicLight, 199 | CTEEffectDispatch, 200 | CTEEnergySplash, 201 | CTEExplosion, 202 | CTEFireBullets, 203 | CTEFizz, 204 | CTEFootprintDecal, 205 | CTEFoundryHelpers, 206 | CTEGaussExplosion, 207 | CTEGlowSprite, 208 | CTEImpact, 209 | CTEKillPlayerAttachments, 210 | CTELargeFunnel, 211 | CTEMetalSparks, 212 | CTEMuzzleFlash, 213 | CTEParticleSystem, 214 | CTEPhysicsProp, 215 | CTEPlantBomb, 216 | CTEPlayerAnimEvent, 217 | CTEPlayerDecal, 218 | CTEProjectedDecal, 219 | CTERadioIcon, 220 | CTEShatterSurface, 221 | CTEShowLine, 222 | CTesla, 223 | CTESmoke, 224 | CTESparks, 225 | CTESprite, 226 | CTESpriteSpray, 227 | CTest_ProxyToggle_Networkable, 228 | CTestTraceline, 229 | CTEWorldDecal, 230 | CTriggerPlayerMovement, 231 | CTriggerSoundOperator, 232 | CVGuiScreen, 233 | CVoteController, 234 | CWaterBullet, 235 | CWaterLODControl, 236 | CWeaponAug, 237 | CWeaponAWP, 238 | CWeaponBaseItem, 239 | CWeaponBizon, 240 | CWeaponCSBase, 241 | CWeaponCSBaseGun, 242 | CWeaponCycler, 243 | CWeaponElite, 244 | CWeaponFamas, 245 | CWeaponFiveSeven, 246 | CWeaponG3SG1, 247 | CWeaponGalil, 248 | CWeaponGalilAR, 249 | CWeaponGlock, 250 | CWeaponHKP2000, 251 | CWeaponM249, 252 | CWeaponM3, 253 | CWeaponM4A1, 254 | CWeaponMAC10, 255 | CWeaponMag7, 256 | CWeaponMP5Navy, 257 | CWeaponMP7, 258 | CWeaponMP9, 259 | CWeaponNegev, 260 | CWeaponNOVA, 261 | CWeaponP228, 262 | CWeaponP250, 263 | CWeaponP90, 264 | CWeaponSawedoff, 265 | CWeaponSCAR20, 266 | CWeaponScout, 267 | CWeaponSG550, 268 | CWeaponSG552, 269 | CWeaponSG556, 270 | CWeaponShield, 271 | CWeaponSSG08, 272 | CWeaponTaser, 273 | CWeaponTec9, 274 | CWeaponTMP, 275 | CWeaponUMP45, 276 | CWeaponUSP, 277 | CWeaponXM1014, 278 | CWorld, 279 | CWorldVguiText, 280 | DustTrail, 281 | MovieExplosion, 282 | ParticleSmokeGrenade, 283 | RocketTrail, 284 | SmokeTrail, 285 | SporeExplosion, 286 | SporeTrail, 287 | }; 288 | 289 | struct RecvProxyData; 290 | struct RecvTable; 291 | struct RecvProp; 292 | 293 | using RecvVarProxyFn = void(__cdecl*)(const RecvProxyData*, void*, void*); 294 | using CreateClientClassFn = void* (*)(int entnum, int serialNum); 295 | using CreateEventFn = void* (*)(); 296 | 297 | struct DVariant 298 | { 299 | union 300 | { 301 | float m_Float; 302 | long m_Int; 303 | char* m_pString; 304 | void* m_pData; 305 | float m_Vector[3]; 306 | __int64 m_Int64; 307 | }; 308 | 309 | int m_Type; 310 | }; 311 | 312 | struct RecvProxyData 313 | { 314 | const RecvProp* m_pRecvProp; 315 | DVariant m_Value; 316 | int m_iElement; 317 | int m_ObjectID; 318 | }; 319 | 320 | struct RecvTable 321 | { 322 | RecvProp* m_pProps; 323 | int m_nProps; 324 | void* m_pDecoder; 325 | char* m_pNetTableName; 326 | char pad_01[0x2]; 327 | }; 328 | 329 | struct RecvProp 330 | { 331 | char* m_pVarName; 332 | int m_RecvType; 333 | int m_Flags; 334 | int m_StringBufferSize; 335 | bool m_bInsideArray; 336 | const void* m_pExtraData; 337 | RecvProp* m_pArrayProp; 338 | void* m_ArrayLengthProxy; 339 | RecvVarProxyFn m_ProxyFn; 340 | void* m_DataTableProxyFn; 341 | RecvTable* m_pDataTable; 342 | int m_Offset; 343 | int m_ElementStride; 344 | int m_nElements; 345 | const char* m_pParentArrayPropName; 346 | }; 347 | 348 | struct ClientClass 349 | { 350 | CreateClientClassFn m_pCreateFn; 351 | CreateEventFn m_pCreateEventFn; 352 | char* m_pNetworkName; 353 | RecvTable* m_pRecvTable; 354 | ClientClass* m_pNext; 355 | ClassID m_ClassID; 356 | }; -------------------------------------------------------------------------------- /Dainsleif/Save/OffsetsToml.cpp: -------------------------------------------------------------------------------- 1 | #include "OffsetsToml.h" 2 | 3 | std::map OffsetsToml::Fetch(std::string& filename) { 4 | auto saveData = toml::parse(filename); 5 | dwClientState = toml::find_or(saveData, "dwClientState", dwClientState); 6 | dwEntityList = toml::find_or(saveData, "dwEntityList", dwEntityList); 7 | dwLocalPlayer = toml::find_or(saveData, "dwLocalPlayer", dwLocalPlayer); 8 | dwGlowObjectManager = toml::find_or(saveData, "dwGlowObjectManager", dwGlowObjectManager); 9 | dwForceAttack = toml::find_or(saveData, "dwForceAttack", dwForceAttack); 10 | dwForceForward = toml::find_or(saveData, "dwForceForward", dwForceForward); 11 | dwForceBackward = toml::find_or(saveData, "dwForceBackward", dwForceBackward); 12 | dwForceRight = toml::find_or(saveData, "dwForceRight", dwForceRight); 13 | dwForceLeft = toml::find_or(saveData, "dwForceLeft", dwForceLeft); 14 | dwForceJump = toml::find_or(saveData, "dwForceJump", dwForceJump); 15 | dwViewMatrix = toml::find_or(saveData, "dwViewMatrix", dwViewMatrix); 16 | 17 | dwClientState_State = toml::find_or(saveData, "dwClientState_State", dwClientState_State); 18 | dwClientState_MaxPlayer = toml::find_or(saveData, "dwClientState_MaxPlayer", dwClientState_MaxPlayer); 19 | dwClientState_ViewAngles = toml::find_or(saveData, "dwClientState_ViewAngles", dwClientState_ViewAngles); 20 | dwppDirect3DDevice9 = toml::find_or(saveData, "dwppDirect3DDevice9", dwppDirect3DDevice9); 21 | m_vecOrigin = toml::find_or(saveData, "m_vecOrigin", m_vecOrigin); 22 | m_iHealth = toml::find_or(saveData, "m_iHealth", m_iHealth); 23 | m_fFlags = toml::find_or(saveData, "m_fFlags", m_fFlags); 24 | m_vecViewOffset = toml::find_or(saveData, "m_vecViewOffset", m_vecViewOffset); 25 | m_dwBoneMatrix = toml::find_or(saveData, "m_dwBoneMatrix", m_dwBoneMatrix); 26 | m_iTeamNum = toml::find_or(saveData, "m_iTeamNum", m_iTeamNum); 27 | m_iGlowIndex = toml::find_or(saveData, "m_iGlowIndex", m_iGlowIndex); 28 | m_aimPunchAngle = toml::find_or(saveData, "m_aimPunchAngle", m_aimPunchAngle); 29 | m_iShotsFired = toml::find_or(saveData, "m_iShotsFired", m_iShotsFired); 30 | m_iCrosshairId = toml::find_or(saveData, "m_iCrosshairId", m_iCrosshairId); 31 | m_iFOV = toml::find_or(saveData, "m_iFOV", m_iFOV); 32 | m_bDormant = toml::find_or(saveData, "m_bDormant", m_bDormant); 33 | m_hActiveWeapon = toml::find_or(saveData, "m_hActiveWeapon", m_hActiveWeapon); 34 | m_iItemDefinitionIndex = toml::find_or(saveData, "m_iItemDefinitionIndex", m_iItemDefinitionIndex); 35 | m_bSpotted = toml::find_or(saveData, "m_bSpotted", m_bSpotted); 36 | m_bIsScoped = toml::find_or(saveData, "m_bIsScoped", m_bIsScoped); 37 | 38 | return std::map 39 | { 40 | {"dwClientState", dwClientState}, 41 | {"dwForceAttack", dwForceAttack}, 42 | {"dwEntityList", dwEntityList}, 43 | {"dwGlowObjectManager", dwGlowObjectManager}, 44 | {"dwLocalPlayer", dwLocalPlayer}, 45 | {"dwForceForward", dwForceForward}, 46 | {"dwForceBackward", dwForceBackward}, 47 | {"dwForceRight", dwForceRight}, 48 | {"dwForceLeft", dwForceLeft}, 49 | {"dwForceJump", dwForceJump}, 50 | {"dwViewMatrix", dwViewMatrix} 51 | }; 52 | } 53 | 54 | //This is a wrap function to be passed to std::async 55 | uintptr_t Scan(std::string dllName, std::string signature, int offset, uintptr_t moduleBase, int extra) { 56 | return PatternScanner(dllName.data(), signature.data(), offset).CalculateOffset(moduleBase, extra); 57 | } 58 | 59 | void OffsetsToml::Update(std::string& filename) 60 | { 61 | uintptr_t a_entityList = std::async(std::launch::async, Scan, "client.dll", "\xBB????\x83??\x7C?", 1, Modules::client, 0).get(); 62 | uintptr_t a_glowObjectManager = std::async(std::launch::async, Scan, "client.dll", "\x11?????\x83??\xC7?????????\x0F\x28?????\x68????", 2, Modules::client, 0).get(); 63 | uintptr_t a_localPlayer = std::async(std::launch::async, Scan, "client.dll", "\x8D\x34\x85????\x89\x15????\x8B\x41\x08\x8B\x48\x04\x83\xF9\xFF", 3, Modules::client, 4).get(); 64 | uintptr_t a_clientState = std::async(std::launch::async, Scan, "engine.dll", "\xA1????\x8B?????\x85?\x74?\x8B?", 1, Modules::engine, 0).get(); 65 | uintptr_t a_forceAttack = std::async(std::launch::async, Scan, "client.dll", "\x89\x0D????\x8B\x0D????\x8B\xF2\x8B\xC1\x83\xCE\x04", 2, Modules::client, 0).get(); 66 | uintptr_t a_forceBackward = std::async(std::launch::async, Scan, "client.dll", "\x55\x8B\xEC\x51\x53\x8A\x5D\x08", 287, Modules::client, 0).get(); 67 | uintptr_t a_forceForward = std::async(std::launch::async, Scan, "client.dll","\x55\x8B\xEC\x51\x53\x8A\x5D\x08", 245, Modules::client, 0).get(); 68 | uintptr_t a_forceJump = std::async(std::launch::async, Scan, "client.dll", "\x8B\x0D????\x8B\xD6\x8B\xC1\x83\xCA\x02", 2, Modules::client, 0).get(); 69 | uintptr_t a_forceLeft = std::async(std::launch::async, Scan, "client.dll", "\x55\x8B\xEC\x51\x53\x8A\x5D\x08", 465, Modules::client, 0).get(); 70 | uintptr_t a_forceRight = std::async(std::launch::async, Scan, "client.dll", "\x55\x8B\xEC\x51\x53\x8A\x5D\x08", 512, Modules::client, 0).get(); 71 | uintptr_t a_viewMatrix = std::async(std::launch::async, Scan, "client.dll", "\x0F\x10\x05????\x8D\x85????\xB9", 3, Modules::client, 176).get(); 72 | 73 | const toml::value data { 74 | {"dwForceAttack", a_forceAttack}, 75 | {"dwEntityList", a_entityList}, 76 | {"dwGlowObjectManager", a_glowObjectManager}, 77 | {"dwLocalPlayer", a_localPlayer}, 78 | {"dwClientState", a_clientState}, 79 | {"dwForceBackward", a_forceBackward}, 80 | {"dwForceForward", a_forceForward}, 81 | {"dwForceRight", a_forceRight}, 82 | {"dwForceJump", a_forceJump}, 83 | {"dwForceLeft", a_forceLeft}, 84 | {"dwViewMatrix", a_viewMatrix}, 85 | {"dwClientState_State", 0x108}, 86 | {"dwClientState_MaxPlayer", 0x388}, 87 | {"dwClientState_ViewAngles", 0x4D90}, 88 | {"dwppDirect3DDevice9", 0xA7050}, 89 | {"m_vecOrigin", 0x138}, 90 | {"m_iHealth", 0x100}, 91 | {"m_fFlags", 0x104}, 92 | {"m_vecViewOffset", 0x108}, 93 | {"m_dwBoneMatrix", 0x26A8}, 94 | {"m_iTeamNum", 0xF4}, 95 | {"m_iGlowIndex", 0x10488}, 96 | {"m_aimPunchAngle", 0x303C}, 97 | {"m_iShotsFired", 0x103E0}, 98 | {"m_iCrosshairId", 0x11438}, 99 | {"m_iFOV", 0x31F4}, 100 | {"m_bDormant", 0xED}, 101 | {"m_bSpotted", 0x93D}, 102 | {"m_hActiveWeapon", 0x2F08}, 103 | {"m_iItemDefinitionIndex", 0x2FBA}, 104 | {"m_bIsScoped", 0x9974}, 105 | }; 106 | 107 | std::ofstream file; 108 | file.open(filename, std::ios::out); 109 | file << data; 110 | file.close(); 111 | } 112 | 113 | 114 | // When you add new offset, go to Initialize(), Update(), Fetch(), Offsets.cpp, Offsets.h 115 | void OffsetsToml::Initialize(std::string& filename) 116 | { 117 | const toml::value data { 118 | {"dwClientState", 0x58CFDC}, 119 | {"dwForceAttack", 0x320DE20}, 120 | {"dwForceBackward", 0x320DE74}, 121 | {"dwForceForward", 0x320DE68}, 122 | {"dwForceJump", 0x528791C}, 123 | {"dwForceLeft", 0x320DE80}, 124 | {"dwForceRight", 0x320DE8C}, 125 | {"dwEntityList", 0x4DDD93C}, 126 | {"dwLocalPlayer", 0xDC14CC}, 127 | {"dwGlowObjectManager", 0x5326640}, 128 | {"dwViewMatrix", 0x4DCF254}, 129 | {"dwClientState_State", 0x108}, 130 | {"dwClientState_MaxPlayer", 0x388}, 131 | {"dwClientState_ViewAngles", 0x4D90}, 132 | {"dwppDirect3DDevice9", 0xA6050}, 133 | {"m_vecOrigin", 0x138}, 134 | {"m_iHealth", 0x100}, 135 | {"m_fFlags", 0x104}, 136 | {"m_vecViewOffset", 0x108}, 137 | {"m_dwBoneMatrix", 0x26A8}, 138 | {"m_iTeamNum", 0xF4}, 139 | {"m_iGlowIndex", 0x10488}, 140 | {"m_aimPunchAngle", 0x303C}, 141 | {"m_iShotsFired", 0x103E0}, 142 | {"m_iCrosshairId", 0x11838}, 143 | {"m_iFOV", 0x31F4}, 144 | {"m_bDormant", 0xED}, 145 | {"m_bSpotted", 0x93D}, 146 | {"m_hActiveWeapon", 0x2F08}, 147 | {"m_iItemDefinitionIndex", 0x2FBA}, 148 | {"m_bIsScoped", 0x9974}, 149 | }; 150 | 151 | std::ofstream file; 152 | file.open(filename, std::ios::out); 153 | file << data; 154 | file.close(); 155 | } 156 | -------------------------------------------------------------------------------- /Dependencies/toml11/toml/source_location.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Toru Niina 2019. 2 | // Distributed under the MIT License. 3 | #ifndef TOML11_SOURCE_LOCATION_HPP 4 | #define TOML11_SOURCE_LOCATION_HPP 5 | #include 6 | 7 | #include "region.hpp" 8 | 9 | namespace toml 10 | { 11 | 12 | // A struct to contain location in a toml file. 13 | // The interface imitates std::experimental::source_location, 14 | // but not completely the same. 15 | // 16 | // It would be constructed by toml::value. It can be used to generate 17 | // user-defined error messages. 18 | // 19 | // - std::uint_least32_t line() const noexcept 20 | // - returns the line number where the region is on. 21 | // - std::uint_least32_t column() const noexcept 22 | // - returns the column number where the region starts. 23 | // - std::uint_least32_t region() const noexcept 24 | // - returns the size of the region. 25 | // 26 | // +-- line() +-- region of interest (region() == 9) 27 | // v .---+---. 28 | // 12 | value = "foo bar" 29 | // ^ 30 | // +-- column() 31 | // 32 | // - std::string const& file_name() const noexcept; 33 | // - name of the file. 34 | // - std::string const& line_str() const noexcept; 35 | // - the whole line that contains the region of interest. 36 | // 37 | struct source_location 38 | { 39 | public: 40 | 41 | source_location() 42 | : line_num_(1), column_num_(1), region_size_(1), 43 | file_name_("unknown file"), line_str_("") 44 | {} 45 | 46 | explicit source_location(const detail::region_base* reg) 47 | : line_num_(1), column_num_(1), region_size_(1), 48 | file_name_("unknown file"), line_str_("") 49 | { 50 | if(reg) 51 | { 52 | if(reg->line_num() != detail::region_base().line_num()) 53 | { 54 | line_num_ = static_cast( 55 | std::stoul(reg->line_num())); 56 | } 57 | column_num_ = static_cast(reg->before() + 1); 58 | region_size_ = static_cast(reg->size()); 59 | file_name_ = reg->name(); 60 | line_str_ = reg->line(); 61 | } 62 | } 63 | 64 | explicit source_location(const detail::region& reg) 65 | : line_num_(static_cast(std::stoul(reg.line_num()))), 66 | column_num_(static_cast(reg.before() + 1)), 67 | region_size_(static_cast(reg.size())), 68 | file_name_(reg.name()), 69 | line_str_ (reg.line()) 70 | {} 71 | explicit source_location(const detail::location& loc) 72 | : line_num_(static_cast(std::stoul(loc.line_num()))), 73 | column_num_(static_cast(loc.before() + 1)), 74 | region_size_(static_cast(loc.size())), 75 | file_name_(loc.name()), 76 | line_str_ (loc.line()) 77 | {} 78 | 79 | ~source_location() = default; 80 | source_location(source_location const&) = default; 81 | source_location(source_location &&) = default; 82 | source_location& operator=(source_location const&) = default; 83 | source_location& operator=(source_location &&) = default; 84 | 85 | std::uint_least32_t line() const noexcept {return line_num_;} 86 | std::uint_least32_t column() const noexcept {return column_num_;} 87 | std::uint_least32_t region() const noexcept {return region_size_;} 88 | 89 | std::string const& file_name() const noexcept {return file_name_;} 90 | std::string const& line_str() const noexcept {return line_str_;} 91 | 92 | private: 93 | 94 | std::uint_least32_t line_num_; 95 | std::uint_least32_t column_num_; 96 | std::uint_least32_t region_size_; 97 | std::string file_name_; 98 | std::string line_str_; 99 | }; 100 | 101 | namespace detail 102 | { 103 | 104 | // internal error message generation. 105 | inline std::string format_underline(const std::string& message, 106 | const std::vector>& loc_com, 107 | const std::vector& helps = {}, 108 | const bool colorize = TOML11_ERROR_MESSAGE_COLORIZED) 109 | { 110 | std::size_t line_num_width = 0; 111 | for(const auto& lc : loc_com) 112 | { 113 | std::uint_least32_t line = lc.first.line(); 114 | std::size_t digit = 0; 115 | while(line != 0) 116 | { 117 | line /= 10; 118 | digit += 1; 119 | } 120 | line_num_width = (std::max)(line_num_width, digit); 121 | } 122 | // 1 is the minimum width 123 | line_num_width = std::max(line_num_width, 1); 124 | 125 | std::ostringstream retval; 126 | 127 | if(colorize) 128 | { 129 | retval << color::colorize; // turn on ANSI color 130 | } 131 | 132 | // XXX 133 | // Here, before `colorize` support, it does not output `[error]` prefix 134 | // automatically. So some user may output it manually and this change may 135 | // duplicate the prefix. To avoid it, check the first 7 characters and 136 | // if it is "[error]", it removes that part from the message shown. 137 | if(message.size() > 7 && message.substr(0, 7) == "[error]") 138 | { 139 | retval << color::bold << color::red << "[error]" << color::reset 140 | << color::bold << message.substr(7) << color::reset << '\n'; 141 | } 142 | else 143 | { 144 | retval << color::bold << color::red << "[error] " << color::reset 145 | << color::bold << message << color::reset << '\n'; 146 | } 147 | 148 | const auto format_one_location = [line_num_width] 149 | (std::ostringstream& oss, 150 | const source_location& loc, const std::string& comment) -> void 151 | { 152 | oss << ' ' << color::bold << color::blue 153 | << std::setw(static_cast(line_num_width)) 154 | << std::right << loc.line() << " | " << color::reset 155 | << loc.line_str() << '\n'; 156 | 157 | oss << make_string(line_num_width + 1, ' ') 158 | << color::bold << color::blue << " | " << color::reset 159 | << make_string(loc.column()-1 /*1-origin*/, ' '); 160 | 161 | if(loc.region() == 1) 162 | { 163 | // invalid 164 | // ^------ 165 | oss << color::bold << color::red << "^---" << color::reset; 166 | } 167 | else 168 | { 169 | // invalid 170 | // ~~~~~~~ 171 | const auto underline_len = (std::min)( 172 | static_cast(loc.region()), loc.line_str().size()); 173 | oss << color::bold << color::red 174 | << make_string(underline_len, '~') << color::reset; 175 | } 176 | oss << ' '; 177 | oss << comment; 178 | return; 179 | }; 180 | 181 | assert(!loc_com.empty()); 182 | 183 | // --> example.toml 184 | // | 185 | retval << color::bold << color::blue << " --> " << color::reset 186 | << loc_com.front().first.file_name() << '\n'; 187 | retval << make_string(line_num_width + 1, ' ') 188 | << color::bold << color::blue << " |\n" << color::reset; 189 | // 1 | key value 190 | // | ^--- missing = 191 | format_one_location(retval, loc_com.front().first, loc_com.front().second); 192 | 193 | // process the rest of the locations 194 | for(std::size_t i=1; i filename.toml" again 206 | { 207 | retval << color::bold << color::blue << " --> " << color::reset 208 | << curr.first.file_name() << '\n'; 209 | retval << make_string(line_num_width + 1, ' ') 210 | << color::bold << color::blue << " |\n" << color::reset; 211 | } 212 | 213 | format_one_location(retval, curr.first, curr.second); 214 | } 215 | 216 | if(!helps.empty()) 217 | { 218 | retval << '\n'; 219 | retval << make_string(line_num_width + 1, ' '); 220 | retval << color::bold << color::blue << " |" << color::reset; 221 | for(const auto& help : helps) 222 | { 223 | retval << color::bold << "\nHint: " << color::reset; 224 | retval << help; 225 | } 226 | } 227 | return retval.str(); 228 | } 229 | 230 | } // detail 231 | } // toml 232 | #endif// TOML11_SOURCE_LOCATION_HPP 233 | -------------------------------------------------------------------------------- /Dependencies/toml11/toml/combinator.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Toru Niina 2017. 2 | // Distributed under the MIT License. 3 | #ifndef TOML11_COMBINATOR_HPP 4 | #define TOML11_COMBINATOR_HPP 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #include "region.hpp" 16 | #include "result.hpp" 17 | #include "traits.hpp" 18 | #include "utility.hpp" 19 | 20 | // they scans characters and returns region if it matches to the condition. 21 | // when they fail, it does not change the location. 22 | // in lexer.hpp, these are used. 23 | 24 | namespace toml 25 | { 26 | namespace detail 27 | { 28 | 29 | // to output character as an error message. 30 | inline std::string show_char(const char c) 31 | { 32 | // It supress an error that occurs only in Debug mode of MSVC++ on Windows. 33 | // I'm not completely sure but they check the value of char to be in the 34 | // range [0, 256) and some of the COMPLETELY VALID utf-8 character sometimes 35 | // has negative value (if char has sign). So here it re-interprets c as 36 | // unsigned char through pointer. In general, converting pointer to a 37 | // pointer that has different type cause UB, but `(signed|unsigned)?char` 38 | // are one of the exceptions. Converting pointer only to char and std::byte 39 | // (c++17) are valid. 40 | if(std::isgraph(*reinterpret_cast(std::addressof(c)))) 41 | { 42 | return std::string(1, c); 43 | } 44 | else 45 | { 46 | std::array buf; 47 | buf.fill('\0'); 48 | const auto r = std::snprintf( 49 | buf.data(), buf.size(), "0x%02x", static_cast(c) & 0xFF); 50 | (void) r; // Unused variable warning 51 | assert(r == static_cast(buf.size()) - 1); 52 | return std::string(buf.data()); 53 | } 54 | } 55 | 56 | template 57 | struct character 58 | { 59 | static constexpr char target = C; 60 | 61 | static result 62 | invoke(location& loc) 63 | { 64 | if(loc.iter() == loc.end()) {return none();} 65 | const auto first = loc.iter(); 66 | 67 | const char c = *(loc.iter()); 68 | if(c != target) 69 | { 70 | return none(); 71 | } 72 | loc.advance(); // update location 73 | 74 | return ok(region(loc, first, loc.iter())); 75 | } 76 | }; 77 | template 78 | constexpr char character::target; 79 | 80 | // closed interval [Low, Up]. both Low and Up are included. 81 | template 82 | struct in_range 83 | { 84 | // assuming ascii part of UTF-8... 85 | static_assert(Low <= Up, "lower bound should be less than upper bound."); 86 | 87 | static constexpr char upper = Up; 88 | static constexpr char lower = Low; 89 | 90 | static result 91 | invoke(location& loc) 92 | { 93 | if(loc.iter() == loc.end()) {return none();} 94 | const auto first = loc.iter(); 95 | 96 | const char c = *(loc.iter()); 97 | if(c < lower || upper < c) 98 | { 99 | return none(); 100 | } 101 | 102 | loc.advance(); 103 | return ok(region(loc, first, loc.iter())); 104 | } 105 | }; 106 | template constexpr char in_range::upper; 107 | template constexpr char in_range::lower; 108 | 109 | // keep iterator if `Combinator` matches. otherwise, increment `iter` by 1 char. 110 | // for detecting invalid characters, like control sequences in toml string. 111 | template 112 | struct exclude 113 | { 114 | static result 115 | invoke(location& loc) 116 | { 117 | if(loc.iter() == loc.end()) {return none();} 118 | auto first = loc.iter(); 119 | 120 | auto rslt = Combinator::invoke(loc); 121 | if(rslt.is_ok()) 122 | { 123 | loc.reset(first); 124 | return none(); 125 | } 126 | loc.reset(std::next(first)); // XXX maybe loc.advance() is okay but... 127 | return ok(region(loc, first, loc.iter())); 128 | } 129 | }; 130 | 131 | // increment `iter`, if matches. otherwise, just return empty string. 132 | template 133 | struct maybe 134 | { 135 | static result 136 | invoke(location& loc) 137 | { 138 | const auto rslt = Combinator::invoke(loc); 139 | if(rslt.is_ok()) 140 | { 141 | return rslt; 142 | } 143 | return ok(region(loc)); 144 | } 145 | }; 146 | 147 | template 148 | struct sequence; 149 | 150 | template 151 | struct sequence 152 | { 153 | static result 154 | invoke(location& loc) 155 | { 156 | const auto first = loc.iter(); 157 | const auto rslt = Head::invoke(loc); 158 | if(rslt.is_err()) 159 | { 160 | loc.reset(first); 161 | return none(); 162 | } 163 | return sequence::invoke(loc, std::move(rslt.unwrap()), first); 164 | } 165 | 166 | // called from the above function only, recursively. 167 | template 168 | static result 169 | invoke(location& loc, region reg, Iterator first) 170 | { 171 | const auto rslt = Head::invoke(loc); 172 | if(rslt.is_err()) 173 | { 174 | loc.reset(first); 175 | return none(); 176 | } 177 | reg += rslt.unwrap(); // concat regions 178 | return sequence::invoke(loc, std::move(reg), first); 179 | } 180 | }; 181 | 182 | template 183 | struct sequence 184 | { 185 | // would be called from sequence::invoke only. 186 | template 187 | static result 188 | invoke(location& loc, region reg, Iterator first) 189 | { 190 | const auto rslt = Head::invoke(loc); 191 | if(rslt.is_err()) 192 | { 193 | loc.reset(first); 194 | return none(); 195 | } 196 | reg += rslt.unwrap(); // concat regions 197 | return ok(reg); 198 | } 199 | }; 200 | 201 | template 202 | struct either; 203 | 204 | template 205 | struct either 206 | { 207 | static result 208 | invoke(location& loc) 209 | { 210 | const auto rslt = Head::invoke(loc); 211 | if(rslt.is_ok()) {return rslt;} 212 | return either::invoke(loc); 213 | } 214 | }; 215 | template 216 | struct either 217 | { 218 | static result 219 | invoke(location& loc) 220 | { 221 | return Head::invoke(loc); 222 | } 223 | }; 224 | 225 | template 226 | struct repeat; 227 | 228 | template struct exactly{}; 229 | template struct at_least{}; 230 | struct unlimited{}; 231 | 232 | template 233 | struct repeat> 234 | { 235 | static result 236 | invoke(location& loc) 237 | { 238 | region retval(loc); 239 | const auto first = loc.iter(); 240 | for(std::size_t i=0; i 255 | struct repeat> 256 | { 257 | static result 258 | invoke(location& loc) 259 | { 260 | region retval(loc); 261 | 262 | const auto first = loc.iter(); 263 | for(std::size_t i=0; i 286 | struct repeat 287 | { 288 | static result 289 | invoke(location& loc) 290 | { 291 | region retval(loc); 292 | while(true) 293 | { 294 | auto rslt = T::invoke(loc); 295 | if(rslt.is_err()) 296 | { 297 | return ok(std::move(retval)); 298 | } 299 | retval += rslt.unwrap(); 300 | } 301 | } 302 | }; 303 | 304 | } // detail 305 | } // toml 306 | #endif// TOML11_COMBINATOR_HPP 307 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Aa][Rr][Mm]/ 27 | [Aa][Rr][Mm]64/ 28 | bld/ 29 | [Bb]in/ 30 | [Oo]bj/ 31 | [Ll]og/ 32 | [Ll]ogs/ 33 | 34 | # Visual Studio 2015/2017 cache/options directory 35 | .vs/ 36 | # Uncomment if you have tasks that create the project's static files in wwwroot 37 | #wwwroot/ 38 | 39 | # Visual Studio 2017 auto generated files 40 | Generated\ Files/ 41 | 42 | # MSTest test Results 43 | [Tt]est[Rr]esult*/ 44 | [Bb]uild[Ll]og.* 45 | 46 | # NUnit 47 | *.VisualState.xml 48 | TestResult.xml 49 | nunit-*.xml 50 | 51 | # Build Results of an ATL Project 52 | [Dd]ebugPS/ 53 | [Rr]eleasePS/ 54 | dlldata.c 55 | 56 | # Benchmark Results 57 | BenchmarkDotNet.Artifacts/ 58 | 59 | # .NET Core 60 | project.lock.json 61 | project.fragment.lock.json 62 | artifacts/ 63 | 64 | # StyleCop 65 | StyleCopReport.xml 66 | 67 | # Files built by Visual Studio 68 | *_i.c 69 | *_p.c 70 | *_h.h 71 | *.ilk 72 | *.meta 73 | *.obj 74 | *.iobj 75 | *.pch 76 | *.ipdb 77 | *.pgc 78 | *.pgd 79 | *.rsp 80 | *.sbr 81 | *.tlb 82 | *.tli 83 | *.tlh 84 | *.tmp 85 | *.tmp_proj 86 | *_wpftmp.csproj 87 | *.log 88 | *.vspscc 89 | *.vssscc 90 | .builds 91 | *.pidb 92 | *.svclog 93 | *.scc 94 | 95 | # Chutzpah Test files 96 | _Chutzpah* 97 | 98 | # Visual C++ cache files 99 | ipch/ 100 | *.aps 101 | *.ncb 102 | *.opendb 103 | *.opensdf 104 | *.sdf 105 | *.cachefile 106 | *.VC.db 107 | *.VC.VC.opendb 108 | 109 | # Visual Studio profiler 110 | *.psess 111 | *.vsp 112 | *.vspx 113 | *.sap 114 | 115 | # Visual Studio Trace Files 116 | *.e2e 117 | 118 | # TFS 2012 Local Workspace 119 | $tf/ 120 | 121 | # Guidance Automation Toolkit 122 | *.gpState 123 | 124 | # ReSharper is a .NET coding add-in 125 | _ReSharper*/ 126 | *.[Rr]e[Ss]harper 127 | *.DotSettings.user 128 | 129 | # TeamCity is a build add-in 130 | _TeamCity* 131 | 132 | # DotCover is a Code Coverage Tool 133 | *.dotCover 134 | 135 | # AxoCover is a Code Coverage Tool 136 | .axoCover/* 137 | !.axoCover/settings.json 138 | 139 | # Visual Studio code coverage results 140 | *.coverage 141 | *.coveragexml 142 | 143 | # NCrunch 144 | _NCrunch_* 145 | .*crunch*.local.xml 146 | nCrunchTemp_* 147 | 148 | # MightyMoose 149 | *.mm.* 150 | AutoTest.Net/ 151 | 152 | # Web workbench (sass) 153 | .sass-cache/ 154 | 155 | # Installshield output folder 156 | [Ee]xpress/ 157 | 158 | # DocProject is a documentation generator add-in 159 | DocProject/buildhelp/ 160 | DocProject/Help/*.HxT 161 | DocProject/Help/*.HxC 162 | DocProject/Help/*.hhc 163 | DocProject/Help/*.hhk 164 | DocProject/Help/*.hhp 165 | DocProject/Help/Html2 166 | DocProject/Help/html 167 | 168 | # Click-Once directory 169 | publish/ 170 | 171 | # Publish Web Output 172 | *.[Pp]ublish.xml 173 | *.azurePubxml 174 | # Note: Comment the next line if you want to checkin your web deploy settings, 175 | # but database connection strings (with potential passwords) will be unencrypted 176 | *.pubxml 177 | *.publishproj 178 | 179 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 180 | # checkin your Azure Web App publish settings, but sensitive information contained 181 | # in these scripts will be unencrypted 182 | PublishScripts/ 183 | 184 | # NuGet Packages 185 | *.nupkg 186 | # NuGet Symbol Packages 187 | *.snupkg 188 | # The packages folder can be ignored because of Package Restore 189 | **/[Pp]ackages/* 190 | # except build/, which is used as an MSBuild target. 191 | !**/[Pp]ackages/build/ 192 | # Uncomment if necessary however generally it will be regenerated when needed 193 | #!**/[Pp]ackages/repositories.config 194 | # NuGet v3's project.json files produces more ignorable files 195 | *.nuget.props 196 | *.nuget.targets 197 | 198 | # Microsoft Azure Build Output 199 | csx/ 200 | *.build.csdef 201 | 202 | # Microsoft Azure Emulator 203 | ecf/ 204 | rcf/ 205 | 206 | # Windows Store app package directories and files 207 | AppPackages/ 208 | BundleArtifacts/ 209 | Package.StoreAssociation.xml 210 | _pkginfo.txt 211 | *.appx 212 | *.appxbundle 213 | *.appxupload 214 | 215 | # Visual Studio cache files 216 | # files ending in .cache can be ignored 217 | *.[Cc]ache 218 | # but keep track of directories ending in .cache 219 | !?*.[Cc]ache/ 220 | 221 | # Others 222 | ClientBin/ 223 | ~$* 224 | *~ 225 | *.dbmdl 226 | *.dbproj.schemaview 227 | *.jfm 228 | *.pfx 229 | *.publishsettings 230 | orleans.codegen.cs 231 | 232 | # Including strong name files can present a security risk 233 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 234 | #*.snk 235 | 236 | # Since there are multiple workflows, uncomment next line to ignore bower_components 237 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 238 | #bower_components/ 239 | 240 | # RIA/Silverlight projects 241 | Generated_Code/ 242 | 243 | # Backup & report files from converting an old project file 244 | # to a newer Visual Studio version. Backup files are not needed, 245 | # because we have git ;-) 246 | _UpgradeReport_Files/ 247 | Backup*/ 248 | UpgradeLog*.XML 249 | UpgradeLog*.htm 250 | ServiceFabricBackup/ 251 | *.rptproj.bak 252 | 253 | # SQL Server files 254 | *.mdf 255 | *.ldf 256 | *.ndf 257 | 258 | # Business Intelligence projects 259 | *.rdl.data 260 | *.bim.layout 261 | *.bim_*.settings 262 | *.rptproj.rsuser 263 | *- [Bb]ackup.rdl 264 | *- [Bb]ackup ([0-9]).rdl 265 | *- [Bb]ackup ([0-9][0-9]).rdl 266 | 267 | # Microsoft Fakes 268 | FakesAssemblies/ 269 | 270 | # GhostDoc plugin setting file 271 | *.GhostDoc.xml 272 | 273 | # Node.js Tools for Visual Studio 274 | .ntvs_analysis.dat 275 | node_modules/ 276 | 277 | # Visual Studio 6 build log 278 | *.plg 279 | 280 | # Visual Studio 6 workspace options file 281 | *.opt 282 | 283 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 284 | *.vbw 285 | 286 | # Visual Studio LightSwitch build output 287 | **/*.HTMLClient/GeneratedArtifacts 288 | **/*.DesktopClient/GeneratedArtifacts 289 | **/*.DesktopClient/ModelManifest.xml 290 | **/*.Server/GeneratedArtifacts 291 | **/*.Server/ModelManifest.xml 292 | _Pvt_Extensions 293 | 294 | # Paket dependency manager 295 | .paket/paket.exe 296 | paket-files/ 297 | 298 | # FAKE - F# Make 299 | .fake/ 300 | 301 | # CodeRush personal settings 302 | .cr/personal 303 | 304 | # Python Tools for Visual Studio (PTVS) 305 | __pycache__/ 306 | *.pyc 307 | 308 | # Cake - Uncomment if you are using it 309 | # tools/** 310 | # !tools/packages.config 311 | 312 | # Tabs Studio 313 | *.tss 314 | 315 | # Telerik's JustMock configuration file 316 | *.jmconfig 317 | 318 | # BizTalk build output 319 | *.btp.cs 320 | *.btm.cs 321 | *.odx.cs 322 | *.xsd.cs 323 | 324 | # OpenCover UI analysis results 325 | OpenCover/ 326 | 327 | # Azure Stream Analytics local run output 328 | ASALocalRun/ 329 | 330 | # MSBuild Binary and Structured Log 331 | *.binlog 332 | 333 | # NVidia Nsight GPU debugger configuration file 334 | *.nvuser 335 | 336 | # MFractors (Xamarin productivity tool) working folder 337 | .mfractor/ 338 | 339 | # Local History for Visual Studio 340 | .localhistory/ 341 | 342 | # BeatPulse healthcheck temp database 343 | healthchecksdb 344 | 345 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 346 | MigrationBackup/ 347 | 348 | # Ionide (cross platform F# VS Code tools) working folder 349 | .ionide/ 350 | *.filters 351 | *.vcxproj 352 | .idea/$CACHE_FILE$ 353 | .idea/Hack4CSGO.iml 354 | .idea/misc.xml 355 | *.xml 356 | *.cmake 357 | *.bin 358 | *.exe 359 | cmake-build-debug/CMakeFiles/3.16.5/CompilerIdCXX/CMakeCXXCompilerId.cpp 360 | cmake-build-debug/CMakeFiles/clion-environment.txt 361 | cmake-build-debug/CMakeFiles/3.16.5/CompilerIdC/CMakeCCompilerId.c 362 | cmake-build-debug/CMakeFiles/clion-log.txt 363 | cmake-build-debug/CMakeFiles/cmake.check_cache 364 | cmake-build-debug/CMakeFiles/Hack.dir/build.make 365 | cmake-build-debug/CMakeFiles/Hack.dir/depend.make 366 | cmake-build-debug/CMakeFiles/Hack.dir/flags.make 367 | cmake-build-debug/CMakeFiles/HACK4CSGO.dir/intermediate.manifest 368 | cmake-build-debug/CMakeFiles/HACK4CSGO.dir/flags.make 369 | cmake-build-debug/CMakeFiles/HACK4CSGO.dir/embed.manifest 370 | cmake-build-debug/CMakeFiles/HACK4CSGO.dir/depend.make 371 | cmake-build-debug/CMakeFiles/HACK4CSGO.dir/depend.internal 372 | cmake-build-debug/CMakeFiles/HACK4CSGO.dir/CXX.includecache 373 | cmake-build-debug/CMakeFiles/HACK4CSGO.dir/build.make 374 | cmake-build-debug/CMakeFiles/Hack.dir/progress.make 375 | cmake-build-debug/CMakeCache.txt 376 | cmake-build-debug/CMakeFiles/HACK4CSGO.dir/manifest.rc 377 | cmake-build-debug/CMakeFiles/HACK4CSGO.dir/manifest.res 378 | cmake-build-debug/CMakeFiles/HACK4CSGO.dir/progress.make 379 | cmake-build-debug/CMakeFiles/Makefile2 380 | cmake-build-debug/CMakeFiles/progress.marks 381 | cmake-build-debug/CMakeFiles/TargetDirectories.txt 382 | cmake-build-debug/HACK4CSGO.cbp 383 | cmake-build-debug/HACK4CSGO.dll 384 | cmake-build-debug/Makefile 385 | 386 | build/ 387 | 388 | .idea/ 389 | 390 | cmake-build-debug/CMakeFiles/Dainsleif.dir/ 391 | 392 | cmake-build-debug/ 393 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![cpp](https://img.shields.io/badge/C%2B%2B-17-%23ff40d9.svg?style=flat) 2 | ![cmake](https://img.shields.io/badge/cmake-3.16-yellow) 3 | ![Game](https://img.shields.io/badge/Game-CS%3AGO-blue.svg?style=flat) 4 | ![License](http://img.shields.io/badge/license-MIT-yellowgreen.svg?style=flat) 5 | 6 | 7 | [![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors-) 8 | 9 | 10 | **[日本語版README](https://github.com/vxcall/Dainsleif/blob/master/README_jp.md)** 11 | 12 | [![Banner](https://user-images.githubusercontent.com/33578715/90916494-b9be7600-e413-11ea-8dee-ffea384afb2e.png)](https://github.com/vxcall/Dainsleif) 13 | Image's gifted by my big friend [@suzuharuR](https://twitter.com/suzuharuR) 14 | 15 | # :zap: Dainsleif 16 | 17 | This is an internal cheat for **_Counter-Strike: Global Offensive_** I've been working on as my training of reverse engineering. 18 | 19 | **Disclaimer**: Since I don't intend this to be a malicious software, this isn't considered to be performed in multi player mode. 20 | **We won't take any responsibility if a problem occurrs because of this software.** Keep that in mind. 21 | 22 | As of today, Dainsleif is a quite simple cheat, so it'll be easy to read and understand. This software is published as MIT license in addition. 23 | 24 | # development is suspended 25 | This project will no longer get major update by @vxcall due to loss of motivation, so don't expect further improvements. 26 | It might be the exception if huge errors appeared tho. idk. 27 | It's still open for pull requests. 28 | 29 | # :pushpin: Table of contents 30 | 31 | - [:syringe: How to build this hack](#syringe-how-to-build-this-hack) 32 | - [:rotating_light: TROUBLE SHOOTING](#rotating_light-trouble-shooting) 33 | - [:scroll: Menu](#scroll-menu) 34 | - [:computer: Hacks](#computer-hacks) 35 | - [Aimbot](#aimbot) 36 | - [Glow hack](#glow-hack) 37 | - [ESP hack](#esp-hack) 38 | - [Trigger bot](#trigger-bot) 39 | - [Anti recoil](#anti-recoil) 40 | - [Minimap hack](#minimap-hack) 41 | - [Anti AFK](#anti-afk) 42 | - [FOV](#fov) 43 | - [:put_litter_in_its_place: Uninstall](#put_litter_in_its_place-uninstall) 44 | - [:busts_in_silhouette: Contributors](#busts_in_silhouette-contributors) 45 | - [:hammer_and_wrench: Features being developed](#hammer_and_wrench-features-being-developed) 46 | 47 | # :syringe: How to build this hack 48 | 49 | ### requirement 50 | - [DirectxSDK](https://www.microsoft.com/en-au/download/details.aspx?id=6812) 51 | - Visual studio 2019 52 | 53 | You can select from two ways to build this hack. 54 | I believe all you need in order to build this project except DirectxSDK is already included which is [Minhook](https://github.com/TsudaKageyu/minhook), [ImGui](https://github.com/ocornut/imgui), and [toml11](https://github.com/ToruNiina/toml11). 55 | They're in Dependencies directory. 56 | 57 | ### Build project 58 | 59 | **>>>>> edit(February 23, 2022) <<<<<** 60 | 61 | **Visit [Release](https://github.com/vxcall/Dainsleif/releases) and download [Dainsleif v1.5](https://github.com/vxcall/Dainsleif/releases/tag/v1.5), then build it with Visual Studio 2019 and its all done, ignore everything else below this. It's the easiest way to build this.** 62 | 63 | If you have Visual Studio 2019, you must installed `Developer Command Prompt for Visual Studio` at the same time. 64 | Launch it and go to any directory you wanna clone Dainsleif in, and run following commands. 65 | 66 | ```Shell 67 | $ git clone https://github.com/vxcall/Dainsleif.git --recursive 68 | $ cd Dainsleif 69 | ``` 70 | 71 | For compiling the cheat, there is a convenient batch script that automates the process. All you need to do is run it: 72 | 73 | ```Shell 74 | $ .\compile.bat 75 | ``` 76 | 77 | After finished compiling, `Dainsleif.dll` will be in the debug folder. 78 | 79 | **Once you get the `Dainsleif.dll`, you can now inject it to the game with any DLL injector such as [GH injector](https://guidedhacking.com/resources/guided-hacking-dll-injector.4/) :)** 80 | 81 | Needless to say, add `-insecure` flag in your launch option in order to taste this cheat without VAC scan. Otherwise you could get banned. 82 | 83 | # :rotating_light: TROUBLE SHOOTING 84 | 85 | **Something goes wrong? We've prepared [Wiki](https://github.com/vxcall/Dainsleif/wiki/Trouble-shooting) for you :sunglasses:** 86 | 87 | # :scroll: Menu 88 | 89 | You're accessible to the hack menu by pressing INSERT key on your keyboard. (While the menu is open, input to CSGO will be locked) 90 | 91 | You can toggle on/off and tweak parameters in the tabs with the name of each hack. 92 | 93 | ![Hack menu](https://user-images.githubusercontent.com/33578715/91472649-5aa4a980-e8ca-11ea-8352-21b6400a494b.gif) 94 | 95 | You can choose what hacks to be visible with the menu bar. 96 | Several hacks're set to invisible by default. 97 | ![menu visible](https://user-images.githubusercontent.com/33578715/91351549-0f7f8d80-e81b-11ea-9216-e7d77a0566d1.png) 98 | 99 | # :computer: Hacks 100 | 101 | ## Aimbot 102 | 103 | This is the feature I can guarantee the highest quality in the hacks I offer here. 104 | 105 | Turning this function on automatically lets you aim at enemy's head with 100% precision. 106 | It select the closest enemy from where your crosshair is as a target. 107 | 108 | Tweaking Smoothness bar affects the smoothness of sticking aim. 109 | By changing the value of the Range bar, you can change the range in which the aimbot will react 110 | 111 | ![aimbot](https://user-images.githubusercontent.com/33578715/89108283-b31e8d80-d469-11ea-8e55-e4e469d74576.gif) 112 | 113 | ## Glow hack 114 | 115 | This feature allows you to see both opponents and teammate's outline through walls. 116 | 117 | ![Glow hack](https://user-images.githubusercontent.com/33578715/89087560-48b51100-d3c7-11ea-9ada-8ef04acfa52c.png) 118 | 119 | ## ESP hack 120 | 121 | With this hack turned on: 122 | - Red and green lines from player's foot position towards every enemies and allies are displayed. 123 | - Outline rectangles are drawn on the players 124 | 125 | ![esp](https://user-images.githubusercontent.com/33578715/92253522-30726d80-ef02-11ea-80d3-fdb7045851d0.png) 126 | 127 | ## Trigger bot 128 | 129 | Once you turn this on, you no longer have to press left click when you engage them. 130 | This feature will complete the job for you. 131 | 132 | This is designed to use in conjunction with Aimbot. 133 | 134 | ## Anti recoil 135 | 136 | This is basically a recoil control system. 137 | It automatically calculate the in comming recoil and manipulate your angle to handle it. 138 | But this doesn't guarantee the 100% accuracy. 139 | 140 | ![Anti recoil](https://user-images.githubusercontent.com/33578715/89087634-769a5580-d3c7-11ea-83b1-dc31345e7424.png) 141 | 142 | ## Minimap hack 143 | 144 | Minimap hack will show you all enemy positions on the mini map as a red dot even if they're not in your sight which would be super cool. 145 | 146 | ![Minimap hack](https://user-images.githubusercontent.com/33578715/96349413-0c4da300-10e2-11eb-8ba9-b1965b1a7dfb.png) 147 | 148 | ## Anti AFK 149 | 150 | This feature basically make you move randomly every 50 seconds so that you probably not gonna get kicked automatically I guess. 151 | 152 | ## FOV 153 | 154 | You can change your field of view from 60 to 120 degrees. 155 | 156 | # :put_litter_in_its_place: Uninstall 157 | 158 | Since this cheat creates some setting files, u have to follow this to clear things up. 159 | 160 | All setting files are located at `C:\Users\Public\Documents\Dainsleif`, so delete this folder and you're good. 161 | Of course don't forget to delete exe file itself. 162 | 163 | # :busts_in_silhouette: Contributors 164 | 165 | I couldn't have got this far without them ([emoji key](https://allcontributors.org/docs/en/emoji-key)): 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 |

L1m0n3

💻 🚧

tomsa

💻 🐛 🤔

Peter Hackersøn

🚧 🤔
177 | 178 | 179 | 180 | 181 | 182 | 183 | **Unintentional contributors:** 184 | 185 | - [Osiris project](https://github.com/danielkrupinski/Osiris) 186 | - [Hazedumper project](https://github.com/frk1/hazedumper) 187 | - [Guided Hacking](https://guidedhacking.com) 188 | -------------------------------------------------------------------------------- /Dainsleif/Hook/DrawGUI.cpp: -------------------------------------------------------------------------------- 1 | #include "DrawGUI.h" 2 | #include 3 | #include "../Player.h" 4 | #include "../Save/OffsetsToml.h" 5 | #include "GraphicHook.h" 6 | 7 | extern int fov; //declared in dllmain.cpp 8 | extern float aimSmoothness, range; //declared in Hacks/Aimbot.cpp 9 | extern ImVec4 enemyGlowColor, localGlowColor; 10 | 11 | extern bool inGame; 12 | extern std::string offsetsFile; //declared in dllmain.cpp 13 | 14 | void HelpMarker(const char* title, const std::string& desc) 15 | { 16 | ImGui::TextDisabled("%s", title); 17 | if (ImGui::IsItemHovered()) 18 | { 19 | ImGui::BeginTooltip(); 20 | ImGui::PushTextWrapPos(ImGui::GetFontSize() * 35.0f); 21 | ImGui::TextUnformatted(desc.c_str()); 22 | ImGui::PopTextWrapPos(); 23 | ImGui::EndTooltip(); 24 | } 25 | } 26 | 27 | bool show_updated_modal = false; 28 | 29 | std::map UpdateOffsets() { 30 | OffsetsToml::Update(offsetsFile); 31 | std::map offsets = OffsetsToml::Fetch(offsetsFile); 32 | show_updated_modal = true; 33 | return offsets; 34 | } 35 | 36 | void ShowModal(const char* message) { 37 | ImGui::OpenPopup("Modal"); 38 | 39 | // Always center this window when appearing 40 | ImVec2 center(ImGui::GetIO().DisplaySize.x * 0.5f, ImGui::GetIO().DisplaySize.y * 0.5f); 41 | ImGui::SetNextWindowPos(center, ImGuiCond_Appearing, ImVec2(0.5f, 0.5f)); 42 | 43 | if (ImGui::BeginPopupModal("Modal", NULL, ImGuiWindowFlags_AlwaysAutoResize)) 44 | { 45 | ImGui::Spacing(); 46 | ImGui::Spacing(); 47 | ImGui::TextColored((ImVec4)ImColor::HSV(0.57f, 0.6f, 0.8f), "%s", message); 48 | ImGui::Spacing(); 49 | ImGui::Spacing(); 50 | 51 | ImGui::PushStyleColor(ImGuiCol_Button, (ImVec4)ImColor::HSV(0.57f, 0.6f, 0.6f)); 52 | ImGui::PushStyleColor(ImGuiCol_ButtonHovered, (ImVec4)ImColor::HSV(0.57f, 0.7f, 0.7f)); 53 | ImGui::PushStyleColor(ImGuiCol_ButtonActive, (ImVec4)ImColor::HSV(0.57f, 0.8f, 0.8f)); 54 | if (ImGui::Button("OK", ImVec2(170, 0))) { 55 | ImGui::CloseCurrentPopup(); 56 | show_updated_modal = false; 57 | } 58 | ImGui::PopStyleColor(3); 59 | ImGui::SetItemDefaultFocus(); 60 | ImGui::EndPopup(); 61 | } 62 | } 63 | 64 | /* NOTE: When a new element which manipulates a hack parameter is added to the menu, you have to modify following 4 places in this project. 65 | * Fetch() in OffsetsToml.cpp 66 | * Save() in OffsetsToml.cpp 67 | * setToDefault function 68 | * DefaultSettings.h 69 | */ 70 | 71 | void setToDefault(Hack_label label) { 72 | switch (label) { 73 | case ALL: 74 | HackFlags::bAimbot = Default::bAimbot; 75 | aimSmoothness = Default::aimSmoothness; 76 | range = Default::range; 77 | HackFlags::bGlowHack = Default::bGlowhack; 78 | enemyGlowColor = Default::enemyGlowColor; 79 | localGlowColor = Default::localGlowColor; 80 | HackFlags::bAntiRecoil = Default::bAntiRecoil; 81 | HackFlags::bTriggerBot = Default::bTriggerBot; 82 | HackFlags::bBunnyhop = Default::bBunnyhop; 83 | HackFlags::bAntiAFK = Default::bAntiAFK; 84 | HackFlags::bEsp = Default::bEsp; 85 | HackFlags::bLineOverlay = Default::bLineOverlay; 86 | HackFlags::bRectOverlay = Default::bRectOverlay; 87 | HackFlags:: bMinimapHack = Default::bMinimapHack; 88 | fov = Default::fov; 89 | break; 90 | case AIMBOT: 91 | HackFlags::bAimbot = Default::bAimbot; 92 | aimSmoothness = Default::aimSmoothness; 93 | range = Default::range; 94 | break; 95 | case GLOWHACK: 96 | HackFlags::bGlowHack = Default::bGlowhack; 97 | enemyGlowColor = Default::enemyGlowColor; 98 | localGlowColor = Default::localGlowColor; 99 | break; 100 | case ANTIRECOIL: 101 | HackFlags::bAntiRecoil = Default::bAntiRecoil; 102 | break; 103 | case TRIGGERBOT: 104 | HackFlags::bTriggerBot = Default::bTriggerBot; 105 | break; 106 | case BUNNYHOP: 107 | HackFlags::bBunnyhop = Default::bBunnyhop; 108 | break; 109 | case FOV: 110 | fov = Default::fov; 111 | break; 112 | case ANTIAFK: 113 | HackFlags::bAntiAFK = Default::bAntiAFK; 114 | case ESP: 115 | HackFlags::bEsp = Default::bEsp; 116 | HackFlags::bLineOverlay = Default::bLineOverlay; 117 | HackFlags::bRectOverlay = Default::bRectOverlay; 118 | case MINIMAPHACK: 119 | HackFlags::bMinimapHack = Default::bMinimapHack; 120 | } 121 | } 122 | 123 | void ShowMenuBar(std::map& visibleHacks) 124 | { 125 | static std::map newOffsets; 126 | if(show_updated_modal) { 127 | std::string offsetString; 128 | offsetString.reserve(300); //allocating memory beforehand for performance reason. 129 | offsetString = "Updating offsets has done!\nNew offsets:\n\n"; 130 | for (auto& offset : newOffsets) { 131 | offsetString += offset.first; 132 | offsetString += ": "; 133 | offsetString += std::to_string(offset.second); 134 | offsetString += "\n"; 135 | } 136 | ShowModal(offsetString.data()); 137 | } 138 | 139 | if (ImGui::BeginMenuBar()) { 140 | // Menu 1 141 | if (ImGui::BeginMenu("Menu")) { 142 | // First menu in Menu 143 | if (ImGui::BeginMenu("Set to default")) { 144 | if (ImGui::MenuItem("Everything")) { 145 | setToDefault(ALL); 146 | } else if (ImGui::MenuItem("Aim bot")) { 147 | setToDefault(AIMBOT); 148 | } else if (ImGui::MenuItem("Glow hack")){ 149 | setToDefault(GLOWHACK); 150 | } else if (ImGui::MenuItem("Anti recoil")) { 151 | setToDefault(ANTIRECOIL); 152 | } else if (ImGui::MenuItem("Trigger bot")) { 153 | setToDefault(TRIGGERBOT); 154 | } else if (ImGui::MenuItem("Bunnyhop")) { 155 | setToDefault(BUNNYHOP); 156 | } else if (ImGui::MenuItem("Anti AFK")) { 157 | setToDefault(ANTIAFK); 158 | } else if (ImGui::MenuItem("FOV")) { 159 | setToDefault(FOV); 160 | } else if (ImGui::MenuItem("ESP")) { 161 | setToDefault(ESP); 162 | } else if (ImGui::MenuItem("Minimap hack")) { 163 | setToDefault(MINIMAPHACK); 164 | } 165 | ImGui::EndMenu(); 166 | } 167 | if (ImGui::MenuItem("Update offsets")) { 168 | newOffsets = UpdateOffsets(); 169 | } 170 | if (ImGui::MenuItem("Remove hack")) 171 | HackFlags::bQuit = true; 172 | ImGui::EndMenu(); 173 | } 174 | // Menu 2 175 | if (ImGui::BeginMenu("Hacks")) { 176 | for (auto& [key, value] : visibleHacks) { 177 | ImGui::MenuItem(key.c_str(), NULL, &value); 178 | } 179 | ImGui::EndMenu(); 180 | } 181 | ImGui::EndMenuBar(); 182 | } 183 | } 184 | 185 | void ShowTabMenu(std::map& visibleHacks) { 186 | Player* localPlayer = Player::GetLocalPlayer(); 187 | static ImGuiTabBarFlags tab_bar_flags = ImGuiTabBarFlags_Reorderable; 188 | if (ImGui::BeginTabBar("Hack_tab_bar", tab_bar_flags)) 189 | { 190 | if (ImGui::BeginTabItem("Aim bot", &visibleHacks.at("Aim Bot"))) 191 | { 192 | ImGui::Checkbox("Enable Aim bot", &HackFlags::bAimbot); 193 | ImGui::SliderFloat("Smoothness", &aimSmoothness, 0.005f, 0.4f); 194 | ImGui::SliderFloat("Range", &range, 1.f, 30.f); 195 | ImGui::EndTabItem(); 196 | } 197 | if (ImGui::BeginTabItem("Glow hack", &visibleHacks.at("Glow Hack"))) 198 | { 199 | ImGui::Checkbox("Enable Glow hack", &HackFlags::bGlowHack); 200 | ImGui::ColorEdit4("Enemy Color", (float*)&enemyGlowColor); 201 | ImGui::ColorEdit4("Teammate color", (float*)&localGlowColor); 202 | ImGui::EndTabItem(); 203 | } 204 | if (ImGui::BeginTabItem("Anti Recoil", &visibleHacks.at("Anti Recoil"))) 205 | { 206 | ImGui::Checkbox("Enable Anti recoil", &HackFlags::bAntiRecoil); 207 | ImGui::EndTabItem(); 208 | } 209 | if (ImGui::BeginTabItem("Trigger bot", &visibleHacks.at("Trigger Bot"))) 210 | { 211 | ImGui::Checkbox("Enable Trigger bot", &HackFlags::bTriggerBot); 212 | ImGui::EndTabItem(); 213 | } 214 | if (ImGui::BeginTabItem("Bunnyhop", &visibleHacks.at("Bunnyhop"))) 215 | { 216 | ImGui::Checkbox("Enable Bunnyhop", &HackFlags::bBunnyhop); 217 | ImGui::EndTabItem(); 218 | } 219 | if (ImGui::BeginTabItem("Anti AFK", &visibleHacks.at("Anti AFK"))) 220 | { 221 | ImGui::Checkbox("Enable AntiAFK", &HackFlags::bAntiAFK); 222 | ImGui::EndTabItem(); 223 | } 224 | if (ImGui::BeginTabItem("Field of View", &visibleHacks.at("Fov"))) 225 | { 226 | ImGui::SliderInt("Field of view(FOV)", &fov, 60, 120); 227 | ImGui::EndTabItem(); 228 | } 229 | if (ImGui::BeginTabItem("ESP ", &visibleHacks.at("Esp"))) 230 | { 231 | ImGui::Checkbox("Enable ESP", &HackFlags::bEsp); 232 | if (HackFlags::bEsp) { 233 | ImGui::Checkbox("Enable Line overlay", &HackFlags::bLineOverlay); 234 | ImGui::Checkbox("Enable Rectangle overlay", &HackFlags::bRectOverlay); 235 | } 236 | ImGui::EndTabItem(); 237 | } 238 | if (ImGui::BeginTabItem("Minimap hack", &visibleHacks.at("Minimap Hack"))) 239 | { 240 | ImGui::Checkbox("Enable Minimap hack", &HackFlags::bMinimapHack); 241 | ImGui::EndTabItem(); 242 | } 243 | 244 | } 245 | ImGui::EndTabBar(); 246 | } -------------------------------------------------------------------------------- /Dependencies/toml11/toml/traits.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Toru Niina 2017. 2 | // Distributed under the MIT License. 3 | #ifndef TOML11_TRAITS_HPP 4 | #define TOML11_TRAITS_HPP 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | #if __cplusplus >= 201703L 13 | #if __has_include() 14 | #include 15 | #endif // has_include() 16 | #endif // cplusplus >= C++17 17 | 18 | namespace toml 19 | { 20 | template class T, template class A> 21 | class basic_value; 22 | 23 | namespace detail 24 | { 25 | // --------------------------------------------------------------------------- 26 | // check whether type T is a kind of container/map class 27 | 28 | struct has_iterator_impl 29 | { 30 | template static std::true_type check(typename T::iterator*); 31 | template static std::false_type check(...); 32 | }; 33 | struct has_value_type_impl 34 | { 35 | template static std::true_type check(typename T::value_type*); 36 | template static std::false_type check(...); 37 | }; 38 | struct has_key_type_impl 39 | { 40 | template static std::true_type check(typename T::key_type*); 41 | template static std::false_type check(...); 42 | }; 43 | struct has_mapped_type_impl 44 | { 45 | template static std::true_type check(typename T::mapped_type*); 46 | template static std::false_type check(...); 47 | }; 48 | struct has_reserve_method_impl 49 | { 50 | template static std::false_type check(...); 51 | template static std::true_type check( 52 | decltype(std::declval().reserve(std::declval()))*); 53 | }; 54 | struct has_push_back_method_impl 55 | { 56 | template static std::false_type check(...); 57 | template static std::true_type check( 58 | decltype(std::declval().push_back(std::declval()))*); 59 | }; 60 | struct is_comparable_impl 61 | { 62 | template static std::false_type check(...); 63 | template static std::true_type check( 64 | decltype(std::declval() < std::declval())*); 65 | }; 66 | 67 | struct has_from_toml_method_impl 68 | { 69 | template class Tb, template class A> 71 | static std::true_type check( 72 | decltype(std::declval().from_toml( 73 | std::declval<::toml::basic_value>()))*); 74 | 75 | template class Tb, template class A> 77 | static std::false_type check(...); 78 | }; 79 | struct has_into_toml_method_impl 80 | { 81 | template 82 | static std::true_type check(decltype(std::declval().into_toml())*); 83 | template 84 | static std::false_type check(...); 85 | }; 86 | 87 | /// Intel C++ compiler can not use decltype in parent class declaration, here 88 | /// is a hack to work around it. https://stackoverflow.com/a/23953090/4692076 89 | #ifdef __INTEL_COMPILER 90 | #define decltype(...) std::enable_if::type 91 | #endif 92 | 93 | template 94 | struct has_iterator : decltype(has_iterator_impl::check(nullptr)){}; 95 | template 96 | struct has_value_type : decltype(has_value_type_impl::check(nullptr)){}; 97 | template 98 | struct has_key_type : decltype(has_key_type_impl::check(nullptr)){}; 99 | template 100 | struct has_mapped_type : decltype(has_mapped_type_impl::check(nullptr)){}; 101 | template 102 | struct has_reserve_method : decltype(has_reserve_method_impl::check(nullptr)){}; 103 | template 104 | struct has_push_back_method : decltype(has_push_back_method_impl::check(nullptr)){}; 105 | template 106 | struct is_comparable : decltype(is_comparable_impl::check(nullptr)){}; 107 | 108 | template class Tb, template class A> 110 | struct has_from_toml_method 111 | : decltype(has_from_toml_method_impl::check(nullptr)){}; 112 | 113 | template 114 | struct has_into_toml_method 115 | : decltype(has_into_toml_method_impl::check(nullptr)){}; 116 | 117 | #ifdef __INTEL_COMPILER 118 | #undef decltype 119 | #endif 120 | 121 | // --------------------------------------------------------------------------- 122 | // C++17 and/or/not 123 | 124 | #if __cplusplus >= 201703L 125 | 126 | using std::conjunction; 127 | using std::disjunction; 128 | using std::negation; 129 | 130 | #else 131 | 132 | template struct conjunction : std::true_type{}; 133 | template struct conjunction : T{}; 134 | template 135 | struct conjunction : 136 | std::conditional(T::value), conjunction, T>::type 137 | {}; 138 | 139 | template struct disjunction : std::false_type{}; 140 | template struct disjunction : T {}; 141 | template 142 | struct disjunction : 143 | std::conditional(T::value), T, disjunction>::type 144 | {}; 145 | 146 | template 147 | struct negation : std::integral_constant(T::value)>{}; 148 | 149 | #endif 150 | 151 | // --------------------------------------------------------------------------- 152 | // type checkers 153 | 154 | template struct is_std_pair : std::false_type{}; 155 | template 156 | struct is_std_pair> : std::true_type{}; 157 | 158 | template struct is_std_tuple : std::false_type{}; 159 | template 160 | struct is_std_tuple> : std::true_type{}; 161 | 162 | template struct is_std_forward_list : std::false_type{}; 163 | template 164 | struct is_std_forward_list> : std::true_type{}; 165 | 166 | template struct is_chrono_duration: std::false_type{}; 167 | template 168 | struct is_chrono_duration>: std::true_type{}; 169 | 170 | template 171 | struct is_map : conjunction< // map satisfies all the following conditions 172 | has_iterator, // has T::iterator 173 | has_value_type, // has T::value_type 174 | has_key_type, // has T::key_type 175 | has_mapped_type // has T::mapped_type 176 | >{}; 177 | template struct is_map : is_map{}; 178 | template struct is_map : is_map{}; 179 | template struct is_map : is_map{}; 180 | template struct is_map : is_map{}; 181 | 182 | template 183 | struct is_container : conjunction< 184 | negation>, // not a map 185 | negation>, // not a std::string 186 | #if __cplusplus >= 201703L 187 | negation>, // not a std::string_view 188 | #endif 189 | has_iterator, // has T::iterator 190 | has_value_type // has T::value_type 191 | >{}; 192 | template struct is_container : is_container{}; 193 | template struct is_container : is_container{}; 194 | template struct is_container : is_container{}; 195 | template struct is_container : is_container{}; 196 | 197 | template 198 | struct is_basic_value: std::false_type{}; 199 | template struct is_basic_value : is_basic_value{}; 200 | template struct is_basic_value : is_basic_value{}; 201 | template struct is_basic_value : is_basic_value{}; 202 | template struct is_basic_value : is_basic_value{}; 203 | template class M, template class V> 204 | struct is_basic_value<::toml::basic_value>: std::true_type{}; 205 | 206 | // --------------------------------------------------------------------------- 207 | // C++14 index_sequence 208 | 209 | #if __cplusplus >= 201402L 210 | 211 | using std::index_sequence; 212 | using std::make_index_sequence; 213 | 214 | #else 215 | 216 | template struct index_sequence{}; 217 | 218 | template struct push_back_index_sequence{}; 219 | template 220 | struct push_back_index_sequence, N> 221 | { 222 | typedef index_sequence type; 223 | }; 224 | 225 | template 226 | struct index_sequence_maker 227 | { 228 | typedef typename push_back_index_sequence< 229 | typename index_sequence_maker::type, N>::type type; 230 | }; 231 | template<> 232 | struct index_sequence_maker<0> 233 | { 234 | typedef index_sequence<0> type; 235 | }; 236 | template 237 | using make_index_sequence = typename index_sequence_maker::type; 238 | 239 | #endif // __cplusplus >= 2014 240 | 241 | // --------------------------------------------------------------------------- 242 | // C++14 enable_if_t 243 | 244 | #if __cplusplus >= 201402L 245 | 246 | using std::enable_if_t; 247 | 248 | #else 249 | 250 | template 251 | using enable_if_t = typename std::enable_if::type; 252 | 253 | #endif // __cplusplus >= 2014 254 | 255 | // --------------------------------------------------------------------------- 256 | // return_type_of_t 257 | 258 | #if __cplusplus >= 201703L 259 | 260 | template 261 | using return_type_of_t = std::invoke_result_t; 262 | 263 | #else 264 | // result_of is deprecated after C++17 265 | template 266 | using return_type_of_t = typename std::result_of::type; 267 | 268 | #endif 269 | 270 | // --------------------------------------------------------------------------- 271 | // is_string_literal 272 | // 273 | // to use this, pass `typename remove_reference::type` to T. 274 | 275 | template 276 | struct is_string_literal: 277 | disjunction< 278 | std::is_same, 279 | conjunction< 280 | std::is_array, 281 | std::is_same::type> 282 | > 283 | >{}; 284 | 285 | // --------------------------------------------------------------------------- 286 | // C++20 remove_cvref_t 287 | 288 | template 289 | struct remove_cvref 290 | { 291 | using type = typename std::remove_cv< 292 | typename std::remove_reference::type>::type; 293 | }; 294 | 295 | template 296 | using remove_cvref_t = typename remove_cvref::type; 297 | 298 | }// detail 299 | }//toml 300 | #endif // TOML_TRAITS 301 | -------------------------------------------------------------------------------- /Dependencies/toml11/toml/lexer.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Toru Niina 2017. 2 | // Distributed under the MIT License. 3 | #ifndef TOML11_LEXER_HPP 4 | #define TOML11_LEXER_HPP 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include "combinator.hpp" 11 | 12 | namespace toml 13 | { 14 | namespace detail 15 | { 16 | 17 | // these scans contents from current location in a container of char 18 | // and extract a region that matches their own pattern. 19 | // to see the implementation of each component, see combinator.hpp. 20 | 21 | using lex_wschar = either, character<'\t'>>; 22 | using lex_ws = repeat>; 23 | using lex_newline = either, 24 | sequence, character<'\n'>>>; 25 | using lex_lower = in_range<'a', 'z'>; 26 | using lex_upper = in_range<'A', 'Z'>; 27 | using lex_alpha = either; 28 | using lex_digit = in_range<'0', '9'>; 29 | using lex_nonzero = in_range<'1', '9'>; 30 | using lex_oct_dig = in_range<'0', '7'>; 31 | using lex_bin_dig = in_range<'0', '1'>; 32 | using lex_hex_dig = either, in_range<'a', 'f'>>; 33 | 34 | using lex_hex_prefix = sequence, character<'x'>>; 35 | using lex_oct_prefix = sequence, character<'o'>>; 36 | using lex_bin_prefix = sequence, character<'b'>>; 37 | using lex_underscore = character<'_'>; 38 | using lex_plus = character<'+'>; 39 | using lex_minus = character<'-'>; 40 | using lex_sign = either; 41 | 42 | // digit | nonzero 1*(digit | _ digit) 43 | using lex_unsigned_dec_int = either>, at_least<1>>>, 45 | lex_digit>; 46 | // (+|-)? unsigned_dec_int 47 | using lex_dec_int = sequence, lex_unsigned_dec_int>; 48 | 49 | // hex_prefix hex_dig *(hex_dig | _ hex_dig) 50 | using lex_hex_int = sequence>, unlimited>>>; 52 | // oct_prefix oct_dig *(oct_dig | _ oct_dig) 53 | using lex_oct_int = sequence>, unlimited>>>; 55 | // bin_prefix bin_dig *(bin_dig | _ bin_dig) 56 | using lex_bin_int = sequence>, unlimited>>>; 58 | 59 | // (dec_int | hex_int | oct_int | bin_int) 60 | using lex_integer = either; 61 | 62 | // =========================================================================== 63 | 64 | using lex_inf = sequence, character<'n'>, character<'f'>>; 65 | using lex_nan = sequence, character<'a'>, character<'n'>>; 66 | using lex_special_float = sequence, either>; 67 | 68 | using lex_zero_prefixable_int = sequence>, unlimited>>; 70 | 71 | using lex_fractional_part = sequence, lex_zero_prefixable_int>; 72 | 73 | using lex_exponent_part = sequence, character<'E'>>, 74 | maybe, lex_zero_prefixable_int>; 75 | 76 | using lex_float = either>>>>; 79 | 80 | // =========================================================================== 81 | 82 | using lex_true = sequence, character<'r'>, 83 | character<'u'>, character<'e'>>; 84 | using lex_false = sequence, character<'a'>, character<'l'>, 85 | character<'s'>, character<'e'>>; 86 | using lex_boolean = either; 87 | 88 | // =========================================================================== 89 | 90 | using lex_date_fullyear = repeat>; 91 | using lex_date_month = repeat>; 92 | using lex_date_mday = repeat>; 93 | using lex_time_delim = either, character<'t'>, character<' '>>; 94 | using lex_time_hour = repeat>; 95 | using lex_time_minute = repeat>; 96 | using lex_time_second = repeat>; 97 | using lex_time_secfrac = sequence, 98 | repeat>>; 99 | 100 | using lex_time_numoffset = sequence, character<'-'>>, 101 | sequence, 102 | lex_time_minute>>; 103 | using lex_time_offset = either, character<'z'>, 104 | lex_time_numoffset>; 105 | 106 | using lex_partial_time = sequence, 107 | lex_time_minute, character<':'>, 108 | lex_time_second, maybe>; 109 | using lex_full_date = sequence, 110 | lex_date_month, character<'-'>, 111 | lex_date_mday>; 112 | using lex_full_time = sequence; 113 | 114 | using lex_offset_date_time = sequence; 115 | using lex_local_date_time = sequence; 116 | using lex_local_date = lex_full_date; 117 | using lex_local_time = lex_partial_time; 118 | 119 | // =========================================================================== 120 | 121 | using lex_quotation_mark = character<'"'>; 122 | using lex_basic_unescaped = exclude, // 0x09 (tab) 123 | in_range<0x0a, 0x1F>, // is allowed 124 | character<0x22>, character<0x5C>, 125 | character<0x7F>>>; 126 | 127 | using lex_escape = character<'\\'>; 128 | using lex_escape_unicode_short = sequence, 129 | repeat>>; 130 | using lex_escape_unicode_long = sequence, 131 | repeat>>; 132 | using lex_escape_seq_char = either, character<'\\'>, 133 | character<'b'>, character<'f'>, 134 | character<'n'>, character<'r'>, 135 | character<'t'>, 136 | lex_escape_unicode_short, 137 | lex_escape_unicode_long 138 | >; 139 | using lex_escaped = sequence; 140 | using lex_basic_char = either; 141 | using lex_basic_string = sequence, 143 | lex_quotation_mark>; 144 | 145 | // After toml post-v0.5.0, it is explicitly clarified how quotes in ml-strings 146 | // are allowed to be used. 147 | // After this, the following strings are *explicitly* allowed. 148 | // - One or two `"`s in a multi-line basic string is allowed wherever it is. 149 | // - Three consecutive `"`s in a multi-line basic string is considered as a delimiter. 150 | // - One or two `"`s can appear just before or after the delimiter. 151 | // ```toml 152 | // str4 = """Here are two quotation marks: "". Simple enough.""" 153 | // str5 = """Here are three quotation marks: ""\".""" 154 | // str6 = """Here are fifteen quotation marks: ""\"""\"""\"""\"""\".""" 155 | // str7 = """"This," she said, "is just a pointless statement."""" 156 | // ``` 157 | // In the current implementation (v3.3.0), it is difficult to parse `str7` in 158 | // the above example. It is difficult to recognize `"` at the end of string body 159 | // collectly. It will be misunderstood as a `"""` delimiter and an additional, 160 | // invalid `"`. Like this: 161 | // ```console 162 | // what(): [error] toml::parse_table: invalid line format 163 | // --> hoge.toml 164 | // | 165 | // 13 | str7 = """"This," she said, "is just a pointless statement."""" 166 | // | ^- expected newline, but got '"'. 167 | // ``` 168 | // As a quick workaround for this problem, `lex_ml_basic_string_delim` was 169 | // splitted into two, `lex_ml_basic_string_open` and `lex_ml_basic_string_close`. 170 | // `lex_ml_basic_string_open` allows only `"""`. `_close` allows 3-5 `"`s. 171 | // In parse_ml_basic_string() function, the trailing `"`s will be attached to 172 | // the string body. 173 | // 174 | using lex_ml_basic_string_delim = repeat>; 175 | using lex_ml_basic_string_open = lex_ml_basic_string_delim; 176 | using lex_ml_basic_string_close = sequence< 177 | repeat>, 178 | maybe, maybe 179 | >; 180 | 181 | using lex_ml_basic_unescaped = exclude, // 0x09 182 | in_range<0x0a, 0x1F>, // is tab 183 | character<0x5C>, // backslash 184 | character<0x7F>, // DEL 185 | lex_ml_basic_string_delim>>; 186 | 187 | using lex_ml_basic_escaped_newline = sequence< 188 | lex_escape, maybe, lex_newline, 189 | repeat, unlimited>>; 190 | 191 | using lex_ml_basic_char = either; 192 | using lex_ml_basic_body = repeat, 194 | unlimited>; 195 | using lex_ml_basic_string = sequence; 198 | 199 | using lex_literal_char = exclude, 200 | in_range<0x10, 0x19>, character<0x27>>>; 201 | using lex_apostrophe = character<'\''>; 202 | using lex_literal_string = sequence, 204 | lex_apostrophe>; 205 | 206 | // the same reason as above. 207 | using lex_ml_literal_string_delim = repeat>; 208 | using lex_ml_literal_string_open = lex_ml_literal_string_delim; 209 | using lex_ml_literal_string_close = sequence< 210 | repeat>, 211 | maybe, maybe 212 | >; 213 | 214 | using lex_ml_literal_char = exclude, 215 | in_range<0x10, 0x1F>, 216 | character<0x7F>, 217 | lex_ml_literal_string_delim>>; 218 | using lex_ml_literal_body = repeat, 219 | unlimited>; 220 | using lex_ml_literal_string = sequence; 223 | 224 | using lex_string = either; 226 | 227 | // =========================================================================== 228 | 229 | using lex_comment_start_symbol = character<'#'>; 230 | using lex_non_eol = either, exclude>>; 231 | using lex_comment = sequence>; 233 | 234 | using lex_dot_sep = sequence, character<'.'>, maybe>; 235 | 236 | using lex_unquoted_key = repeat, character<'_'>>, 238 | at_least<1>>; 239 | using lex_quoted_key = either; 240 | using lex_simple_key = either; 241 | using lex_dotted_key = sequence, 243 | at_least<1> 244 | > 245 | >; 246 | using lex_key = either; 247 | 248 | using lex_keyval_sep = sequence, 249 | character<'='>, 250 | maybe>; 251 | 252 | using lex_std_table_open = character<'['>; 253 | using lex_std_table_close = character<']'>; 254 | using lex_std_table = sequence, 256 | lex_key, 257 | maybe, 258 | lex_std_table_close>; 259 | 260 | using lex_array_table_open = sequence; 261 | using lex_array_table_close = sequence; 262 | using lex_array_table = sequence, 264 | lex_key, 265 | maybe, 266 | lex_array_table_close>; 267 | 268 | } // detail 269 | } // toml 270 | #endif // TOML_LEXER_HPP 271 | -------------------------------------------------------------------------------- /Dependencies/toml11/toml/region.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Toru Niina 2017. 2 | // Distributed under the MIT License. 3 | #ifndef TOML11_REGION_HPP 4 | #define TOML11_REGION_HPP 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include "color.hpp" 13 | 14 | namespace toml 15 | { 16 | namespace detail 17 | { 18 | 19 | // helper function to avoid std::string(0, 'c') or std::string(iter, iter) 20 | template 21 | std::string make_string(Iterator first, Iterator last) 22 | { 23 | if(first == last) {return "";} 24 | return std::string(first, last); 25 | } 26 | inline std::string make_string(std::size_t len, char c) 27 | { 28 | if(len == 0) {return "";} 29 | return std::string(len, c); 30 | } 31 | 32 | // region_base is a base class of location and region that are defined below. 33 | // it will be used to generate better error messages. 34 | struct region_base 35 | { 36 | region_base() = default; 37 | virtual ~region_base() = default; 38 | region_base(const region_base&) = default; 39 | region_base(region_base&& ) = default; 40 | region_base& operator=(const region_base&) = default; 41 | region_base& operator=(region_base&& ) = default; 42 | 43 | virtual bool is_ok() const noexcept {return false;} 44 | virtual char front() const noexcept {return '\0';} 45 | 46 | virtual std::string str() const {return std::string("unknown region");} 47 | virtual std::string name() const {return std::string("unknown file");} 48 | virtual std::string line() const {return std::string("unknown line");} 49 | virtual std::string line_num() const {return std::string("?");} 50 | 51 | // length of the region 52 | virtual std::size_t size() const noexcept {return 0;} 53 | // number of characters in the line before the region 54 | virtual std::size_t before() const noexcept {return 0;} 55 | // number of characters in the line after the region 56 | virtual std::size_t after() const noexcept {return 0;} 57 | 58 | virtual std::vector comments() const {return {};} 59 | // ```toml 60 | // # comment_before 61 | // key = "value" # comment_inline 62 | // ``` 63 | }; 64 | 65 | // location represents a position in a container, which contains a file content. 66 | // it can be considered as a region that contains only one character. 67 | // 68 | // it contains pointer to the file content and iterator that points the current 69 | // location. 70 | struct location final : public region_base 71 | { 72 | using const_iterator = typename std::vector::const_iterator; 73 | using difference_type = typename const_iterator::difference_type; 74 | using source_ptr = std::shared_ptr>; 75 | 76 | location(std::string name, std::vector cont) 77 | : source_(std::make_shared>(std::move(cont))), 78 | line_number_(1), source_name_(std::move(name)), iter_(source_->cbegin()) 79 | {} 80 | location(std::string name, const std::string& cont) 81 | : source_(std::make_shared>(cont.begin(), cont.end())), 82 | line_number_(1), source_name_(std::move(name)), iter_(source_->cbegin()) 83 | {} 84 | 85 | location(const location&) = default; 86 | location(location&&) = default; 87 | location& operator=(const location&) = default; 88 | location& operator=(location&&) = default; 89 | ~location() = default; 90 | 91 | bool is_ok() const noexcept override {return static_cast(source_);} 92 | char front() const noexcept override {return *iter_;} 93 | 94 | // this const prohibits codes like `++(loc.iter())`. 95 | const const_iterator iter() const noexcept {return iter_;} 96 | 97 | const_iterator begin() const noexcept {return source_->cbegin();} 98 | const_iterator end() const noexcept {return source_->cend();} 99 | 100 | // XXX `location::line_num()` used to be implemented using `std::count` to 101 | // count a number of '\n'. But with a long toml file (typically, 10k lines), 102 | // it becomes intolerably slow because each time it generates error messages, 103 | // it counts '\n' from thousands of characters. To workaround it, I decided 104 | // to introduce `location::line_number_` member variable and synchronize it 105 | // to the location changes the point to look. So an overload of `iter()` 106 | // which returns mutable reference is removed and `advance()`, `retrace()` 107 | // and `reset()` is added. 108 | void advance(difference_type n = 1) noexcept 109 | { 110 | this->line_number_ += static_cast( 111 | std::count(this->iter_, std::next(this->iter_, n), '\n')); 112 | this->iter_ += n; 113 | return; 114 | } 115 | void retrace(difference_type n = 1) noexcept 116 | { 117 | this->line_number_ -= static_cast( 118 | std::count(std::prev(this->iter_, n), this->iter_, '\n')); 119 | this->iter_ -= n; 120 | return; 121 | } 122 | void reset(const_iterator rollback) noexcept 123 | { 124 | // since c++11, std::distance works in both ways for random-access 125 | // iterators and returns a negative value if `first > last`. 126 | if(0 <= std::distance(rollback, this->iter_)) // rollback < iter 127 | { 128 | this->line_number_ -= static_cast( 129 | std::count(rollback, this->iter_, '\n')); 130 | } 131 | else // iter < rollback [[unlikely]] 132 | { 133 | this->line_number_ += static_cast( 134 | std::count(this->iter_, rollback, '\n')); 135 | } 136 | this->iter_ = rollback; 137 | return; 138 | } 139 | 140 | std::string str() const override {return make_string(1, *this->iter());} 141 | std::string name() const override {return source_name_;} 142 | 143 | std::string line_num() const override 144 | { 145 | return std::to_string(this->line_number_); 146 | } 147 | 148 | std::string line() const override 149 | { 150 | return make_string(this->line_begin(), this->line_end()); 151 | } 152 | 153 | const_iterator line_begin() const noexcept 154 | { 155 | using reverse_iterator = std::reverse_iterator; 156 | return std::find(reverse_iterator(this->iter()), 157 | reverse_iterator(this->begin()), '\n').base(); 158 | } 159 | const_iterator line_end() const noexcept 160 | { 161 | return std::find(this->iter(), this->end(), '\n'); 162 | } 163 | 164 | // location is always points a character. so the size is 1. 165 | std::size_t size() const noexcept override 166 | { 167 | return 1u; 168 | } 169 | std::size_t before() const noexcept override 170 | { 171 | const auto sz = std::distance(this->line_begin(), this->iter()); 172 | assert(sz >= 0); 173 | return static_cast(sz); 174 | } 175 | std::size_t after() const noexcept override 176 | { 177 | const auto sz = std::distance(this->iter(), this->line_end()); 178 | assert(sz >= 0); 179 | return static_cast(sz); 180 | } 181 | 182 | source_ptr const& source() const& noexcept {return source_;} 183 | source_ptr&& source() && noexcept {return std::move(source_);} 184 | 185 | private: 186 | 187 | source_ptr source_; 188 | std::size_t line_number_; 189 | std::string source_name_; 190 | const_iterator iter_; 191 | }; 192 | 193 | // region represents a range in a container, which contains a file content. 194 | // 195 | // it contains pointer to the file content and iterator that points the first 196 | // and last location. 197 | struct region final : public region_base 198 | { 199 | using const_iterator = typename std::vector::const_iterator; 200 | using source_ptr = std::shared_ptr>; 201 | 202 | // delete default constructor. source_ never be null. 203 | region() = delete; 204 | 205 | explicit region(const location& loc) 206 | : source_(loc.source()), source_name_(loc.name()), 207 | first_(loc.iter()), last_(loc.iter()) 208 | {} 209 | explicit region(location&& loc) 210 | : source_(loc.source()), source_name_(loc.name()), 211 | first_(loc.iter()), last_(loc.iter()) 212 | {} 213 | 214 | region(const location& loc, const_iterator f, const_iterator l) 215 | : source_(loc.source()), source_name_(loc.name()), first_(f), last_(l) 216 | {} 217 | region(location&& loc, const_iterator f, const_iterator l) 218 | : source_(loc.source()), source_name_(loc.name()), first_(f), last_(l) 219 | {} 220 | 221 | region(const region&) = default; 222 | region(region&&) = default; 223 | region& operator=(const region&) = default; 224 | region& operator=(region&&) = default; 225 | ~region() = default; 226 | 227 | region& operator+=(const region& other) 228 | { 229 | // different regions cannot be concatenated 230 | assert(this->begin() == other.begin() && this->end() == other.end() && 231 | this->last_ == other.first_); 232 | 233 | this->last_ = other.last_; 234 | return *this; 235 | } 236 | 237 | bool is_ok() const noexcept override {return static_cast(source_);} 238 | char front() const noexcept override {return *first_;} 239 | 240 | std::string str() const override {return make_string(first_, last_);} 241 | std::string line() const override 242 | { 243 | if(this->contain_newline()) 244 | { 245 | return make_string(this->line_begin(), 246 | std::find(this->line_begin(), this->last(), '\n')); 247 | } 248 | return make_string(this->line_begin(), this->line_end()); 249 | } 250 | std::string line_num() const override 251 | { 252 | return std::to_string(1 + std::count(this->begin(), this->first(), '\n')); 253 | } 254 | 255 | std::size_t size() const noexcept override 256 | { 257 | const auto sz = std::distance(first_, last_); 258 | assert(sz >= 0); 259 | return static_cast(sz); 260 | } 261 | std::size_t before() const noexcept override 262 | { 263 | const auto sz = std::distance(this->line_begin(), this->first()); 264 | assert(sz >= 0); 265 | return static_cast(sz); 266 | } 267 | std::size_t after() const noexcept override 268 | { 269 | const auto sz = std::distance(this->last(), this->line_end()); 270 | assert(sz >= 0); 271 | return static_cast(sz); 272 | } 273 | 274 | bool contain_newline() const noexcept 275 | { 276 | return std::find(this->first(), this->last(), '\n') != this->last(); 277 | } 278 | 279 | const_iterator line_begin() const noexcept 280 | { 281 | using reverse_iterator = std::reverse_iterator; 282 | return std::find(reverse_iterator(this->first()), 283 | reverse_iterator(this->begin()), '\n').base(); 284 | } 285 | const_iterator line_end() const noexcept 286 | { 287 | return std::find(this->last(), this->end(), '\n'); 288 | } 289 | 290 | const_iterator begin() const noexcept {return source_->cbegin();} 291 | const_iterator end() const noexcept {return source_->cend();} 292 | const_iterator first() const noexcept {return first_;} 293 | const_iterator last() const noexcept {return last_;} 294 | 295 | source_ptr const& source() const& noexcept {return source_;} 296 | source_ptr&& source() && noexcept {return std::move(source_);} 297 | 298 | std::string name() const override {return source_name_;} 299 | 300 | std::vector comments() const override 301 | { 302 | // assuming the current region (`*this`) points a value. 303 | // ```toml 304 | // a = "value" 305 | // ^^^^^^^- this region 306 | // ``` 307 | using rev_iter = std::reverse_iterator; 308 | 309 | std::vector com{}; 310 | { 311 | // find comments just before the current region. 312 | // ```toml 313 | // # this should be collected. 314 | // # this also. 315 | // a = value # not this. 316 | // ``` 317 | 318 | // # this is a comment for `a`, not array elements. 319 | // a = [1, 2, 3, 4, 5] 320 | if(this->first() == std::find_if(this->line_begin(), this->first(), 321 | [](const char c) noexcept -> bool {return c == '[' || c == '{';})) 322 | { 323 | auto iter = this->line_begin(); // points the first character 324 | while(iter != this->begin()) 325 | { 326 | iter = std::prev(iter); 327 | 328 | // range [line_start, iter) represents the previous line 329 | const auto line_start = std::find( 330 | rev_iter(iter), rev_iter(this->begin()), '\n').base(); 331 | const auto comment_found = std::find(line_start, iter, '#'); 332 | if(comment_found == iter) 333 | { 334 | break; // comment not found. 335 | } 336 | 337 | // exclude the following case. 338 | // > a = "foo" # comment // <-- this is not a comment for b but a. 339 | // > b = "current value" 340 | if(std::all_of(line_start, comment_found, 341 | [](const char c) noexcept -> bool { 342 | return c == ' ' || c == '\t'; 343 | })) 344 | { 345 | // unwrap the first '#' by std::next. 346 | auto str = make_string(std::next(comment_found), iter); 347 | if(str.back() == '\r') {str.pop_back();} 348 | com.push_back(std::move(str)); 349 | } 350 | else 351 | { 352 | break; 353 | } 354 | iter = line_start; 355 | } 356 | } 357 | } 358 | 359 | if(com.size() > 1) 360 | { 361 | std::reverse(com.begin(), com.end()); 362 | } 363 | 364 | { 365 | // find comments just after the current region. 366 | // ```toml 367 | // # not this. 368 | // a = value # this one. 369 | // a = [ # not this (technically difficult) 370 | // 371 | // ] # and this. 372 | // ``` 373 | // The reason why it's difficult is that it requires parsing in the 374 | // following case. 375 | // ```toml 376 | // a = [ 10 # this comment is for `10`. not for `a` but `a[0]`. 377 | // # ... 378 | // ] # this is apparently a comment for a. 379 | // 380 | // b = [ 381 | // 3.14 ] # there is no way to add a comment to `3.14` currently. 382 | // 383 | // c = [ 384 | // 3.14 # do this if you need a comment here. 385 | // ] 386 | // ``` 387 | const auto comment_found = 388 | std::find(this->last(), this->line_end(), '#'); 389 | if(comment_found != this->line_end()) // '#' found 390 | { 391 | // table = {key = "value"} # what is this for? 392 | // the above comment is not for "value", but {key="value"}. 393 | if(comment_found == std::find_if(this->last(), comment_found, 394 | [](const char c) noexcept -> bool { 395 | return !(c == ' ' || c == '\t' || c == ','); 396 | })) 397 | { 398 | // unwrap the first '#' by std::next. 399 | auto str = make_string(std::next(comment_found), this->line_end()); 400 | if(str.back() == '\r') {str.pop_back();} 401 | com.push_back(std::move(str)); 402 | } 403 | } 404 | } 405 | return com; 406 | } 407 | 408 | private: 409 | 410 | source_ptr source_; 411 | std::string source_name_; 412 | const_iterator first_, last_; 413 | }; 414 | 415 | } // detail 416 | } // toml 417 | #endif// TOML11_REGION_H 418 | --------------------------------------------------------------------------------