├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE │ └── bug_report.md └── workflows │ └── msbuild.yml ├── dependencies ├── minhook │ ├── buffer.c │ ├── hde │ │ ├── pstdint.h │ │ ├── hde32.h │ │ ├── hde64.h │ │ ├── table32.h │ │ └── table64.h │ ├── buffer.h │ └── trampoline.h ├── freetype │ ├── binary │ │ ├── freetype.lib │ │ └── freetype_debug.lib │ └── include │ │ ├── freetype │ │ ├── internal │ │ │ ├── services │ │ │ │ ├── svtteng.h │ │ │ │ ├── svwinfnt.h │ │ │ │ ├── svkern.h │ │ │ │ ├── svotval.h │ │ │ │ ├── svttglyf.h │ │ │ │ ├── svfntfmt.h │ │ │ │ ├── svpfr.h │ │ │ │ ├── svpostnm.h │ │ │ │ ├── svprop.h │ │ │ │ ├── svbdf.h │ │ │ │ ├── svgxval.h │ │ │ │ ├── svgldict.h │ │ │ │ ├── svcid.h │ │ │ │ ├── svsfnt.h │ │ │ │ ├── svttcmap.h │ │ │ │ ├── svpsinfo.h │ │ │ │ ├── svcfftl.h │ │ │ │ └── svmetric.h │ │ │ ├── ftpsprop.h │ │ │ ├── cffotypes.h │ │ │ ├── internal.h │ │ │ └── fthash.h │ │ ├── config │ │ │ └── ftmodule.h │ │ ├── ftfntfmt.h │ │ ├── ftbbox.h │ │ ├── ftlzw.h │ │ ├── ftbzip2.h │ │ ├── ftchapters.h │ │ └── ftsynth.h │ │ └── ft2build.h └── imgui │ ├── imgui_impl_dx11.h │ ├── imgui_impl_win32.h │ └── imgui_freetype.h ├── cstrike ├── painter.cpp ├── painter.h ├── sdk │ ├── interfaces │ │ ├── ipvs.h │ │ ├── igameresourceservice.h │ │ ├── iswapchaindx11.h │ │ ├── idebugoverlay.h │ │ ├── iglobalvars.h │ │ ├── iresourcesystem.h │ │ ├── iviewrender.h │ │ ├── iinputsystem.h │ │ ├── imemalloc.h │ │ ├── inetworkclientservice.h │ │ ├── cgameentitysystem.h │ │ ├── iengineclient.h │ │ ├── cgametracemanager.cpp │ │ ├── ccsgoinput.h │ │ ├── cgametracemanager.h │ │ └── imaterialsystem.h │ ├── datatypes │ │ ├── transform.h │ │ ├── stronghandle.h │ │ ├── viewsetup.h │ │ ├── utlbuffer.h │ │ ├── keyvalue3.h │ │ ├── matrix.cpp │ │ ├── keyvalues3.cpp │ │ ├── vector.cpp │ │ ├── utlstring.h │ │ ├── qangle.cpp │ │ ├── quaternion.h │ │ └── utlmap.h │ ├── entity_handle.h │ └── vdata.h ├── features │ ├── legitbot │ │ ├── legitbot.h │ │ └── aim.h │ ├── misc.h │ ├── legitbot.h │ ├── legitbot.cpp │ ├── misc.cpp │ ├── visuals.h │ ├── misc │ │ └── movement.h │ ├── visuals.cpp │ ├── CRC.h │ └── visuals │ │ └── chams.h ├── core.h ├── core │ ├── sdk.cpp │ ├── convars.h │ ├── sdk.h │ ├── schema.h │ ├── interfaces.h │ ├── hooks.h │ ├── menu.h │ └── variables.h ├── features.h ├── aimRangePainter.hpp ├── utilities │ ├── math.cpp │ ├── fnv1a.h │ ├── inputsystem.h │ ├── notify.h │ ├── math.h │ ├── inputsystem.cpp │ ├── notify.cpp │ └── detourhook.h └── features.cpp ├── resources └── README.md ├── asphyxia.sln ├── LICENSE ├── readme.md ├── .gitattributes ├── .editorconfig └── premake5.lua /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | ko_fi: maecry22 2 | -------------------------------------------------------------------------------- /dependencies/minhook/buffer.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pain1929/cs2-silent-aim/HEAD/dependencies/minhook/buffer.c -------------------------------------------------------------------------------- /dependencies/freetype/binary/freetype.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pain1929/cs2-silent-aim/HEAD/dependencies/freetype/binary/freetype.lib -------------------------------------------------------------------------------- /dependencies/freetype/binary/freetype_debug.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pain1929/cs2-silent-aim/HEAD/dependencies/freetype/binary/freetype_debug.lib -------------------------------------------------------------------------------- /cstrike/painter.cpp: -------------------------------------------------------------------------------- 1 | #include "painter.h" 2 | #include "core/sdk.h" 3 | #include "sdk/interfaces/iengineclient.h" 4 | Painter::Painter() 5 | { 6 | } 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /resources/README.md: -------------------------------------------------------------------------------- 1 | # game_icons.h 2 | * game's weapon, c4... icons 3 | 4 | # smallest_pixel.h 5 | * smallest pixel font 6 | 7 | # font_awesome_5.h && fa_solid_900.h 8 | * font awesome 5 -------------------------------------------------------------------------------- /cstrike/painter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "utilities/draw.h" 3 | class Painter 4 | { 5 | 6 | public: 7 | Painter(); 8 | virtual void Draw(ImDrawList* pDrawList) = 0; 9 | virtual ~Painter() = default; 10 | }; 11 | -------------------------------------------------------------------------------- /cstrike/sdk/interfaces/ipvs.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // used: MEM::CallVFunc 4 | #include "../../utilities/memory.h" 5 | 6 | class CPVS 7 | { 8 | public: 9 | void Set(bool bState) 10 | { 11 | MEM::CallVFunc(this, bState); 12 | } 13 | }; 14 | -------------------------------------------------------------------------------- /cstrike/sdk/interfaces/igameresourceservice.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // used: mem_pad 4 | #include "../../utilities/memory.h" 5 | 6 | class CGameEntitySystem; 7 | 8 | class IGameResourceService 9 | { 10 | public: 11 | MEM_PAD(0x58); 12 | CGameEntitySystem* pGameEntitySystem; 13 | }; -------------------------------------------------------------------------------- /cstrike/sdk/interfaces/iswapchaindx11.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // used: call virtual function 4 | #include "../../utilities/memory.h" 5 | 6 | // forward declarations 7 | struct IDXGISwapChain; 8 | 9 | class ISwapChainDx11 10 | { 11 | MEM_PAD(0x170); 12 | IDXGISwapChain* pDXGISwapChain; 13 | }; 14 | -------------------------------------------------------------------------------- /cstrike/features/legitbot/legitbot.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | class CUserCmd; 3 | class CBaseUserCmdPB; 4 | class CCSPlayerController; 5 | class C_CSPlayerPawn; 6 | 7 | namespace F::LEGITBOT 8 | { 9 | void OnMove(CBaseUserCmdPB* pBaseCmd, CCSPlayerController* pLocalController, C_CSPlayerPawn* pLocalPawn); 10 | } 11 | -------------------------------------------------------------------------------- /cstrike/features/misc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | class CUserCmd; 3 | class CBaseUserCmdPB; 4 | class CCSPlayerController; 5 | class C_CSPlayerPawn; 6 | 7 | namespace F::MISC 8 | { 9 | void OnMove(CUserCmd* pCmd, CBaseUserCmdPB* pBaseCmd, CCSPlayerController* pLocalController, C_CSPlayerPawn* pLocalPawn); 10 | } 11 | -------------------------------------------------------------------------------- /cstrike/features/legitbot.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | class CUserCmd; 3 | class CBaseUserCmdPB; 4 | class CCSPlayerController; 5 | class C_CSPlayerPawn; 6 | 7 | namespace F::LEGITBOT 8 | { 9 | void OnMove(CUserCmd* pCmd, CBaseUserCmdPB* pBaseCmd, CCSPlayerController* pLocalController, C_CSPlayerPawn* pLocalPawn); 10 | } 11 | -------------------------------------------------------------------------------- /cstrike/sdk/datatypes/transform.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // used: matResult 4 | #include "matrix.h" 5 | // used: quaternion 6 | #include "quaternion.h" 7 | 8 | class CTransform 9 | { 10 | public: 11 | VectorAligned_t vecPosition; 12 | QuaternionAligned_t quatOrientation; 13 | }; 14 | 15 | static_assert(alignof(CTransform) == 16); 16 | -------------------------------------------------------------------------------- /cstrike/features/legitbot.cpp: -------------------------------------------------------------------------------- 1 | #include "legitbot.h" 2 | 3 | // used: movement callback 4 | #include "legitbot/aim.h" 5 | 6 | void F::LEGITBOT::OnMove(CUserCmd* pCmd, CBaseUserCmdPB* pBaseCmd, CCSPlayerController* pLocalController, C_CSPlayerPawn* pLocalPawn) 7 | { 8 | AIM::OnMove(pCmd, pBaseCmd, pLocalController, pLocalPawn); 9 | } 10 | -------------------------------------------------------------------------------- /cstrike/features/misc.cpp: -------------------------------------------------------------------------------- 1 | #include "misc.h" 2 | 3 | // used: movement callback 4 | #include "misc/movement.h" 5 | 6 | void F::MISC::OnMove(CUserCmd* pCmd, CBaseUserCmdPB* pBaseCmd, CCSPlayerController* pLocalController, C_CSPlayerPawn* pLocalPawn) 7 | { 8 | // process movement 9 | MOVEMENT::OnMove(pCmd, pBaseCmd, pLocalController, pLocalPawn); 10 | } 11 | -------------------------------------------------------------------------------- /cstrike/sdk/interfaces/idebugoverlay.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // used: find pattern, call virtual function 4 | #include "../../utilities/memory.h" 5 | 6 | // used: vertor_t 7 | #include "../datatypes/vector.h" 8 | // used: color_t 9 | #include "../datatypes/color.h" 10 | 11 | class IDebugOverlayGameSystem 12 | { 13 | public: 14 | // @todo: reverse this 15 | }; -------------------------------------------------------------------------------- /cstrike/features/visuals.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CMeshData; 4 | 5 | namespace F::VISUALS 6 | { 7 | bool Setup(); 8 | void OnDestroy(); 9 | 10 | void OnFrame(const int nStage); 11 | bool OnDrawObject(void* pAnimatableSceneObjectDesc, void* pDx11, CMeshData* arrMeshDraw, int nDataCount, void* pSceneView, void* pSceneLayer, void* pUnk, void* pUnk2); 12 | } 13 | -------------------------------------------------------------------------------- /cstrike/core.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace CORE 4 | { 5 | /* @section: get */ 6 | /// @param[out] wszDestination output for working path where files will be saved (default: "%userprofile%\documents\.crown") 7 | /// @returns: true if successfully got the path, false otherwise 8 | bool GetWorkingPath(wchar_t* wszDestination); 9 | 10 | /* @section: values */ 11 | // handle of self module 12 | inline void* hDll = nullptr; 13 | // current process handle 14 | inline void* hProcess = nullptr; 15 | } -------------------------------------------------------------------------------- /cstrike/features/legitbot/aim.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CUserCmd; 4 | class CBaseUserCmdPB; 5 | class CCSGOInputHistoryEntryPB; 6 | 7 | class CCSPlayerController; 8 | class C_CSPlayerPawn; 9 | 10 | struct QAngle_t; 11 | 12 | namespace F::LEGITBOT::AIM 13 | { 14 | void OnMove(CUserCmd* pCmd, CBaseUserCmdPB* pBaseCmd, CCSPlayerController* pLocalController, C_CSPlayerPawn* pLocalPawn); 15 | 16 | void AimAssist(CBaseUserCmdPB* pUserCmd, C_CSPlayerPawn* pLocalPawn, CCSPlayerController* pLocalController); 17 | } 18 | -------------------------------------------------------------------------------- /cstrike/core/sdk.cpp: -------------------------------------------------------------------------------- 1 | #include "sdk.h" 2 | 3 | // used: getmodulebasehandle 4 | #include "../utilities/memory.h" 5 | 6 | bool SDK::Setup() 7 | { 8 | bool bSuccess = true; 9 | 10 | const void* hTier0Lib = MEM::GetModuleBaseHandle(TIER0_DLL); 11 | if (hTier0Lib == nullptr) 12 | return false; 13 | 14 | fnConColorMsg = reinterpret_cast(MEM::GetExportAddress(hTier0Lib, CS_XOR("?ConColorMsg@@YAXAEBVColor@@PEBDZZ"))); 15 | bSuccess &= fnConColorMsg != nullptr; 16 | 17 | return bSuccess; 18 | } 19 | -------------------------------------------------------------------------------- /cstrike/sdk/interfaces/iglobalvars.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // used: mem_pad 4 | #include "../../utilities/memory.h" 5 | 6 | class IGlobalVars 7 | { 8 | public: 9 | float flRealTime; //0x0000 10 | int32_t nFrameCount; //0x0004 11 | float flFrameTime; //0x0008 12 | float flFrameTime2; //0x000C 13 | int32_t nMaxClients; //0x0010 14 | MEM_PAD(0x1C); 15 | float flFrameTime3; //0x0030 16 | float flCurrentTime; //0x0034 17 | float flCurrentTime2; //0x0038 18 | MEM_PAD(0xC); 19 | int32_t nTickCount; //0x0048 20 | }; 21 | -------------------------------------------------------------------------------- /cstrike/sdk/interfaces/iresourcesystem.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // used: callvfunc 4 | #include "../../utilities/memory.h" 5 | 6 | struct ResourceBinding_t; 7 | 8 | class IResourceSystem 9 | { 10 | public: 11 | void* QueryInterface(const char* szInterfaceName) 12 | { 13 | return MEM::CallVFunc(this, szInterfaceName); 14 | } 15 | }; 16 | 17 | class CResourceHandleUtils 18 | { 19 | public: 20 | void DeleteResource(const ResourceBinding_t* pBinding) 21 | { 22 | MEM::CallVFunc(this, pBinding); 23 | } 24 | }; 25 | -------------------------------------------------------------------------------- /cstrike/sdk/interfaces/iviewrender.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../datatypes/qangle.h" 4 | #include "../datatypes/matrix.h" 5 | 6 | class IViewRender 7 | { 8 | public: 9 | Vector_t vecOrigin; // 0x0000 10 | QAngle_t vecAngles; // 0x000C 11 | float flFov; // 0x0018 12 | char pad_0x001C[0x14]; // 0x001C 13 | ViewMatrix_t matUNK1; // 0x0030 14 | char pad_0x0070[0x30]; // 0x0070 15 | ViewMatrix_t matUNK2; // 0x00A0 16 | char pad_0x00E0[0xC8]; // 0x00E0 17 | ViewMatrix_t matUNK3; // 0x01A8 18 | char pad_0x01E8[0x28]; // 0x01E8 19 | }; -------------------------------------------------------------------------------- /cstrike/core/convars.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CConVar; 4 | 5 | namespace CONVAR 6 | { 7 | // dump convars to file 8 | bool Dump(const wchar_t* wszFileName); 9 | // setup convars 10 | bool Setup(); 11 | 12 | inline CConVar* m_pitch = nullptr; 13 | inline CConVar* m_yaw = nullptr; 14 | inline CConVar* sensitivity = nullptr; 15 | 16 | inline CConVar* game_type = nullptr; 17 | inline CConVar* game_mode = nullptr; 18 | 19 | inline CConVar* mp_teammates_are_enemies = nullptr; 20 | 21 | inline CConVar* sv_autobunnyhopping = nullptr; 22 | } 23 | -------------------------------------------------------------------------------- /cstrike/sdk/datatypes/stronghandle.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct ResourceBinding_t 4 | { 5 | void* pData; 6 | }; 7 | 8 | template 9 | class CStrongHandle 10 | { 11 | public: 12 | operator T* () const 13 | { 14 | if (pBinding == nullptr) 15 | return nullptr; 16 | 17 | return static_cast(pBinding->pData); 18 | } 19 | 20 | T* operator->() const 21 | { 22 | if (pBinding == nullptr) 23 | return nullptr; 24 | 25 | return static_cast(pBinding->pData); 26 | } 27 | 28 | const ResourceBinding_t* pBinding; 29 | }; 30 | 31 | -------------------------------------------------------------------------------- /cstrike/features.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "common.h" 4 | 5 | class CUserCmd; 6 | class CBaseUserCmdPB; 7 | class CCSPlayerController; 8 | class CMeshData; 9 | 10 | namespace F 11 | { 12 | bool Setup(); 13 | void Destroy(); 14 | 15 | void OnPresent(); 16 | void OnFrameStageNotify(int nStage); 17 | void OnCreateMove(CUserCmd* pCmd, CBaseUserCmdPB* pBaseCmd, CCSPlayerController* pLocalController); 18 | bool OnDrawObject(void* pAnimatableSceneObjectDesc, void* pDx11, CMeshData* arrMeshDraw, int nDataCount, void* pSceneView, void* pSceneLayer, void* pUnk, void* pUnk2); 19 | } 20 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: maecry 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 16 | **Expected behavior** 17 | A clear and concise description of what you expected to happen. 18 | 19 | **Screenshots** 20 | If applicable, add screenshots to help explain your problem. 21 | 22 | **Additional context** 23 | Add any other context about the problem here. 24 | -------------------------------------------------------------------------------- /cstrike/sdk/interfaces/iinputsystem.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // used: getexportaddress 4 | #include "../../utilities/memory.h" 5 | 6 | class IInputSystem 7 | { 8 | public: 9 | bool IsRelativeMouseMode() 10 | { 11 | // @ida: 'IInputSystem::SetRelativeMouseMode'. 12 | return *reinterpret_cast(reinterpret_cast(this) + 0x4D); 13 | } 14 | 15 | void* GetSDLWindow() 16 | { 17 | // @ida: IInputSystem::DebugSpew -> #STR: "Current coordinate bias %s: %g,%g scale %g,%g\n" 18 | return *reinterpret_cast(reinterpret_cast(this) + 0x26A8); 19 | } 20 | }; 21 | -------------------------------------------------------------------------------- /cstrike/aimRangePainter.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "painter.h" 3 | #include "core/variables.h" 4 | #include "core/interfaces.h" 5 | #include "sdk/interfaces/iswapchaindx11.h" 6 | class AimRangePainter : public Painter 7 | { 8 | public: 9 | virtual void Draw(ImDrawList* pDrawList) override 10 | { 11 | if (C_GET(bool, Vars.bLegitbot)) 12 | { 13 | DXGI_SWAP_CHAIN_DESC sd; 14 | I::SwapChain->pDXGISwapChain->GetDesc(&sd); 15 | pDrawList->AddCircle({ sd.BufferDesc.Width / 2.f, sd.BufferDesc.Height / 2.f }, C_GET(float , Vars.aim_range), IM_COL32(255, 0, 0, 255), 0.3); 16 | } 17 | 18 | 19 | } 20 | 21 | 22 | }; 23 | -------------------------------------------------------------------------------- /cstrike/sdk/datatypes/viewsetup.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // used: mem_pad 4 | #include "../../utilities/memory.h" 5 | 6 | // used: vector_t 7 | #include "vector.h" 8 | // used: qangle_t 9 | #include "qangle.h" 10 | 11 | class CViewSetup 12 | { 13 | public: 14 | MEM_PAD(0x490); 15 | float flOrthoLeft; // 0x0494 16 | float flOrthoTop; // 0x0498 17 | float flOrthoRight; // 0x049C 18 | float flOrthoBottom; // 0x04A0 19 | MEM_PAD(0x38); 20 | float flFov; // 0x04D8 21 | float flFovViewmodel; // 0x04DC 22 | Vector_t vecOrigin; // 0x04E0 23 | MEM_PAD(0xC); // 0x04EC 24 | QAngle_t angView; // 0x04F8 25 | MEM_PAD(0x14); // 0x0504 26 | float flAspectRatio; // 0x0518 27 | }; -------------------------------------------------------------------------------- /.github/workflows/msbuild.yml: -------------------------------------------------------------------------------- 1 | name: msbuild 2 | 3 | on: 4 | push: 5 | branches: [ "master" ] 6 | pull_request: 7 | branches: [ "master" ] 8 | permissions: 9 | contents: read 10 | jobs: 11 | build: 12 | runs-on: windows-2022 13 | strategy: 14 | matrix: 15 | toolset: [v143, ClangCL] 16 | configuration: [Debug, Release] 17 | steps: 18 | - name: setup actions 19 | uses: actions/checkout@v3 20 | - name: setup environment 21 | uses: microsoft/setup-msbuild@v1.1 22 | - name: build 23 | shell: cmd 24 | run: msbuild asphyxia.sln /p:Configuration=${{matrix.configuration}} /p:Platform=x64 /p:PlatformToolset=${{ matrix.toolset }} 25 | -------------------------------------------------------------------------------- /cstrike/sdk/interfaces/imemalloc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | // used: mem::CallVFunc 3 | #include "../../utilities/memory.h" 4 | #pragma warning(push) 5 | #pragma warning(disable : 4191) 6 | 7 | class IMemAlloc 8 | { 9 | public: 10 | void* Alloc(std::size_t nSize) 11 | { 12 | return MEM::CallVFunc(this, nSize); 13 | } 14 | 15 | void* ReAlloc(const void* pMemory, std::size_t nSize) 16 | { 17 | return MEM::CallVFunc(this, pMemory, nSize); 18 | } 19 | 20 | void Free(const void* pMemory) 21 | { 22 | return MEM::CallVFunc(this, pMemory); 23 | } 24 | 25 | std::size_t GetSize(const void* pMemory) 26 | { 27 | return MEM::CallVFunc(this, pMemory); 28 | } 29 | }; 30 | 31 | #pragma warning(pop) -------------------------------------------------------------------------------- /cstrike/sdk/datatypes/utlbuffer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | // used: MEM_PAD 3 | #include "../../utilities/memory.h" 4 | 5 | class CUtlBuffer 6 | { 7 | public: 8 | MEM_PAD(0x80); 9 | 10 | CUtlBuffer(int a1, int nSize, int a3) 11 | { 12 | #ifdef CS_PARANOID 13 | CS_ASSERT(MEM::fnUtlBufferInit != nullptr); 14 | #endif 15 | 16 | MEM::fnUtlBufferInit(this, a1, nSize, a3); 17 | } 18 | 19 | void PutString(const char* szString) 20 | { 21 | #ifdef CS_PARANOID 22 | CS_ASSERT(MEM::fnUtlBufferPutString != nullptr); 23 | #endif 24 | 25 | MEM::fnUtlBufferPutString(this, szString); 26 | } 27 | 28 | void EnsureCapacity(int nSize) 29 | { 30 | #ifdef CS_PARANOID 31 | CS_ASSERT(MEM::fnUtlBufferEnsureCapacity != nullptr); 32 | #endif 33 | 34 | MEM::fnUtlBufferEnsureCapacity(this, nSize); 35 | } 36 | }; 37 | -------------------------------------------------------------------------------- /cstrike/sdk/interfaces/inetworkclientservice.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../../utilities/memory.h" 3 | 4 | class CNetworkGameClient 5 | { 6 | public: 7 | bool IsConnected() 8 | { 9 | return MEM::CallVFunc(this); 10 | } 11 | 12 | // force game to clear cache and reset delta tick 13 | void FullUpdate() 14 | { 15 | // @ida: #STR: "Requesting full game update (%s)...\n" 16 | MEM::CallVFunc(this, CS_XOR("unk")); 17 | } 18 | 19 | int GetDeltaTick() 20 | { 21 | // @ida: offset in FullUpdate(); 22 | // (nDeltaTick = -1) == FullUpdate() called 23 | return *reinterpret_cast(reinterpret_cast(this) + 0x25C); 24 | } 25 | }; 26 | 27 | class INetworkClientService 28 | { 29 | public: 30 | [[nodiscard]] CNetworkGameClient* GetNetworkGameClient() 31 | { 32 | return MEM::CallVFunc(this); 33 | } 34 | }; 35 | -------------------------------------------------------------------------------- /cstrike/features/misc/movement.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CUserCmd; 4 | class CBaseUserCmdPB; 5 | class CCSGOInputHistoryEntryPB; 6 | 7 | class CCSPlayerController; 8 | class C_CSPlayerPawn; 9 | 10 | struct QAngle_t; 11 | 12 | namespace F::MISC::MOVEMENT 13 | { 14 | void OnMove(CUserCmd* pCmd, CBaseUserCmdPB* pBaseCmd, CCSPlayerController* pLocalController, C_CSPlayerPawn* pLocalPawn); 15 | 16 | void BunnyHop(CUserCmd* pCmd, CBaseUserCmdPB* pUserCmd, C_CSPlayerPawn* pLocalPawn); 17 | void AutoStrafe(CBaseUserCmdPB* pUserCmd, C_CSPlayerPawn* pLocalPawn); 18 | void MovementCorrection(CBaseUserCmdPB* pUserCmd, CCSGOInputHistoryEntryPB* pInputHistory, const QAngle_t& angDesiredViewPoint); 19 | 20 | // will call MovementCorrection && validate user's angView to avoid untrusted ban 21 | void ValidateUserCommand(CUserCmd* pCmd, CBaseUserCmdPB* pUserCmd, CCSGOInputHistoryEntryPB* pInputHistory); 22 | } 23 | -------------------------------------------------------------------------------- /asphyxia.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cstrike", "cstrike\cstrike.vcxproj", "{DAC639DD-46A6-B878-4FBE-434FBB1C1FDA}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|x64 = Debug|x64 9 | Release|x64 = Release|x64 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {DAC639DD-46A6-B878-4FBE-434FBB1C1FDA}.Debug|x64.ActiveCfg = Debug|x64 13 | {DAC639DD-46A6-B878-4FBE-434FBB1C1FDA}.Debug|x64.Build.0 = Debug|x64 14 | {DAC639DD-46A6-B878-4FBE-434FBB1C1FDA}.Release|x64.ActiveCfg = Release|x64 15 | {DAC639DD-46A6-B878-4FBE-434FBB1C1FDA}.Release|x64.Build.0 = Release|x64 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /cstrike/sdk/datatypes/keyvalue3.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | // used: MEM_PAD, FindPattern 3 | #include "../../utilities/memory.h" 4 | 5 | struct KV3ID_t 6 | { 7 | const char* szName; 8 | std::uint64_t unk0; 9 | std::uint64_t unk1; 10 | }; 11 | 12 | class CKeyValues3 13 | { 14 | public: 15 | MEM_PAD(0x100); 16 | std::uint64_t uKey; 17 | void* pValue; 18 | MEM_PAD(0x8); 19 | 20 | void LoadFromBuffer(const char* szString); 21 | bool LoadKV3(CUtlBuffer* buffer); 22 | 23 | static CKeyValues3* CreateMaterialResource() 24 | { 25 | using fnSetTypeKV3 = CKeyValues3*(CS_FASTCALL*)(CKeyValues3*, unsigned int, unsigned int); 26 | static const fnSetTypeKV3 oSetTypeKV3 = reinterpret_cast(MEM::FindPattern(CLIENT_DLL, CS_XOR("40 53 48 83 EC 20 48 8B 01 48 8B D9 44"))); 27 | 28 | #ifdef CS_PARANOID 29 | CS_ASSERT(oSetTypeKV3 != nullptr); 30 | #endif 31 | 32 | CKeyValues3* pKeyValue = new CKeyValues3[0x10]; 33 | return oSetTypeKV3(pKeyValue, 1U, 6U); 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /cstrike/sdk/datatypes/matrix.cpp: -------------------------------------------------------------------------------- 1 | #include "matrix.h" 2 | 3 | #include "qangle.h" 4 | 5 | // used: m_rad2deg 6 | #include "../../utilities/math.h" 7 | 8 | [[nodiscard]] QAngle_t Matrix3x4_t::ToAngles() const 9 | { 10 | // extract the basis vectors from the matrix. since we only need the z component of the up vector, we don't get x and y 11 | const Vector_t vecForward = this->GetForward(); 12 | const Vector_t vecLeft = this->GetLeft(); 13 | const float flUpZ = this->arrData[2][2]; 14 | 15 | const float flLength2D = vecForward.Length2D(); 16 | const float flPitch = M_RAD2DEG(std::atan2f(-vecForward.z, flLength2D)); 17 | 18 | // check is enough here to get angles 19 | if (flLength2D > 0.001f) 20 | return { flPitch, M_RAD2DEG(std::atan2f(vecForward.y, vecForward.x)), M_RAD2DEG(std::atan2f(vecLeft.z, flUpZ)) }; 21 | 22 | // forward is mostly Z, gimbal lock 23 | // assume no roll in this case as one degree of freedom has been lost (i.e. yaw equals roll) 24 | return { flPitch, M_RAD2DEG(std::atan2f(-vecLeft.x, vecLeft.y)), 0.0f }; 25 | } -------------------------------------------------------------------------------- /cstrike/sdk/datatypes/keyvalues3.cpp: -------------------------------------------------------------------------------- 1 | #include "keyvalue3.h" 2 | // used: CRT 3 | #include "../../utilities/crt.h" 4 | // used: utlbuffer 5 | #include "utlbuffer.h" 6 | 7 | void CKeyValues3::LoadFromBuffer(const char* szString) 8 | { 9 | CUtlBuffer buffer(0, (CRT::StringLength(szString) + 10), 1); 10 | buffer.PutString(szString); 11 | LoadKV3(&buffer); 12 | } 13 | 14 | bool CKeyValues3::LoadKV3(CUtlBuffer* buffer) 15 | { 16 | using fnLoadKeyValues = bool(CS_FASTCALL*)(CKeyValues3*, void*, CUtlBuffer*, KV3ID_t*, void*, void*, void*, void*, const char*); 17 | static const fnLoadKeyValues oLoadKeyValues = reinterpret_cast(MEM::GetAbsoluteAddress(MEM::FindPattern(TIER0_DLL, CS_XOR("E8 ? ? ? ? EB 36 8B 43 10")), 0x1, 0x0)); 18 | 19 | #ifdef CS_PARANOID 20 | CS_ASSERT(oLoadKeyValues != nullptr); 21 | #endif 22 | 23 | const char* szName = CS_XOR(""); 24 | KV3ID_t kv3ID = KV3ID_t(CS_XOR("generic"), 0x41B818518343427E, 0xB5F447C23C0CDF8C); 25 | return oLoadKeyValues(this, nullptr, buffer, &kv3ID, nullptr, nullptr, nullptr, nullptr, CS_XOR("")); 26 | } 27 | -------------------------------------------------------------------------------- /cstrike/core/sdk.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // used: viewmatrix_t 4 | #include "../sdk/datatypes/matrix.h" 5 | // used: color_t 6 | #include "../sdk/datatypes/color.h" 7 | // used: cmd 8 | #include "../sdk/datatypes/usercmd.h" 9 | 10 | #pragma region sdk_definitions 11 | // @source: master/public/worldsize.h 12 | // world coordinate bounds 13 | #define MAX_COORD_FLOAT 16'384.f 14 | #define MIN_COORD_FLOAT (-MAX_COORD_FLOAT) 15 | 16 | // @source: master/public/vphysics_interface.h 17 | // coordinates are in HL units. 1 unit == 1 inch 18 | #define METERS_PER_INCH 0.0254f 19 | #pragma endregion 20 | 21 | class CCSPlayerController; 22 | class C_CSPlayerPawn; 23 | 24 | namespace SDK 25 | { 26 | // capture game's exported functions 27 | bool Setup(); 28 | 29 | inline ViewMatrix_t ViewMatrix = ViewMatrix_t(); 30 | inline Vector_t CameraPosition = Vector_t(); 31 | inline CCSPlayerController* LocalController = nullptr; 32 | inline C_CSPlayerPawn* LocalPawn = nullptr; 33 | inline CUserCmd* Cmd = nullptr; 34 | 35 | inline void(CS_CDECL* fnConColorMsg)(const Color_t&, const char*, ...) = nullptr; 36 | } 37 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 maecry 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 | -------------------------------------------------------------------------------- /cstrike/utilities/math.cpp: -------------------------------------------------------------------------------- 1 | #include "math.h" 2 | 3 | //used: getexportaddr 4 | #include "memory.h" 5 | 6 | bool MATH::Setup() 7 | { 8 | bool bSuccess = true; 9 | 10 | const void* hTier0Lib = MEM::GetModuleBaseHandle(TIER0_DLL); 11 | if (hTier0Lib == nullptr) 12 | return false; 13 | 14 | fnRandomSeed = reinterpret_cast(MEM::GetExportAddress(hTier0Lib, CS_XOR("RandomSeed"))); 15 | bSuccess &= (fnRandomSeed != nullptr); 16 | 17 | fnRandomFloat = reinterpret_cast(MEM::GetExportAddress(hTier0Lib, CS_XOR("RandomFloat"))); 18 | bSuccess &= (fnRandomFloat != nullptr); 19 | 20 | fnRandomFloatExp = reinterpret_cast(MEM::GetExportAddress(hTier0Lib, CS_XOR("RandomFloatExp"))); 21 | bSuccess &= (fnRandomFloatExp != nullptr); 22 | 23 | fnRandomInt = reinterpret_cast(MEM::GetExportAddress(hTier0Lib, CS_XOR("RandomInt"))); 24 | bSuccess &= (fnRandomInt != nullptr); 25 | 26 | fnRandomGaussianFloat = reinterpret_cast(MEM::GetExportAddress(hTier0Lib, CS_XOR("RandomGaussianFloat"))); 27 | bSuccess &= (fnRandomGaussianFloat != nullptr); 28 | 29 | return bSuccess; 30 | } 31 | -------------------------------------------------------------------------------- /dependencies/freetype/include/freetype/internal/services/svtteng.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * svtteng.h 4 | * 5 | * The FreeType TrueType engine query service (specification). 6 | * 7 | * Copyright (C) 2006-2019 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef SVTTENG_H_ 20 | #define SVTTENG_H_ 21 | 22 | #include FT_INTERNAL_SERVICE_H 23 | #include FT_MODULE_H 24 | 25 | 26 | FT_BEGIN_HEADER 27 | 28 | 29 | /* 30 | * SFNT table loading service. 31 | */ 32 | 33 | #define FT_SERVICE_ID_TRUETYPE_ENGINE "truetype-engine" 34 | 35 | /* 36 | * Used to implement FT_Get_TrueType_Engine_Type 37 | */ 38 | 39 | FT_DEFINE_SERVICE( TrueTypeEngine ) 40 | { 41 | FT_TrueTypeEngineType engine_type; 42 | }; 43 | 44 | /* */ 45 | 46 | 47 | FT_END_HEADER 48 | 49 | 50 | #endif /* SVTTENG_H_ */ 51 | 52 | 53 | /* END */ 54 | -------------------------------------------------------------------------------- /dependencies/freetype/include/freetype/internal/services/svwinfnt.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * svwinfnt.h 4 | * 5 | * The FreeType Windows FNT/FONT service (specification). 6 | * 7 | * Copyright (C) 2003-2019 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef SVWINFNT_H_ 20 | #define SVWINFNT_H_ 21 | 22 | #include FT_INTERNAL_SERVICE_H 23 | #include FT_WINFONTS_H 24 | 25 | 26 | FT_BEGIN_HEADER 27 | 28 | 29 | #define FT_SERVICE_ID_WINFNT "winfonts" 30 | 31 | typedef FT_Error 32 | (*FT_WinFnt_GetHeaderFunc)( FT_Face face, 33 | FT_WinFNT_HeaderRec *aheader ); 34 | 35 | 36 | FT_DEFINE_SERVICE( WinFnt ) 37 | { 38 | FT_WinFnt_GetHeaderFunc get_header; 39 | }; 40 | 41 | /* */ 42 | 43 | 44 | FT_END_HEADER 45 | 46 | 47 | #endif /* SVWINFNT_H_ */ 48 | 49 | 50 | /* END */ 51 | -------------------------------------------------------------------------------- /dependencies/freetype/include/ft2build.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * ft2build.h 4 | * 5 | * FreeType 2 build and setup macros. 6 | * 7 | * Copyright (C) 1996-2019 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | /************************************************************************** 20 | * 21 | * This is the 'entry point' for FreeType header file inclusions. It is 22 | * the only header file which should be included directly; all other 23 | * FreeType header files should be accessed with macro names (after 24 | * including `ft2build.h`). 25 | * 26 | * A typical example is 27 | * 28 | * ``` 29 | * #include 30 | * #include FT_FREETYPE_H 31 | * ``` 32 | * 33 | */ 34 | 35 | 36 | #ifndef FT2BUILD_H_ 37 | #define FT2BUILD_H_ 38 | 39 | #include 40 | 41 | #endif /* FT2BUILD_H_ */ 42 | 43 | 44 | /* END */ 45 | -------------------------------------------------------------------------------- /cstrike/sdk/datatypes/vector.cpp: -------------------------------------------------------------------------------- 1 | #include "vector.h" 2 | 3 | #include "matrix.h" 4 | #include "qangle.h" 5 | 6 | // used: m_rad2deg 7 | #include "../../utilities/math.h" 8 | 9 | [[nodiscard]] Vector_t Vector_t::Transform(const Matrix3x4_t& matTransform) const 10 | { 11 | return { 12 | this->DotProduct(matTransform[0]) + matTransform[0][3], 13 | this->DotProduct(matTransform[1]) + matTransform[1][3], 14 | this->DotProduct(matTransform[2]) + matTransform[2][3] 15 | }; 16 | } 17 | 18 | [[nodiscard]] QAngle_t Vector_t::ToAngles() const 19 | { 20 | float flPitch, flYaw; 21 | if (this->x == 0.0f && this->y == 0.0f) 22 | { 23 | flPitch = (this->z > 0.0f) ? 270.f : 90.f; 24 | flYaw = 0.0f; 25 | } 26 | else 27 | { 28 | flPitch = M_RAD2DEG(std::atan2f(-this->z, this->Length2D())); 29 | 30 | if (flPitch < 0.f) 31 | flPitch += 360.f; 32 | 33 | flYaw = M_RAD2DEG(std::atan2f(this->y, this->x)); 34 | 35 | if (flYaw < 0.f) 36 | flYaw += 360.f; 37 | } 38 | 39 | return { flPitch, flYaw, 0.0f }; 40 | } 41 | 42 | [[nodiscard]] Matrix3x4_t Vector_t::ToMatrix() const 43 | { 44 | Vector_t vecRight = {}, vecUp = {}; 45 | this->ToDirections(&vecRight, &vecUp); 46 | 47 | Matrix3x4a_t matOutput = {}; 48 | matOutput.SetForward(*this); 49 | matOutput.SetLeft(-vecRight); 50 | matOutput.SetUp(vecUp); 51 | return matOutput; 52 | } -------------------------------------------------------------------------------- /cstrike/utilities/fnv1a.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | // used: [stl] uint64_t 3 | #include 4 | 5 | // used :CRT::StringLength 6 | #include "crt.h" 7 | 8 | using FNV1A_t = std::uint64_t; 9 | 10 | /* 11 | * 64-BIT FNV1A HASH 12 | */ 13 | namespace FNV1A 14 | { 15 | /* @section: [internal] constants */ 16 | constexpr FNV1A_t ullBasis = 0xCBF29CE484222325ULL; 17 | constexpr FNV1A_t ullPrime = 0x100000001B3ULL; 18 | 19 | /* @section: get */ 20 | /// @param[in] szString string for which you want to generate a hash 21 | /// @param[in] uKey key of hash generation 22 | /// @returns: calculated at compile-time hash of given string 23 | consteval FNV1A_t HashConst(const char* szString, const FNV1A_t uKey = ullBasis) noexcept 24 | { 25 | return (szString[0] == '\0') ? uKey : HashConst(&szString[1], (uKey ^ static_cast(szString[0])) * ullPrime); 26 | } 27 | 28 | /// @param[in] szString string for which you want to generate a hash 29 | /// @param[in] uKey key of hash generation 30 | /// @returns: calculated at run-time hash of given string 31 | inline FNV1A_t Hash(const char* szString, FNV1A_t uKey = ullBasis) noexcept 32 | { 33 | const std::size_t nLength = CRT::StringLength(szString); 34 | 35 | for (std::size_t i = 0U; i < nLength; ++i) 36 | uKey = (uKey ^ szString[i]) * ullPrime; 37 | 38 | return uKey; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # ASPHYXIA: CS2 2 | 3 | ## Table of Contents :scroll: 4 | - [About](#about) 5 | - [Contact](#contact) 6 | - [Credits](#credits) 7 | - [Reminder](#reminder) 8 | - [License](#license) 9 | 10 | ## About :information_source: 11 | - Asphyxia is a base that was intended to be a starting point. It is not a cheat itself, but rather a framework for building your own cheat. 12 | - C++ version: 20 13 | 14 | ## Credits 15 | - [imgui](https://github.com/ocornut/imgui) - framework 16 | - [freetype](https://freetype.org/) - font rasterizer 17 | - [minhook](https://github.com/TsudaKageyu/minhook) - hooking library 18 | - [qo0:csgo](https://github.com/rollraw/qo0-csgo) - where this base is inspired 19 | - [unknowncheats](https://www.unknowncheats.me/) - for helping building this base 20 | 21 | ## Reminder 22 | - this project is for educational purposes only. 23 | - ins 键呼出菜单 end 释放模块 24 | - it will now be more focus on the 'base' rather than the 'cheat' itself. 25 | [✓] ESP - basic esp feature like: name, hp, armor... (comes with interactive menu preview, not draggable) 26 | 27 | [✓] CHAMS - basic chams system 28 | 29 | [✓] AIMBOT - simple head aimbot with smoothing 30 | 31 | ## License 32 | 33 | - This project is licensed under the [MIT License](https://opensource.org/licenses/mit-license.php) - see the [LICENSE](LICENSE) file for details. 34 | -------------------------------------------------------------------------------- /dependencies/freetype/include/freetype/internal/services/svkern.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * svkern.h 4 | * 5 | * The FreeType Kerning service (specification). 6 | * 7 | * Copyright (C) 2006-2019 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef SVKERN_H_ 20 | #define SVKERN_H_ 21 | 22 | #include FT_INTERNAL_SERVICE_H 23 | #include FT_TRUETYPE_TABLES_H 24 | 25 | 26 | FT_BEGIN_HEADER 27 | 28 | #define FT_SERVICE_ID_KERNING "kerning" 29 | 30 | 31 | typedef FT_Error 32 | (*FT_Kerning_TrackGetFunc)( FT_Face face, 33 | FT_Fixed point_size, 34 | FT_Int degree, 35 | FT_Fixed* akerning ); 36 | 37 | FT_DEFINE_SERVICE( Kerning ) 38 | { 39 | FT_Kerning_TrackGetFunc get_track; 40 | }; 41 | 42 | /* */ 43 | 44 | 45 | FT_END_HEADER 46 | 47 | 48 | #endif /* SVKERN_H_ */ 49 | 50 | 51 | /* END */ 52 | -------------------------------------------------------------------------------- /dependencies/freetype/include/freetype/internal/ftpsprop.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * ftpsprop.h 4 | * 5 | * Get and set properties of PostScript drivers (specification). 6 | * 7 | * Copyright (C) 2017-2019 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef FTPSPROP_H_ 20 | #define FTPSPROP_H_ 21 | 22 | 23 | #include 24 | #include FT_FREETYPE_H 25 | 26 | 27 | FT_BEGIN_HEADER 28 | 29 | 30 | FT_BASE_CALLBACK( FT_Error ) 31 | ps_property_set( FT_Module module, /* PS_Driver */ 32 | const char* property_name, 33 | const void* value, 34 | FT_Bool value_is_string ); 35 | 36 | FT_BASE_CALLBACK( FT_Error ) 37 | ps_property_get( FT_Module module, /* PS_Driver */ 38 | const char* property_name, 39 | void* value ); 40 | 41 | 42 | FT_END_HEADER 43 | 44 | 45 | #endif /* FTPSPROP_H_ */ 46 | 47 | 48 | /* END */ 49 | -------------------------------------------------------------------------------- /cstrike/sdk/datatypes/utlstring.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "utlmemory.h" 3 | 4 | class CUtlBinaryBlock 5 | { 6 | public: 7 | CUtlBinaryBlock(const int nInitialGrowSize = 0, const int nInitialSize = 0) : 8 | memory(nInitialGrowSize, nInitialSize), nLength(0) { } 9 | 10 | CUtlMemory memory; 11 | int nLength; 12 | }; 13 | 14 | class CUtlString 15 | { 16 | public: 17 | CUtlString() { } 18 | 19 | [[nodiscard]] const char* Get() const 20 | { 21 | if (storage.nLength == 0) 22 | return ""; 23 | 24 | return reinterpret_cast(storage.memory.Base()); 25 | } 26 | 27 | [[nodiscard]] int Length() const 28 | { 29 | return storage.nLength; 30 | } 31 | 32 | private: 33 | CUtlBinaryBlock storage; 34 | }; 35 | 36 | template 37 | class CUtlConstStringBase 38 | { 39 | public: 40 | CUtlConstStringBase() : 41 | pString(nullptr) { } 42 | 43 | [[nodiscard]] const T* Get() const 44 | { 45 | return (pString != nullptr ? pString : static_cast("")); 46 | } 47 | 48 | [[nodiscard]] operator const T*() const 49 | { 50 | return (pString != nullptr ? pString : static_cast("")); 51 | } 52 | 53 | [[nodiscard]] bool Empty() const 54 | { 55 | return (pString == nullptr); 56 | } 57 | 58 | protected: 59 | const T* pString; 60 | }; 61 | 62 | using CUtlConstString = CUtlConstStringBase; 63 | using CUtlConstWideString = CUtlConstStringBase; -------------------------------------------------------------------------------- /cstrike/sdk/entity_handle.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../common.h" 4 | 5 | #define INVALID_EHANDLE_INDEX 0xFFFFFFFF 6 | #define ENT_ENTRY_MASK 0x7FFF 7 | #define NUM_SERIAL_NUM_SHIFT_BITS 15 8 | // @source: https://developer.valvesoftware.com/wiki/Entity_limit#Source_2_limits 9 | #define ENT_MAX_NETWORKED_ENTRY 16384 10 | 11 | class CBaseHandle 12 | { 13 | public: 14 | CBaseHandle() noexcept : 15 | nIndex(INVALID_EHANDLE_INDEX) { } 16 | 17 | CBaseHandle(const int nEntry, const int nSerial) noexcept 18 | { 19 | CS_ASSERT(nEntry >= 0 && (nEntry & ENT_ENTRY_MASK) == nEntry); 20 | CS_ASSERT(nSerial >= 0 && nSerial < (1 << NUM_SERIAL_NUM_SHIFT_BITS)); 21 | 22 | nIndex = nEntry | (nSerial << NUM_SERIAL_NUM_SHIFT_BITS); 23 | } 24 | 25 | bool operator!=(const CBaseHandle& other) const noexcept 26 | { 27 | return nIndex != other.nIndex; 28 | } 29 | 30 | bool operator==(const CBaseHandle& other) const noexcept 31 | { 32 | return nIndex == other.nIndex; 33 | } 34 | 35 | bool operator<(const CBaseHandle& other) const noexcept 36 | { 37 | return nIndex < other.nIndex; 38 | } 39 | 40 | [[nodiscard]] bool IsValid() const noexcept 41 | { 42 | return nIndex != INVALID_EHANDLE_INDEX; 43 | } 44 | 45 | [[nodiscard]] int GetEntryIndex() const noexcept 46 | { 47 | return static_cast(nIndex & ENT_ENTRY_MASK); 48 | } 49 | 50 | [[nodiscard]] int GetSerialNumber() const noexcept 51 | { 52 | return static_cast(nIndex >> NUM_SERIAL_NUM_SHIFT_BITS); 53 | } 54 | 55 | private: 56 | std::uint32_t nIndex; 57 | }; 58 | -------------------------------------------------------------------------------- /dependencies/freetype/include/freetype/internal/services/svotval.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * svotval.h 4 | * 5 | * The FreeType OpenType validation service (specification). 6 | * 7 | * Copyright (C) 2004-2019 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef SVOTVAL_H_ 20 | #define SVOTVAL_H_ 21 | 22 | #include FT_OPENTYPE_VALIDATE_H 23 | #include FT_INTERNAL_VALIDATE_H 24 | 25 | FT_BEGIN_HEADER 26 | 27 | 28 | #define FT_SERVICE_ID_OPENTYPE_VALIDATE "opentype-validate" 29 | 30 | 31 | typedef FT_Error 32 | (*otv_validate_func)( FT_Face volatile face, 33 | FT_UInt ot_flags, 34 | FT_Bytes *base, 35 | FT_Bytes *gdef, 36 | FT_Bytes *gpos, 37 | FT_Bytes *gsub, 38 | FT_Bytes *jstf ); 39 | 40 | 41 | FT_DEFINE_SERVICE( OTvalidate ) 42 | { 43 | otv_validate_func validate; 44 | }; 45 | 46 | /* */ 47 | 48 | 49 | FT_END_HEADER 50 | 51 | 52 | #endif /* SVOTVAL_H_ */ 53 | 54 | 55 | /* END */ 56 | -------------------------------------------------------------------------------- /dependencies/freetype/include/freetype/internal/services/svttglyf.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * svttglyf.h 4 | * 5 | * The FreeType TrueType glyph service. 6 | * 7 | * Copyright (C) 2007-2019 by 8 | * David Turner. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | #ifndef SVTTGLYF_H_ 19 | #define SVTTGLYF_H_ 20 | 21 | #include FT_INTERNAL_SERVICE_H 22 | #include FT_TRUETYPE_TABLES_H 23 | 24 | 25 | FT_BEGIN_HEADER 26 | 27 | 28 | #define FT_SERVICE_ID_TT_GLYF "tt-glyf" 29 | 30 | 31 | typedef FT_ULong 32 | (*TT_Glyf_GetLocationFunc)( FT_Face face, 33 | FT_UInt gindex, 34 | FT_ULong *psize ); 35 | 36 | FT_DEFINE_SERVICE( TTGlyf ) 37 | { 38 | TT_Glyf_GetLocationFunc get_location; 39 | }; 40 | 41 | 42 | #define FT_DEFINE_SERVICE_TTGLYFREC( class_, get_location_ ) \ 43 | static const FT_Service_TTGlyfRec class_ = \ 44 | { \ 45 | get_location_ \ 46 | }; 47 | 48 | /* */ 49 | 50 | 51 | FT_END_HEADER 52 | 53 | #endif /* SVTTGLYF_H_ */ 54 | 55 | 56 | /* END */ 57 | -------------------------------------------------------------------------------- /dependencies/imgui/imgui_impl_dx11.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer Backend for DirectX11 2 | // This needs to be used along with a Platform Backend (e.g. Win32) 3 | 4 | // Implemented features: 5 | // [X] Renderer: User texture binding. Use 'ID3D11ShaderResourceView*' as ImTextureID. Read the FAQ about ImTextureID! 6 | // [X] Renderer: Large meshes support (64k+ vertices) with 16-bit indices. 7 | 8 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 9 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 10 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 11 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 12 | 13 | #pragma once 14 | #include "imgui.h" // IMGUI_IMPL_API 15 | #ifndef IMGUI_DISABLE 16 | 17 | struct ID3D11Device; 18 | struct ID3D11DeviceContext; 19 | 20 | IMGUI_IMPL_API bool ImGui_ImplDX11_Init(ID3D11Device* device, ID3D11DeviceContext* device_context); 21 | IMGUI_IMPL_API void ImGui_ImplDX11_Shutdown(); 22 | IMGUI_IMPL_API void ImGui_ImplDX11_NewFrame(); 23 | IMGUI_IMPL_API void ImGui_ImplDX11_RenderDrawData(ImDrawData* draw_data); 24 | 25 | // Use if you want to reset your rendering device without losing Dear ImGui state. 26 | IMGUI_IMPL_API void ImGui_ImplDX11_InvalidateDeviceObjects(); 27 | IMGUI_IMPL_API bool ImGui_ImplDX11_CreateDeviceObjects(); 28 | 29 | #endif // #ifndef IMGUI_DISABLE 30 | -------------------------------------------------------------------------------- /dependencies/freetype/include/freetype/config/ftmodule.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file registers the FreeType modules compiled into the library. 3 | * 4 | * If you use GNU make, this file IS NOT USED! Instead, it is created in 5 | * the objects directory (normally `/objs/`) based on information 6 | * from `/modules.cfg`. 7 | * 8 | * Please read `docs/INSTALL.ANY` and `docs/CUSTOMIZE` how to compile 9 | * FreeType without GNU make. 10 | * 11 | */ 12 | 13 | FT_USE_MODULE( FT_Module_Class, autofit_module_class ) 14 | FT_USE_MODULE( FT_Driver_ClassRec, tt_driver_class ) 15 | FT_USE_MODULE( FT_Driver_ClassRec, t1_driver_class ) 16 | FT_USE_MODULE( FT_Driver_ClassRec, cff_driver_class ) 17 | FT_USE_MODULE( FT_Driver_ClassRec, t1cid_driver_class ) 18 | FT_USE_MODULE( FT_Driver_ClassRec, pfr_driver_class ) 19 | FT_USE_MODULE( FT_Driver_ClassRec, t42_driver_class ) 20 | FT_USE_MODULE( FT_Driver_ClassRec, winfnt_driver_class ) 21 | FT_USE_MODULE( FT_Driver_ClassRec, pcf_driver_class ) 22 | FT_USE_MODULE( FT_Module_Class, psaux_module_class ) 23 | FT_USE_MODULE( FT_Module_Class, psnames_module_class ) 24 | FT_USE_MODULE( FT_Module_Class, pshinter_module_class ) 25 | FT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class ) 26 | FT_USE_MODULE( FT_Module_Class, sfnt_module_class ) 27 | FT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class ) 28 | FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcd_renderer_class ) 29 | FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcdv_renderer_class ) 30 | FT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class ) 31 | 32 | /* EOF */ 33 | -------------------------------------------------------------------------------- /dependencies/freetype/include/freetype/internal/services/svfntfmt.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * svfntfmt.h 4 | * 5 | * The FreeType font format service (specification only). 6 | * 7 | * Copyright (C) 2003-2019 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef SVFNTFMT_H_ 20 | #define SVFNTFMT_H_ 21 | 22 | #include FT_INTERNAL_SERVICE_H 23 | 24 | 25 | FT_BEGIN_HEADER 26 | 27 | 28 | /* 29 | * A trivial service used to return the name of a face's font driver, 30 | * according to the XFree86 nomenclature. Note that the service data is a 31 | * simple constant string pointer. 32 | */ 33 | 34 | #define FT_SERVICE_ID_FONT_FORMAT "font-format" 35 | 36 | #define FT_FONT_FORMAT_TRUETYPE "TrueType" 37 | #define FT_FONT_FORMAT_TYPE_1 "Type 1" 38 | #define FT_FONT_FORMAT_BDF "BDF" 39 | #define FT_FONT_FORMAT_PCF "PCF" 40 | #define FT_FONT_FORMAT_TYPE_42 "Type 42" 41 | #define FT_FONT_FORMAT_CID "CID Type 1" 42 | #define FT_FONT_FORMAT_CFF "CFF" 43 | #define FT_FONT_FORMAT_PFR "PFR" 44 | #define FT_FONT_FORMAT_WINFNT "Windows FNT" 45 | 46 | /* */ 47 | 48 | 49 | FT_END_HEADER 50 | 51 | 52 | #endif /* SVFNTFMT_H_ */ 53 | 54 | 55 | /* END */ 56 | -------------------------------------------------------------------------------- /cstrike/sdk/vdata.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // used: schema field 4 | #include "../core/schema.h" 5 | // used: rop 6 | #include "../utilities/memory.h" 7 | 8 | using CFiringModeFloat = std::float_t[2]; 9 | using CSkillFloat = std::float_t[4]; 10 | 11 | class CBasePlayerVData 12 | { 13 | public: 14 | CS_CLASS_NO_INITIALIZER(CBasePlayerVData); 15 | 16 | //CResourceNameTyped< CWeakHandle< InfoForResourceTypeCModel > > m_sModelName = 0x28 17 | //CSkillFloat m_flHeadDamageMultiplier = 0x108 18 | //CSkillFloat m_flChestDamageMultiplier = 0x118 19 | //CSkillFloat m_flStomachDamageMultiplier = 0x128 20 | //CSkillFloat m_flArmDamageMultiplier = 0x138 21 | //CSkillFloat m_flLegDamageMultiplier = 0x148 22 | //float32 m_flHoldBreathTime = 0x158 23 | //float32 m_flDrowningDamageInterval = 0x15C 24 | //int32 m_nDrowningDamageInitial = 0x160 25 | //int32 m_nDrowningDamageMax = 0x164 26 | //int32 m_nWaterSpeed = 0x168 27 | //float32 m_flUseRange = 0x16C 28 | //float32 m_flUseAngleTolerance = 0x170 29 | //float32 m_flCrouchTime = 0x174 30 | }; 31 | 32 | class CBasePlayerWeaponVData 33 | { 34 | public: 35 | CS_CLASS_NO_INITIALIZER(CBasePlayerWeaponVData); 36 | 37 | SCHEMA_ADD_FIELD(bool, IsFullAuto, "CBasePlayerWeaponVData->m_bIsFullAuto"); 38 | SCHEMA_ADD_FIELD(std::int32_t, GetMaxClip1, "CBasePlayerWeaponVData->m_iMaxClip1"); 39 | }; 40 | 41 | class CCSWeaponBaseVData : public CBasePlayerWeaponVData 42 | { 43 | public: 44 | CS_CLASS_NO_INITIALIZER(CCSWeaponBaseVData); 45 | 46 | SCHEMA_ADD_FIELD(std::int32_t, GetWeaponType, "CCSWeaponBaseVData->m_WeaponType"); 47 | SCHEMA_ADD_FIELD(float, GetRange, "CCSWeaponBaseVData->m_flRange"); 48 | }; 49 | -------------------------------------------------------------------------------- /cstrike/features/visuals.cpp: -------------------------------------------------------------------------------- 1 | #include "visuals.h" 2 | 3 | // used: source sdk 4 | #include "../sdk/interfaces/iengineclient.h" 5 | #include "../sdk/entity.h" 6 | 7 | // used: overlay 8 | #include "visuals/overlay.h" 9 | #include "visuals/chams.h" 10 | 11 | #include "../core/sdk.h" 12 | #include "../aimRangePainter.hpp" 13 | using namespace F; 14 | 15 | bool F::VISUALS::Setup() 16 | { 17 | if (!CHAMS::Initialize()) 18 | { 19 | L_PRINT(LOG_ERROR) << CS_XOR("failed to initialize chams"); 20 | return false; 21 | } 22 | 23 | return true; 24 | } 25 | 26 | void F::VISUALS::OnDestroy() 27 | { 28 | CHAMS::Destroy(); 29 | } 30 | 31 | void VISUALS::OnFrame(const int nStage) 32 | { 33 | if (nStage == FRAME_RENDER_END) 34 | { 35 | // check is render initialized 36 | if (!D::bInitialized) 37 | return; 38 | 39 | /* 40 | * game and our gui are based on immediate render mode principe 41 | * this means that we should always reset draw data from previous frame and re-store it again 42 | */ 43 | D::ResetDrawData(); 44 | AimRangePainter aimRangePainter; 45 | aimRangePainter.Draw(D::pDrawListActive); 46 | if (CCSPlayerController* pLocal = CCSPlayerController::GetLocalPlayerController(); pLocal != nullptr) 47 | { 48 | OVERLAY::OnFrameStageNotify(pLocal); 49 | } 50 | 51 | D::SwapDrawData(); 52 | } 53 | } 54 | 55 | bool F::VISUALS::OnDrawObject(void* pAnimatableSceneObjectDesc, void* pDx11, CMeshData* arrMeshDraw, int nDataCount, void* pSceneView, void* pSceneLayer, void* pUnk, void* pUnk2) 56 | { 57 | return CHAMS::OnDrawObject(pAnimatableSceneObjectDesc, pDx11, arrMeshDraw, nDataCount, pSceneView, pSceneLayer, pUnk, pUnk2); 58 | } 59 | -------------------------------------------------------------------------------- /cstrike/sdk/interfaces/cgameentitysystem.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // used: schema field 4 | #include "../../utilities/memory.h" 5 | 6 | #include "../entity_handle.h" 7 | 8 | #define MAX_ENTITIES_IN_LIST 512 9 | #define MAX_ENTITY_LISTS 64 // 0x3F 10 | #define MAX_TOTAL_ENTITIES MAX_ENTITIES_IN_LIST* MAX_ENTITY_LISTS 11 | 12 | class C_BaseEntity; 13 | 14 | class CGameEntitySystem 15 | { 16 | public: 17 | /// GetClientEntity 18 | template 19 | T* Get(int nIndex) 20 | { 21 | return reinterpret_cast(this->GetEntityByIndex(nIndex)); 22 | } 23 | 24 | /// GetClientEntityFromHandle 25 | template 26 | T* Get(const CBaseHandle hHandle) 27 | { 28 | if (!hHandle.IsValid()) 29 | return nullptr; 30 | 31 | return reinterpret_cast(this->GetEntityByIndex(hHandle.GetEntryIndex())); 32 | } 33 | 34 | int GetHighestEntityIndex() 35 | { 36 | return *reinterpret_cast(reinterpret_cast(this) + 0x1510); 37 | } 38 | 39 | private: 40 | void* GetEntityByIndex(int nIndex) 41 | { 42 | //@ida: #STR: "(missing),", "(missing)", "Ent %3d: %s class %s name %s\n" | or find "cl_showents" cvar -> look for callback 43 | // do { pEntity = GetBaseEntityByIndex(g_pGameEntitySystem, nCurrentIndex); ... } 44 | using fnGetBaseEntity = void*(CS_THISCALL*)(void*, int); 45 | static auto GetBaseEntity = reinterpret_cast(MEM::FindPattern(CLIENT_DLL, CS_XOR("81 FA ? ? ? ? 77 ? 8B C2 C1 F8 ? 83 F8 ? 77 ? 48 98 48 8B 4C C1 ? 48 85 C9 74 ? 8B C2 25 ? ? ? ? 48 6B C0 ? 48 03 C8 74 ? 8B 41 ? 25 ? ? ? ? 3B C2 75 ? 48 8B 01"))); 46 | return GetBaseEntity(this, nIndex); 47 | } 48 | }; 49 | -------------------------------------------------------------------------------- /cstrike/sdk/interfaces/iengineclient.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // used: callvfunc 4 | #include "../../utilities/memory.h" 5 | 6 | enum EClientFrameStage : int 7 | { 8 | FRAME_UNDEFINED = -1, 9 | FRAME_START, 10 | // a network packet is being received 11 | FRAME_NET_UPDATE_START, 12 | // data has been received and we are going to start calling postdataupdate 13 | FRAME_NET_UPDATE_POSTDATAUPDATE_START, 14 | // data has been received and called postdataupdate on all data recipients 15 | FRAME_NET_UPDATE_POSTDATAUPDATE_END, 16 | // received all packets, we can now do interpolation, prediction, etc 17 | FRAME_NET_UPDATE_END, 18 | // start rendering the scene 19 | FRAME_RENDER_START, 20 | // finished rendering the scene 21 | FRAME_RENDER_END, 22 | FRAME_NET_FULL_FRAME_UPDATE_ON_REMOVE 23 | }; 24 | 25 | class IEngineClient 26 | { 27 | public: 28 | int GetMaxClients() 29 | { 30 | return MEM::CallVFunc(this); 31 | } 32 | 33 | bool IsInGame() 34 | { 35 | return MEM::CallVFunc(this); 36 | } 37 | 38 | bool IsConnected() 39 | { 40 | return MEM::CallVFunc(this); 41 | } 42 | 43 | // return CBaseHandle index 44 | int GetLocalPlayer() 45 | { 46 | int nIndex = -1; 47 | 48 | MEM::CallVFunc(this, std::ref(nIndex), 0); 49 | 50 | return nIndex + 1; 51 | } 52 | 53 | [[nodiscard]] const char* GetLevelName() 54 | { 55 | return MEM::CallVFunc(this); 56 | } 57 | 58 | [[nodiscard]] const char* GetLevelNameShort() 59 | { 60 | return MEM::CallVFunc(this); 61 | } 62 | 63 | [[nodiscard]] const char* GetProductVersionString() 64 | { 65 | return MEM::CallVFunc(this); 66 | } 67 | }; 68 | -------------------------------------------------------------------------------- /cstrike/sdk/interfaces/cgametracemanager.cpp: -------------------------------------------------------------------------------- 1 | // used: game trace manager 2 | #include "cgametracemanager.h" 3 | // used: c_csplayerpawn 4 | #include "../../sdk/entity.h" 5 | 6 | SurfaceData_t* GameTrace_t::GetSurfaceData() 7 | { 8 | using fnGetSurfaceData = std::uint64_t(__fastcall*)(void*); 9 | static fnGetSurfaceData oGetSurfaceData = reinterpret_cast(MEM::GetAbsoluteAddress(MEM::FindPattern(CLIENT_DLL, CS_XOR("E8 ? ? ? ? 48 85 C0 74 ? 44 38 60")), 0x1, 0x0)); 10 | 11 | #ifdef CS_PARANOID 12 | CS_ASSERT(oGetSurfaceData != nullptr); 13 | #endif 14 | 15 | return reinterpret_cast(oGetSurfaceData(m_pSurface)); 16 | } 17 | 18 | int GameTrace_t::GetHitboxId() 19 | { 20 | if (m_pHitboxData) 21 | return m_pHitboxData->m_nHitboxId; 22 | return 0; 23 | } 24 | 25 | int GameTrace_t::GetHitgroup() 26 | { 27 | if (m_pHitboxData) 28 | return m_pHitboxData->m_nHitGroup; 29 | return 0; 30 | } 31 | 32 | bool GameTrace_t::IsVisible() const 33 | { 34 | return (m_flFraction > 0.97f); 35 | } 36 | 37 | TraceFilter_t::TraceFilter_t(std::uint64_t uMask, C_CSPlayerPawn* pSkip1, C_CSPlayerPawn* pSkip2, int nLayer) 38 | { 39 | m_uTraceMask = uMask; 40 | m_v1[0] = m_v1[1] = 0; 41 | m_v2 = 7; 42 | m_v3 = nLayer; 43 | m_v4 = 0x49; 44 | m_v5 = 0; 45 | 46 | if (pSkip1 != nullptr) 47 | { 48 | m_arrSkipHandles[0] = pSkip1->GetRefEHandle().GetEntryIndex(); 49 | m_arrSkipHandles[2] = pSkip1->GetOwnerHandleIndex(); 50 | m_arrCollisions[0] = pSkip1->GetCollisionMask(); 51 | } 52 | 53 | if (pSkip2 != nullptr) 54 | { 55 | m_arrSkipHandles[0] = pSkip2->GetRefEHandle().GetEntryIndex(); 56 | m_arrSkipHandles[2] = pSkip2->GetOwnerHandleIndex(); 57 | m_arrCollisions[0] = pSkip2->GetCollisionMask(); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /dependencies/minhook/hde/pstdint.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MinHook - The Minimalistic API Hooking Library for x64/x86 3 | * Copyright (C) 2009-2017 Tsuda Kageyu. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR 16 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #pragma once 28 | 29 | #include 30 | 31 | // Integer types for HDE. 32 | typedef INT8 int8_t; 33 | typedef INT16 int16_t; 34 | typedef INT32 int32_t; 35 | typedef INT64 int64_t; 36 | typedef UINT8 uint8_t; 37 | typedef UINT16 uint16_t; 38 | typedef UINT32 uint32_t; 39 | typedef UINT64 uint64_t; 40 | -------------------------------------------------------------------------------- /dependencies/freetype/include/freetype/internal/services/svpfr.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * svpfr.h 4 | * 5 | * Internal PFR service functions (specification). 6 | * 7 | * Copyright (C) 2003-2019 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef SVPFR_H_ 20 | #define SVPFR_H_ 21 | 22 | #include FT_PFR_H 23 | #include FT_INTERNAL_SERVICE_H 24 | 25 | 26 | FT_BEGIN_HEADER 27 | 28 | 29 | #define FT_SERVICE_ID_PFR_METRICS "pfr-metrics" 30 | 31 | 32 | typedef FT_Error 33 | (*FT_PFR_GetMetricsFunc)( FT_Face face, 34 | FT_UInt *aoutline, 35 | FT_UInt *ametrics, 36 | FT_Fixed *ax_scale, 37 | FT_Fixed *ay_scale ); 38 | 39 | typedef FT_Error 40 | (*FT_PFR_GetKerningFunc)( FT_Face face, 41 | FT_UInt left, 42 | FT_UInt right, 43 | FT_Vector *avector ); 44 | 45 | typedef FT_Error 46 | (*FT_PFR_GetAdvanceFunc)( FT_Face face, 47 | FT_UInt gindex, 48 | FT_Pos *aadvance ); 49 | 50 | 51 | FT_DEFINE_SERVICE( PfrMetrics ) 52 | { 53 | FT_PFR_GetMetricsFunc get_metrics; 54 | FT_PFR_GetKerningFunc get_kerning; 55 | FT_PFR_GetAdvanceFunc get_advance; 56 | 57 | }; 58 | 59 | /* */ 60 | 61 | FT_END_HEADER 62 | 63 | #endif /* SVPFR_H_ */ 64 | 65 | 66 | /* END */ 67 | -------------------------------------------------------------------------------- /dependencies/freetype/include/freetype/internal/services/svpostnm.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * svpostnm.h 4 | * 5 | * The FreeType PostScript name services (specification). 6 | * 7 | * Copyright (C) 2003-2019 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef SVPOSTNM_H_ 20 | #define SVPOSTNM_H_ 21 | 22 | #include FT_INTERNAL_SERVICE_H 23 | 24 | 25 | FT_BEGIN_HEADER 26 | 27 | /* 28 | * A trivial service used to retrieve the PostScript name of a given font 29 | * when available. The `get_name' field should never be `NULL`. 30 | * 31 | * The corresponding function can return `NULL` to indicate that the 32 | * PostScript name is not available. 33 | * 34 | * The name is owned by the face and will be destroyed with it. 35 | */ 36 | 37 | #define FT_SERVICE_ID_POSTSCRIPT_FONT_NAME "postscript-font-name" 38 | 39 | 40 | typedef const char* 41 | (*FT_PsName_GetFunc)( FT_Face face ); 42 | 43 | 44 | FT_DEFINE_SERVICE( PsFontName ) 45 | { 46 | FT_PsName_GetFunc get_ps_font_name; 47 | }; 48 | 49 | 50 | #define FT_DEFINE_SERVICE_PSFONTNAMEREC( class_, get_ps_font_name_ ) \ 51 | static const FT_Service_PsFontNameRec class_ = \ 52 | { \ 53 | get_ps_font_name_ \ 54 | }; 55 | 56 | /* */ 57 | 58 | 59 | FT_END_HEADER 60 | 61 | 62 | #endif /* SVPOSTNM_H_ */ 63 | 64 | 65 | /* END */ 66 | -------------------------------------------------------------------------------- /cstrike/utilities/inputsystem.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | // used: [win] winapi 3 | #ifndef WIN32_LEAN_AND_MEAN 4 | #define WIN32_LEAN_AND_MEAN 5 | #endif 6 | #include 7 | 8 | #include "../common.h" 9 | // used: keybind_t 10 | #include "../core/config.h" 11 | 12 | /* 13 | * INPUT SYSTEM 14 | * listen and handle key states 15 | */ 16 | namespace IPT 17 | { 18 | using KeyState_t = std::uint8_t; 19 | 20 | enum EKeyState : KeyState_t 21 | { 22 | KEY_STATE_NONE, 23 | KEY_STATE_DOWN, 24 | KEY_STATE_UP, 25 | KEY_STATE_RELEASED 26 | }; 27 | 28 | /* @section: values */ 29 | // current window 30 | inline HWND hWindow = nullptr; 31 | // saved window messages handler 32 | inline WNDPROC pOldWndProc = nullptr; 33 | // last processed key states 34 | inline KeyState_t arrKeyState[256] = {}; 35 | 36 | // replace game window messages processor with our 37 | bool Setup(); 38 | // restore window messages processor to original 39 | void Destroy(); 40 | 41 | /* @section: callbacks */ 42 | // process input window message and save keys states in array 43 | bool OnWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 44 | 45 | /* @section: get */ 46 | /// @returns: true if keybind is active, false otherwise 47 | bool GetBindState(KeyBind_t& keyBind); 48 | 49 | [[nodiscard]] bool IsHovered(const ImVec2& vecPosition, const ImVec2& vecSize); 50 | 51 | /// @returns: true if key is being held, false otherwise 52 | [[nodiscard]] CS_INLINE bool IsKeyDown(const std::uint32_t uButtonCode) 53 | { 54 | return arrKeyState[uButtonCode] == KEY_STATE_DOWN; 55 | } 56 | 57 | /// @returns: true if key has been just released, false otherwise 58 | [[nodiscard]] CS_INLINE bool IsKeyReleased(const std::uint32_t uButtonCode) 59 | { 60 | if (arrKeyState[uButtonCode] == KEY_STATE_RELEASED) 61 | { 62 | arrKeyState[uButtonCode] = KEY_STATE_UP; 63 | return true; 64 | } 65 | 66 | return false; 67 | } 68 | } -------------------------------------------------------------------------------- /dependencies/minhook/buffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MinHook - The Minimalistic API Hooking Library for x64/x86 3 | * Copyright (C) 2009-2017 Tsuda Kageyu. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 20 | * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #pragma once 30 | 31 | // Size of each memory slot. 32 | #if defined(_M_X64) || defined(__x86_64__) 33 | #define MEMORY_SLOT_SIZE 64 34 | #else 35 | #define MEMORY_SLOT_SIZE 32 36 | #endif 37 | 38 | VOID InitializeBuffer(VOID); 39 | VOID UninitializeBuffer(VOID); 40 | LPVOID AllocateBuffer(LPVOID pOrigin); 41 | VOID FreeBuffer(LPVOID pBuffer); 42 | BOOL IsExecutableAddress(LPVOID pAddress); 43 | -------------------------------------------------------------------------------- /dependencies/freetype/include/freetype/internal/services/svprop.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * svprop.h 4 | * 5 | * The FreeType property service (specification). 6 | * 7 | * Copyright (C) 2012-2019 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef SVPROP_H_ 20 | #define SVPROP_H_ 21 | 22 | 23 | FT_BEGIN_HEADER 24 | 25 | 26 | #define FT_SERVICE_ID_PROPERTIES "properties" 27 | 28 | 29 | typedef FT_Error 30 | (*FT_Properties_SetFunc)( FT_Module module, 31 | const char* property_name, 32 | const void* value, 33 | FT_Bool value_is_string ); 34 | 35 | typedef FT_Error 36 | (*FT_Properties_GetFunc)( FT_Module module, 37 | const char* property_name, 38 | void* value ); 39 | 40 | 41 | FT_DEFINE_SERVICE( Properties ) 42 | { 43 | FT_Properties_SetFunc set_property; 44 | FT_Properties_GetFunc get_property; 45 | }; 46 | 47 | 48 | #define FT_DEFINE_SERVICE_PROPERTIESREC( class_, \ 49 | set_property_, \ 50 | get_property_ ) \ 51 | static const FT_Service_PropertiesRec class_ = \ 52 | { \ 53 | set_property_, \ 54 | get_property_ \ 55 | }; 56 | 57 | /* */ 58 | 59 | 60 | FT_END_HEADER 61 | 62 | 63 | #endif /* SVPROP_H_ */ 64 | 65 | 66 | /* END */ 67 | -------------------------------------------------------------------------------- /dependencies/freetype/include/freetype/internal/services/svbdf.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * svbdf.h 4 | * 5 | * The FreeType BDF services (specification). 6 | * 7 | * Copyright (C) 2003-2019 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef SVBDF_H_ 20 | #define SVBDF_H_ 21 | 22 | #include FT_BDF_H 23 | #include FT_INTERNAL_SERVICE_H 24 | 25 | 26 | FT_BEGIN_HEADER 27 | 28 | 29 | #define FT_SERVICE_ID_BDF "bdf" 30 | 31 | typedef FT_Error 32 | (*FT_BDF_GetCharsetIdFunc)( FT_Face face, 33 | const char* *acharset_encoding, 34 | const char* *acharset_registry ); 35 | 36 | typedef FT_Error 37 | (*FT_BDF_GetPropertyFunc)( FT_Face face, 38 | const char* prop_name, 39 | BDF_PropertyRec *aproperty ); 40 | 41 | 42 | FT_DEFINE_SERVICE( BDF ) 43 | { 44 | FT_BDF_GetCharsetIdFunc get_charset_id; 45 | FT_BDF_GetPropertyFunc get_property; 46 | }; 47 | 48 | 49 | #define FT_DEFINE_SERVICE_BDFRec( class_, \ 50 | get_charset_id_, \ 51 | get_property_ ) \ 52 | static const FT_Service_BDFRec class_ = \ 53 | { \ 54 | get_charset_id_, get_property_ \ 55 | }; 56 | 57 | /* */ 58 | 59 | 60 | FT_END_HEADER 61 | 62 | 63 | #endif /* SVBDF_H_ */ 64 | 65 | 66 | /* END */ 67 | -------------------------------------------------------------------------------- /dependencies/freetype/include/freetype/internal/services/svgxval.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * svgxval.h 4 | * 5 | * FreeType API for validating TrueTypeGX/AAT tables (specification). 6 | * 7 | * Copyright (C) 2004-2019 by 8 | * Masatake YAMATO, Red Hat K.K., 9 | * David Turner, Robert Wilhelm, and Werner Lemberg. 10 | * 11 | * This file is part of the FreeType project, and may only be used, 12 | * modified, and distributed under the terms of the FreeType project 13 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 14 | * this file you indicate that you have read the license and 15 | * understand and accept it fully. 16 | * 17 | */ 18 | 19 | /**************************************************************************** 20 | * 21 | * gxvalid is derived from both gxlayout module and otvalid module. 22 | * Development of gxlayout is supported by the Information-technology 23 | * Promotion Agency(IPA), Japan. 24 | * 25 | */ 26 | 27 | 28 | #ifndef SVGXVAL_H_ 29 | #define SVGXVAL_H_ 30 | 31 | #include FT_GX_VALIDATE_H 32 | #include FT_INTERNAL_VALIDATE_H 33 | 34 | FT_BEGIN_HEADER 35 | 36 | 37 | #define FT_SERVICE_ID_GX_VALIDATE "truetypegx-validate" 38 | #define FT_SERVICE_ID_CLASSICKERN_VALIDATE "classickern-validate" 39 | 40 | typedef FT_Error 41 | (*gxv_validate_func)( FT_Face face, 42 | FT_UInt gx_flags, 43 | FT_Bytes tables[FT_VALIDATE_GX_LENGTH], 44 | FT_UInt table_length ); 45 | 46 | 47 | typedef FT_Error 48 | (*ckern_validate_func)( FT_Face face, 49 | FT_UInt ckern_flags, 50 | FT_Bytes *ckern_table ); 51 | 52 | 53 | FT_DEFINE_SERVICE( GXvalidate ) 54 | { 55 | gxv_validate_func validate; 56 | }; 57 | 58 | FT_DEFINE_SERVICE( CKERNvalidate ) 59 | { 60 | ckern_validate_func validate; 61 | }; 62 | 63 | /* */ 64 | 65 | 66 | FT_END_HEADER 67 | 68 | 69 | #endif /* SVGXVAL_H_ */ 70 | 71 | 72 | /* END */ 73 | -------------------------------------------------------------------------------- /cstrike/utilities/notify.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // used: [stl] vector 4 | #include 5 | // used: draw wrapper 6 | #include "draw.h" 7 | 8 | #pragma region notify_definitions 9 | #define NOFITY_TEXT_SIZE 64U // max size of notification text 10 | // @todo: use ImStyle? 11 | #define NOTIFY_ANIMATION_TIME 15.0 // time in ms to show/hide notification 12 | #define NOTIFY_DELETE_TIME 30.0 // time in ms to delete notification 13 | #pragma endregion 14 | 15 | #pragma region notify_enumerations 16 | using NotificationType_t = int; 17 | 18 | enum ENotificationType : NotificationType_t 19 | { 20 | N_TYPE_DEFAULT = 0, 21 | N_TYPE_INFO, 22 | N_TYPE_SUCCESS, 23 | N_TYPE_WARNING, 24 | N_TYPE_ERROR, 25 | N_TYPE_MAX 26 | }; 27 | 28 | using NotificationState_t = int; 29 | 30 | enum ENotificationState : NotificationState_t 31 | { 32 | N_STATE_START = 0, 33 | N_STATE_STAY, 34 | N_STATE_END, 35 | N_STATE_EXPIRED, 36 | N_STATE_MAX 37 | }; 38 | 39 | #pragma endregion 40 | 41 | namespace NOTIFY 42 | { 43 | struct NotificationData_t 44 | { 45 | NotificationData_t(ENotificationType nType, const char* szFormat, ...); 46 | 47 | /// @return color of notification type 48 | const Color_t& GetTypeColor() const; 49 | /// @return c-type string of notification text 50 | const char* Data() const; 51 | /// @return icon of notification type 52 | const char* GetIcon() const; 53 | /// @return time difference between creation and current time 54 | const float GetTimeDelta(const float flCurrentTime) const; 55 | 56 | int nType = 0; 57 | char szBuffer[NOFITY_TEXT_SIZE]; 58 | float flCreateionTime = 0.0; 59 | AnimationHandler_t animHandler = AnimationHandler_t(); 60 | }; 61 | 62 | /* @section: main */ 63 | // push notification to queue 64 | void Push(const NotificationData_t& notification); 65 | // pop notification from queue 66 | void _Remove(size_t nIndex); 67 | // render notifications 68 | void Render(); 69 | 70 | /* @section: values */ 71 | // maximum time to show notification 72 | inline constexpr float _MAX_TIME = 5.f; 73 | // maximum count of notifications 74 | inline std::vector vecNotifications = {}; 75 | } -------------------------------------------------------------------------------- /cstrike/sdk/datatypes/qangle.cpp: -------------------------------------------------------------------------------- 1 | #include "qangle.h" 2 | 3 | // used: [d3d] xmscalarsincos 4 | #include 5 | 6 | #include "matrix.h" 7 | 8 | // used: m_deg2rad 9 | #include "../../utilities/math.h" 10 | 11 | void QAngle_t::ToDirections(Vector_t* pvecForward, Vector_t* pvecRight, Vector_t* pvecUp) const 12 | { 13 | float flPitchSin, flPitchCos, flYawSin, flYawCos, flRollSin, flRollCos; 14 | DirectX::XMScalarSinCos(&flPitchSin, &flPitchCos, M_DEG2RAD(this->x)); 15 | DirectX::XMScalarSinCos(&flYawSin, &flYawCos, M_DEG2RAD(this->y)); 16 | DirectX::XMScalarSinCos(&flRollSin, &flRollCos, M_DEG2RAD(this->z)); 17 | 18 | if (pvecForward != nullptr) 19 | { 20 | pvecForward->x = flPitchCos * flYawCos; 21 | pvecForward->y = flPitchCos * flYawSin; 22 | pvecForward->z = -flPitchSin; 23 | } 24 | 25 | if (pvecRight != nullptr) 26 | { 27 | pvecRight->x = (-flRollSin * flPitchSin * flYawCos) + (-flRollCos * -flYawSin); 28 | pvecRight->y = (-flRollSin * flPitchSin * flYawSin) + (-flRollCos * flYawCos); 29 | pvecRight->z = (-flRollSin * flPitchCos); 30 | } 31 | 32 | if (pvecUp != nullptr) 33 | { 34 | pvecUp->x = (flRollCos * flPitchSin * flYawCos) + (-flRollSin * -flYawSin); 35 | pvecUp->y = (flRollCos * flPitchSin * flYawSin) + (-flRollSin * flYawCos); 36 | pvecUp->z = (flRollCos * flPitchCos); 37 | } 38 | } 39 | 40 | Matrix3x4_t QAngle_t::ToMatrix(const Vector_t& vecOrigin) const 41 | { 42 | float flPitchSin, flPitchCos, flYawSin, flYawCos, flRollSin, flRollCos; 43 | DirectX::XMScalarSinCos(&flPitchSin, &flPitchCos, M_DEG2RAD(this->x)); 44 | DirectX::XMScalarSinCos(&flYawSin, &flYawCos, M_DEG2RAD(this->y)); 45 | DirectX::XMScalarSinCos(&flRollSin, &flRollCos, M_DEG2RAD(this->z)); 46 | 47 | return { 48 | (flPitchCos * flYawCos), (flRollSin * flPitchSin * flYawCos + flRollCos * -flYawSin), (flRollCos * flPitchSin * flYawCos + -flRollSin * -flYawSin), vecOrigin.x, 49 | (flPitchCos * flYawSin), (flRollSin * flPitchSin * flYawSin + flRollCos * flYawCos), (flRollCos * flPitchSin * flYawSin + -flRollSin * flYawCos), vecOrigin.y, 50 | (-flPitchSin), (flRollSin * flPitchCos), (flRollCos * flPitchCos), vecOrigin.z 51 | }; 52 | } -------------------------------------------------------------------------------- /dependencies/freetype/include/freetype/internal/services/svgldict.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * svgldict.h 4 | * 5 | * The FreeType glyph dictionary services (specification). 6 | * 7 | * Copyright (C) 2003-2019 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef SVGLDICT_H_ 20 | #define SVGLDICT_H_ 21 | 22 | #include FT_INTERNAL_SERVICE_H 23 | 24 | 25 | FT_BEGIN_HEADER 26 | 27 | 28 | /* 29 | * A service used to retrieve glyph names, as well as to find the index of 30 | * a given glyph name in a font. 31 | * 32 | */ 33 | 34 | #define FT_SERVICE_ID_GLYPH_DICT "glyph-dict" 35 | 36 | 37 | typedef FT_Error 38 | (*FT_GlyphDict_GetNameFunc)( FT_Face face, 39 | FT_UInt glyph_index, 40 | FT_Pointer buffer, 41 | FT_UInt buffer_max ); 42 | 43 | typedef FT_UInt 44 | (*FT_GlyphDict_NameIndexFunc)( FT_Face face, 45 | FT_String* glyph_name ); 46 | 47 | 48 | FT_DEFINE_SERVICE( GlyphDict ) 49 | { 50 | FT_GlyphDict_GetNameFunc get_name; 51 | FT_GlyphDict_NameIndexFunc name_index; /* optional */ 52 | }; 53 | 54 | 55 | #define FT_DEFINE_SERVICE_GLYPHDICTREC( class_, \ 56 | get_name_, \ 57 | name_index_ ) \ 58 | static const FT_Service_GlyphDictRec class_ = \ 59 | { \ 60 | get_name_, name_index_ \ 61 | }; 62 | 63 | /* */ 64 | 65 | 66 | FT_END_HEADER 67 | 68 | 69 | #endif /* SVGLDICT_H_ */ 70 | 71 | 72 | /* END */ 73 | -------------------------------------------------------------------------------- /cstrike/features.cpp: -------------------------------------------------------------------------------- 1 | #include "features.h" 2 | 3 | // used: draw callbacks 4 | #include "utilities/draw.h" 5 | // used: notify 6 | #include "utilities/notify.h" 7 | 8 | // used: cheat variables 9 | #include "core/variables.h" 10 | // used: menu 11 | #include "core/menu.h" 12 | 13 | // used: features callbacks 14 | #include "features/visuals.h" 15 | #include "features/misc.h" 16 | #include "features/legitbot.h" 17 | 18 | // used: interfaces 19 | #include "core/interfaces.h" 20 | #include "sdk/interfaces/iengineclient.h" 21 | #include "sdk/interfaces/cgameentitysystem.h" 22 | #include "sdk/datatypes/usercmd.h" 23 | #include "sdk/entity.h" 24 | #include "aimRangePainter.hpp" 25 | 26 | bool F::Setup() 27 | { 28 | if (!VISUALS::Setup()) 29 | { 30 | L_PRINT(LOG_ERROR) << CS_XOR("failed to setup visuals"); 31 | return false; 32 | } 33 | 34 | return true; 35 | } 36 | 37 | void F::Destroy() 38 | { 39 | VISUALS::OnDestroy(); 40 | } 41 | 42 | void F::OnPresent() 43 | { 44 | if (!D::bInitialized) 45 | return; 46 | 47 | D::NewFrame(); 48 | { 49 | // render watermark 50 | MENU::RenderWatermark(); 51 | 52 | // main window 53 | ImGui::PushFont(FONT::pMenu[C_GET(int, Vars.nDpiScale)]); 54 | // @note: here you can draw your stuff 55 | MENU::RenderMainWindow(); 56 | // render notifications 57 | NOTIFY::Render(); 58 | ImGui::PopFont(); 59 | } 60 | D::Render(); 61 | } 62 | 63 | void F::OnFrameStageNotify(int nStage) 64 | { 65 | F::VISUALS::OnFrame(nStage); 66 | } 67 | 68 | void F::OnCreateMove(CUserCmd* pCmd, CBaseUserCmdPB* pBaseCmd, CCSPlayerController* pLocalController) 69 | { 70 | C_CSPlayerPawn* pLocalPawn = I::GameResourceService->pGameEntitySystem->Get(pLocalController->GetPawnHandle()); 71 | if (pLocalPawn == nullptr) 72 | return; 73 | 74 | F::MISC::OnMove(pCmd, pBaseCmd, pLocalController, pLocalPawn); 75 | F::LEGITBOT::OnMove(pCmd, pBaseCmd, pLocalController, pLocalPawn); 76 | } 77 | 78 | bool F::OnDrawObject(void* pAnimatableSceneObjectDesc, void* pDx11, CMeshData* arrMeshDraw, int nDataCount, void* pSceneView, void* pSceneLayer, void* pUnk, void* pUnk2) 79 | { 80 | return VISUALS::OnDrawObject(pAnimatableSceneObjectDesc, pDx11, arrMeshDraw, nDataCount, pSceneView, pSceneLayer, pUnk, pUnk2); 81 | } 82 | -------------------------------------------------------------------------------- /cstrike/core/schema.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | #include "../common.h" 5 | 6 | // used: fnv-1a hash 7 | #include "../utilities/fnv1a.h" 8 | 9 | #define SCHEMA_ADD_OFFSET(TYPE, NAME, OFFSET) \ 10 | [[nodiscard]] CS_INLINE std::add_lvalue_reference_t NAME() \ 11 | { \ 12 | static const std::uint32_t uOffset = OFFSET; \ 13 | return *reinterpret_cast>(reinterpret_cast(this) + (uOffset)); \ 14 | } 15 | 16 | #define SCHEMA_ADD_POFFSET(TYPE, NAME, OFFSET) \ 17 | [[nodiscard]] CS_INLINE std::add_pointer_t NAME() \ 18 | { \ 19 | const static std::uint32_t uOffset = OFFSET; \ 20 | return reinterpret_cast>(reinterpret_cast(this) + (uOffset)); \ 21 | } 22 | 23 | #define SCHEMA_ADD_FIELD_OFFSET(TYPE, NAME, FIELD, ADDITIONAL) SCHEMA_ADD_OFFSET(TYPE, NAME, SCHEMA::GetOffset(FNV1A::HashConst(FIELD)) + ADDITIONAL) 24 | 25 | #define SCHEMA_ADD_FIELD(TYPE, NAME, FIELD) SCHEMA_ADD_FIELD_OFFSET(TYPE, NAME, FIELD, 0U) 26 | 27 | #define SCHEMA_ADD_PFIELD_OFFSET(TYPE, NAME, FIELD, ADDITIONAL) SCHEMA_ADD_POFFSET(TYPE, NAME, SCHEMA::GetOffset(FNV1A::HashConst(FIELD)) + ADDITIONAL) 28 | 29 | #define SCHEMA_ADD_PFIELD(TYPE, NAME, FIELD) SCHEMA_ADD_PFIELD_OFFSET(TYPE, NAME, FIELD, 0U) 30 | 31 | // @todo: dump enums? 32 | namespace SCHEMA 33 | { 34 | // store the offset of the field in the class 35 | // dump stored data to file 36 | bool Setup(const wchar_t* wszFileName, const char* szModuleName); 37 | 38 | /* @section: get */ 39 | // get offset of the field in the class 40 | // @note: only client.dll class & fields 41 | [[nodiscard]] std::uint32_t GetOffset(const FNV1A_t uHashedFieldName); 42 | 43 | // get foregin offset from other .dll 44 | [[nodiscard]] std::uint32_t GetForeignOffset(const char* szModulenName, const FNV1A_t uHashedClassName, const FNV1A_t uHashedFieldName); 45 | } 46 | -------------------------------------------------------------------------------- /dependencies/freetype/include/freetype/internal/services/svcid.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * svcid.h 4 | * 5 | * The FreeType CID font services (specification). 6 | * 7 | * Copyright (C) 2007-2019 by 8 | * Derek Clegg and Michael Toftdal. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef SVCID_H_ 20 | #define SVCID_H_ 21 | 22 | #include FT_INTERNAL_SERVICE_H 23 | 24 | 25 | FT_BEGIN_HEADER 26 | 27 | 28 | #define FT_SERVICE_ID_CID "CID" 29 | 30 | typedef FT_Error 31 | (*FT_CID_GetRegistryOrderingSupplementFunc)( FT_Face face, 32 | const char* *registry, 33 | const char* *ordering, 34 | FT_Int *supplement ); 35 | typedef FT_Error 36 | (*FT_CID_GetIsInternallyCIDKeyedFunc)( FT_Face face, 37 | FT_Bool *is_cid ); 38 | typedef FT_Error 39 | (*FT_CID_GetCIDFromGlyphIndexFunc)( FT_Face face, 40 | FT_UInt glyph_index, 41 | FT_UInt *cid ); 42 | 43 | FT_DEFINE_SERVICE( CID ) 44 | { 45 | FT_CID_GetRegistryOrderingSupplementFunc get_ros; 46 | FT_CID_GetIsInternallyCIDKeyedFunc get_is_cid; 47 | FT_CID_GetCIDFromGlyphIndexFunc get_cid_from_glyph_index; 48 | }; 49 | 50 | 51 | #define FT_DEFINE_SERVICE_CIDREC( class_, \ 52 | get_ros_, \ 53 | get_is_cid_, \ 54 | get_cid_from_glyph_index_ ) \ 55 | static const FT_Service_CIDRec class_ = \ 56 | { \ 57 | get_ros_, get_is_cid_, get_cid_from_glyph_index_ \ 58 | }; 59 | 60 | /* */ 61 | 62 | 63 | FT_END_HEADER 64 | 65 | 66 | #endif /* SVCID_H_ */ 67 | 68 | 69 | /* END */ 70 | -------------------------------------------------------------------------------- /dependencies/freetype/include/freetype/internal/services/svsfnt.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * svsfnt.h 4 | * 5 | * The FreeType SFNT table loading service (specification). 6 | * 7 | * Copyright (C) 2003-2019 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef SVSFNT_H_ 20 | #define SVSFNT_H_ 21 | 22 | #include FT_INTERNAL_SERVICE_H 23 | #include FT_TRUETYPE_TABLES_H 24 | 25 | 26 | FT_BEGIN_HEADER 27 | 28 | 29 | /* 30 | * SFNT table loading service. 31 | */ 32 | 33 | #define FT_SERVICE_ID_SFNT_TABLE "sfnt-table" 34 | 35 | 36 | /* 37 | * Used to implement FT_Load_Sfnt_Table(). 38 | */ 39 | typedef FT_Error 40 | (*FT_SFNT_TableLoadFunc)( FT_Face face, 41 | FT_ULong tag, 42 | FT_Long offset, 43 | FT_Byte* buffer, 44 | FT_ULong* length ); 45 | 46 | /* 47 | * Used to implement FT_Get_Sfnt_Table(). 48 | */ 49 | typedef void* 50 | (*FT_SFNT_TableGetFunc)( FT_Face face, 51 | FT_Sfnt_Tag tag ); 52 | 53 | 54 | /* 55 | * Used to implement FT_Sfnt_Table_Info(). 56 | */ 57 | typedef FT_Error 58 | (*FT_SFNT_TableInfoFunc)( FT_Face face, 59 | FT_UInt idx, 60 | FT_ULong *tag, 61 | FT_ULong *offset, 62 | FT_ULong *length ); 63 | 64 | 65 | FT_DEFINE_SERVICE( SFNT_Table ) 66 | { 67 | FT_SFNT_TableLoadFunc load_table; 68 | FT_SFNT_TableGetFunc get_table; 69 | FT_SFNT_TableInfoFunc table_info; 70 | }; 71 | 72 | 73 | #define FT_DEFINE_SERVICE_SFNT_TABLEREC( class_, load_, get_, info_ ) \ 74 | static const FT_Service_SFNT_TableRec class_ = \ 75 | { \ 76 | load_, get_, info_ \ 77 | }; 78 | 79 | /* */ 80 | 81 | 82 | FT_END_HEADER 83 | 84 | 85 | #endif /* SVSFNT_H_ */ 86 | 87 | 88 | /* END */ 89 | -------------------------------------------------------------------------------- /cstrike/sdk/datatypes/quaternion.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct Quaternion_t 4 | { 5 | constexpr Quaternion_t(const float x = 0.0f, const float y = 0.0f, const float z = 0.0f, const float w = 0.0f) : 6 | x(x), y(y), z(z), w(w) { } 7 | 8 | [[nodiscard]] bool IsValid() const 9 | { 10 | return (std::isfinite(x) && std::isfinite(y) && std::isfinite(z) && std::isfinite(w)); 11 | } 12 | 13 | /// @param[in] vecOrigin [optional] translation for converted matrix 14 | /// @returns: matrix converted from quaternion 15 | [[nodiscard]] Matrix3x4_t ToMatrix(const Vector_t& vecOrigin = {}) const 16 | { 17 | CS_ASSERT(this->IsValid()); 18 | 19 | Matrix3x4_t matOut; 20 | 21 | #ifdef _DEBUG // precalculate common multiplications 22 | const float x2 = this->x + this->x, y2 = this->y + this->y, z2 = this->z + this->z; 23 | const float xx = this->x * x2, xy = this->x * y2, xz = this->x * z2; 24 | const float yy = this->y * y2, yz = this->y * z2; 25 | const float zz = this->z * z2; 26 | const float wx = this->w * x2, wy = this->w * y2, wz = this->w * z2; 27 | 28 | matOut[0][0] = 1.0f - (yy + zz); 29 | matOut[1][0] = xy + wz; 30 | matOut[2][0] = xz - wy; 31 | 32 | matOut[0][1] = xy - wz; 33 | matOut[1][1] = 1.0f - (xx + zz); 34 | matOut[2][1] = yz + wx; 35 | 36 | matOut[0][2] = xz + wy; 37 | matOut[1][2] = yz - wx; 38 | matOut[2][2] = 1.0f - (xx + yy); 39 | #else // let the compiler optimize calculations itself 40 | matOut[0][0] = 1.0f - 2.0f * this->y * this->y - 2.0f * this->z * this->z; 41 | matOut[1][0] = 2.0f * this->x * this->y + 2.0f * this->w * this->z; 42 | matOut[2][0] = 2.0f * this->x * this->z - 2.0f * this->w * this->y; 43 | 44 | matOut[0][1] = 2.0f * this->x * this->y - 2.0f * this->w * this->z; 45 | matOut[1][1] = 1.0f - 2.0f * this->x * this->x - 2.0f * this->z * this->z; 46 | matOut[2][1] = 2.0f * this->y * this->z + 2.0f * this->w * this->x; 47 | 48 | matOut[0][2] = 2.0f * this->x * this->z + 2.0f * this->w * this->y; 49 | matOut[1][2] = 2.0f * this->y * this->z - 2.0f * this->w * this->x; 50 | matOut[2][2] = 1.0f - 2.0f * this->x * this->x - 2.0f * this->y * this->y; 51 | #endif 52 | 53 | matOut[0][3] = vecOrigin.x; 54 | matOut[1][3] = vecOrigin.y; 55 | matOut[2][3] = vecOrigin.z; 56 | return matOut; 57 | } 58 | 59 | float x, y, z, w; 60 | }; 61 | 62 | struct alignas(16) QuaternionAligned_t : Quaternion_t 63 | { 64 | QuaternionAligned_t& operator=(const Quaternion_t& quatOther) 65 | { 66 | this->x = quatOther.x; 67 | this->y = quatOther.y; 68 | this->z = quatOther.z; 69 | this->w = quatOther.w; 70 | return *this; 71 | } 72 | }; 73 | 74 | static_assert(alignof(QuaternionAligned_t) == 16); -------------------------------------------------------------------------------- /dependencies/freetype/include/freetype/ftfntfmt.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * ftfntfmt.h 4 | * 5 | * Support functions for font formats. 6 | * 7 | * Copyright (C) 2002-2019 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef FTFNTFMT_H_ 20 | #define FTFNTFMT_H_ 21 | 22 | #include 23 | #include FT_FREETYPE_H 24 | 25 | #ifdef FREETYPE_H 26 | #error "freetype.h of FreeType 1 has been loaded!" 27 | #error "Please fix the directory search order for header files" 28 | #error "so that freetype.h of FreeType 2 is found first." 29 | #endif 30 | 31 | 32 | FT_BEGIN_HEADER 33 | 34 | 35 | /************************************************************************** 36 | * 37 | * @section: 38 | * font_formats 39 | * 40 | * @title: 41 | * Font Formats 42 | * 43 | * @abstract: 44 | * Getting the font format. 45 | * 46 | * @description: 47 | * The single function in this section can be used to get the font format. 48 | * Note that this information is not needed normally; however, there are 49 | * special cases (like in PDF devices) where it is important to 50 | * differentiate, in spite of FreeType's uniform API. 51 | * 52 | */ 53 | 54 | 55 | /************************************************************************** 56 | * 57 | * @function: 58 | * FT_Get_Font_Format 59 | * 60 | * @description: 61 | * Return a string describing the format of a given face. Possible values 62 | * are 'TrueType', 'Type~1', 'BDF', 'PCF', 'Type~42', 'CID~Type~1', 'CFF', 63 | * 'PFR', and 'Windows~FNT'. 64 | * 65 | * The return value is suitable to be used as an X11 FONT_PROPERTY. 66 | * 67 | * @input: 68 | * face :: 69 | * Input face handle. 70 | * 71 | * @return: 72 | * Font format string. `NULL` in case of error. 73 | * 74 | * @note: 75 | * A deprecated name for the same function is `FT_Get_X11_Font_Format`. 76 | */ 77 | FT_EXPORT( const char* ) 78 | FT_Get_Font_Format( FT_Face face ); 79 | 80 | 81 | /* deprecated */ 82 | FT_EXPORT( const char* ) 83 | FT_Get_X11_Font_Format( FT_Face face ); 84 | 85 | 86 | /* */ 87 | 88 | 89 | FT_END_HEADER 90 | 91 | #endif /* FTFNTFMT_H_ */ 92 | 93 | 94 | /* END */ 95 | -------------------------------------------------------------------------------- /cstrike/sdk/interfaces/ccsgoinput.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // used: mem_pad 4 | #include "../../utilities/memory.h" 5 | 6 | // used: cusercmd 7 | #include "../datatypes/usercmd.h" 8 | 9 | #define MULTIPLAYER_BACKUP 150 10 | 11 | class CTinyMoveStepData 12 | { 13 | public: 14 | float flWhen; //0x0000 15 | MEM_PAD(0x4); //0x0004 16 | std::uint64_t nButton; //0x0008 17 | bool bPressed; //0x0010 18 | MEM_PAD(0x7); //0x0011 19 | }; //Size: 0x0018 20 | 21 | class CMoveStepButtons 22 | { 23 | public: 24 | std::uint64_t nKeyboardPressed; //0x0000 25 | std::uint64_t nMouseWheelheelPressed; //0x0008 26 | std::uint64_t nUnPressed; //0x0010 27 | std::uint64_t nKeyboardCopy; //0x0018 28 | }; //Size: 0x0020 29 | 30 | // @credits: www.unknowncheats.me/forum/members/2943409.html 31 | class CExtendedMoveData : public CMoveStepButtons 32 | { 33 | public: 34 | float flForwardMove; //0x0020 35 | float flSideMove; //0x0024 36 | float flUpMove; //0x0028 37 | std::int32_t nMouseDeltaX; //0x002C 38 | std::int32_t nMouseDeltaY; //0x0030 39 | std::int32_t nAdditionalStepMovesCount; //0x0034 40 | CTinyMoveStepData tinyMoveStepData[12]; //0x0038 41 | Vector_t vecViewAngle; //0x0158 42 | std::int32_t nTargetHandle; //0x0164 43 | }; //Size:0x0168 44 | 45 | class CCSGOInput 46 | { 47 | public: 48 | MEM_PAD(0x250); 49 | CUserCmd arrCommands[MULTIPLAYER_BACKUP]; 50 | MEM_PAD(0x99) 51 | bool bInThirdPerson; 52 | MEM_PAD(0x6); 53 | QAngle_t angThirdPersonAngles; 54 | MEM_PAD(0xE); 55 | std::int32_t nSequenceNumber; 56 | std::int32_t nOldSequenceNumber; 57 | MEM_PAD(0xA); 58 | CExtendedMoveData currentMoveData; 59 | std::int32_t nWeaponSwitchTick; 60 | MEM_PAD(0x8C); 61 | CExtendedMoveData* pExtendedMoveData; 62 | 63 | CUserCmd* GetUserCmd() 64 | { 65 | return &arrCommands[nSequenceNumber % MULTIPLAYER_BACKUP]; 66 | } 67 | 68 | void SetViewAngle(QAngle_t& angView) 69 | { 70 | // @ida: this got called before GetMatricesForView 71 | using fnSetViewAngle = std::int64_t(CS_FASTCALL*)(void*, std::int32_t, QAngle_t&); 72 | static auto oSetViewAngle = reinterpret_cast(MEM::FindPattern(CLIENT_DLL, CS_XOR("85 D2 75 3F 48"))); 73 | 74 | #ifdef CS_PARANOID 75 | CS_ASSERT(oSetViewAngle != nullptr); 76 | #endif 77 | 78 | oSetViewAngle(this, 0, std::ref(angView)); 79 | } 80 | 81 | QAngle_t GetViewAngles() 82 | { 83 | using fnGetViewAngles = std::int64_t(CS_FASTCALL*)(CCSGOInput*, std::int32_t); 84 | static auto oGetViewAngles = reinterpret_cast(MEM::FindPattern(CLIENT_DLL, CS_XOR("4C 8B C1 85 D2 74 08 48 8D 05 ? ? ? ? C3"))); 85 | 86 | #ifdef CS_PARANOID 87 | CS_ASSERT(oGetViewAngles != nullptr); 88 | #endif 89 | 90 | return *reinterpret_cast(oGetViewAngles(this, 0)); 91 | } 92 | }; 93 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | *.h linguist-language=C++ 65 | -------------------------------------------------------------------------------- /dependencies/freetype/include/freetype/internal/services/svttcmap.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * svttcmap.h 4 | * 5 | * The FreeType TrueType/sfnt cmap extra information service. 6 | * 7 | * Copyright (C) 2003-2019 by 8 | * Masatake YAMATO, Redhat K.K., 9 | * David Turner, Robert Wilhelm, and Werner Lemberg. 10 | * 11 | * This file is part of the FreeType project, and may only be used, 12 | * modified, and distributed under the terms of the FreeType project 13 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 14 | * this file you indicate that you have read the license and 15 | * understand and accept it fully. 16 | * 17 | */ 18 | 19 | /* Development of this service is support of 20 | Information-technology Promotion Agency, Japan. */ 21 | 22 | #ifndef SVTTCMAP_H_ 23 | #define SVTTCMAP_H_ 24 | 25 | #include FT_INTERNAL_SERVICE_H 26 | #include FT_TRUETYPE_TABLES_H 27 | 28 | 29 | FT_BEGIN_HEADER 30 | 31 | 32 | #define FT_SERVICE_ID_TT_CMAP "tt-cmaps" 33 | 34 | 35 | /************************************************************************** 36 | * 37 | * @struct: 38 | * TT_CMapInfo 39 | * 40 | * @description: 41 | * A structure used to store TrueType/sfnt specific cmap information 42 | * which is not covered by the generic @FT_CharMap structure. This 43 | * structure can be accessed with the @FT_Get_TT_CMap_Info function. 44 | * 45 | * @fields: 46 | * language :: 47 | * The language ID used in Mac fonts. Definitions of values are in 48 | * `ttnameid.h`. 49 | * 50 | * format :: 51 | * The cmap format. OpenType 1.6 defines the formats 0 (byte encoding 52 | * table), 2~(high-byte mapping through table), 4~(segment mapping to 53 | * delta values), 6~(trimmed table mapping), 8~(mixed 16-bit and 32-bit 54 | * coverage), 10~(trimmed array), 12~(segmented coverage), 13~(last 55 | * resort font), and 14 (Unicode Variation Sequences). 56 | */ 57 | typedef struct TT_CMapInfo_ 58 | { 59 | FT_ULong language; 60 | FT_Long format; 61 | 62 | } TT_CMapInfo; 63 | 64 | 65 | typedef FT_Error 66 | (*TT_CMap_Info_GetFunc)( FT_CharMap charmap, 67 | TT_CMapInfo *cmap_info ); 68 | 69 | 70 | FT_DEFINE_SERVICE( TTCMaps ) 71 | { 72 | TT_CMap_Info_GetFunc get_cmap_info; 73 | }; 74 | 75 | 76 | #define FT_DEFINE_SERVICE_TTCMAPSREC( class_, get_cmap_info_ ) \ 77 | static const FT_Service_TTCMapsRec class_ = \ 78 | { \ 79 | get_cmap_info_ \ 80 | }; 81 | 82 | /* */ 83 | 84 | 85 | FT_END_HEADER 86 | 87 | #endif /* SVTTCMAP_H_ */ 88 | 89 | 90 | /* END */ 91 | -------------------------------------------------------------------------------- /dependencies/freetype/include/freetype/internal/services/svpsinfo.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * svpsinfo.h 4 | * 5 | * The FreeType PostScript info service (specification). 6 | * 7 | * Copyright (C) 2003-2019 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef SVPSINFO_H_ 20 | #define SVPSINFO_H_ 21 | 22 | #include FT_INTERNAL_SERVICE_H 23 | #include FT_INTERNAL_TYPE1_TYPES_H 24 | 25 | 26 | FT_BEGIN_HEADER 27 | 28 | 29 | #define FT_SERVICE_ID_POSTSCRIPT_INFO "postscript-info" 30 | 31 | 32 | typedef FT_Error 33 | (*PS_GetFontInfoFunc)( FT_Face face, 34 | PS_FontInfoRec* afont_info ); 35 | 36 | typedef FT_Error 37 | (*PS_GetFontExtraFunc)( FT_Face face, 38 | PS_FontExtraRec* afont_extra ); 39 | 40 | typedef FT_Int 41 | (*PS_HasGlyphNamesFunc)( FT_Face face ); 42 | 43 | typedef FT_Error 44 | (*PS_GetFontPrivateFunc)( FT_Face face, 45 | PS_PrivateRec* afont_private ); 46 | 47 | typedef FT_Long 48 | (*PS_GetFontValueFunc)( FT_Face face, 49 | PS_Dict_Keys key, 50 | FT_UInt idx, 51 | void *value, 52 | FT_Long value_len ); 53 | 54 | 55 | FT_DEFINE_SERVICE( PsInfo ) 56 | { 57 | PS_GetFontInfoFunc ps_get_font_info; 58 | PS_GetFontExtraFunc ps_get_font_extra; 59 | PS_HasGlyphNamesFunc ps_has_glyph_names; 60 | PS_GetFontPrivateFunc ps_get_font_private; 61 | PS_GetFontValueFunc ps_get_font_value; 62 | }; 63 | 64 | 65 | #define FT_DEFINE_SERVICE_PSINFOREC( class_, \ 66 | get_font_info_, \ 67 | ps_get_font_extra_, \ 68 | has_glyph_names_, \ 69 | get_font_private_, \ 70 | get_font_value_ ) \ 71 | static const FT_Service_PsInfoRec class_ = \ 72 | { \ 73 | get_font_info_, ps_get_font_extra_, has_glyph_names_, \ 74 | get_font_private_, get_font_value_ \ 75 | }; 76 | 77 | /* */ 78 | 79 | 80 | FT_END_HEADER 81 | 82 | 83 | #endif /* SVPSINFO_H_ */ 84 | 85 | 86 | /* END */ 87 | -------------------------------------------------------------------------------- /dependencies/minhook/hde/hde32.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Hacker Disassembler Engine 32 3 | * Copyright (c) 2006-2009, Vyacheslav Patkov. 4 | * All rights reserved. 5 | * 6 | * hde32.h: C/C++ header file 7 | * 8 | */ 9 | 10 | #ifndef _HDE32_H_ 11 | #define _HDE32_H_ 12 | 13 | /* stdint.h - C99 standard header 14 | * http://en.wikipedia.org/wiki/stdint.h 15 | * 16 | * if your compiler doesn't contain "stdint.h" header (for 17 | * example, Microsoft Visual C++), you can download file: 18 | * http://www.azillionmonkeys.com/qed/pstdint.h 19 | * and change next line to: 20 | * #include "pstdint.h" 21 | */ 22 | #include "pstdint.h" 23 | 24 | #define F_MODRM 0x00000001 25 | #define F_SIB 0x00000002 26 | #define F_IMM8 0x00000004 27 | #define F_IMM16 0x00000008 28 | #define F_IMM32 0x00000010 29 | #define F_DISP8 0x00000020 30 | #define F_DISP16 0x00000040 31 | #define F_DISP32 0x00000080 32 | #define F_RELATIVE 0x00000100 33 | #define F_2IMM16 0x00000800 34 | #define F_ERROR 0x00001000 35 | #define F_ERROR_OPCODE 0x00002000 36 | #define F_ERROR_LENGTH 0x00004000 37 | #define F_ERROR_LOCK 0x00008000 38 | #define F_ERROR_OPERAND 0x00010000 39 | #define F_PREFIX_REPNZ 0x01000000 40 | #define F_PREFIX_REPX 0x02000000 41 | #define F_PREFIX_REP 0x03000000 42 | #define F_PREFIX_66 0x04000000 43 | #define F_PREFIX_67 0x08000000 44 | #define F_PREFIX_LOCK 0x10000000 45 | #define F_PREFIX_SEG 0x20000000 46 | #define F_PREFIX_ANY 0x3f000000 47 | 48 | #define PREFIX_SEGMENT_CS 0x2e 49 | #define PREFIX_SEGMENT_SS 0x36 50 | #define PREFIX_SEGMENT_DS 0x3e 51 | #define PREFIX_SEGMENT_ES 0x26 52 | #define PREFIX_SEGMENT_FS 0x64 53 | #define PREFIX_SEGMENT_GS 0x65 54 | #define PREFIX_LOCK 0xf0 55 | #define PREFIX_REPNZ 0xf2 56 | #define PREFIX_REPX 0xf3 57 | #define PREFIX_OPERAND_SIZE 0x66 58 | #define PREFIX_ADDRESS_SIZE 0x67 59 | 60 | #pragma pack(push,1) 61 | 62 | typedef struct { 63 | uint8_t len; 64 | uint8_t p_rep; 65 | uint8_t p_lock; 66 | uint8_t p_seg; 67 | uint8_t p_66; 68 | uint8_t p_67; 69 | uint8_t opcode; 70 | uint8_t opcode2; 71 | uint8_t modrm; 72 | uint8_t modrm_mod; 73 | uint8_t modrm_reg; 74 | uint8_t modrm_rm; 75 | uint8_t sib; 76 | uint8_t sib_scale; 77 | uint8_t sib_index; 78 | uint8_t sib_base; 79 | union { 80 | uint8_t imm8; 81 | uint16_t imm16; 82 | uint32_t imm32; 83 | } imm; 84 | union { 85 | uint8_t disp8; 86 | uint16_t disp16; 87 | uint32_t disp32; 88 | } disp; 89 | uint32_t flags; 90 | } hde32s; 91 | 92 | #pragma pack(pop) 93 | 94 | #ifdef __cplusplus 95 | extern "C" { 96 | #endif 97 | 98 | /* __cdecl */ 99 | unsigned int hde32_disasm(const void* code, hde32s* hs); 100 | 101 | #ifdef __cplusplus 102 | } 103 | #endif 104 | 105 | #endif /* _HDE32_H_ */ 106 | -------------------------------------------------------------------------------- /dependencies/freetype/include/freetype/internal/cffotypes.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * cffotypes.h 4 | * 5 | * Basic OpenType/CFF object type definitions (specification). 6 | * 7 | * Copyright (C) 2017-2019 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef CFFOTYPES_H_ 20 | #define CFFOTYPES_H_ 21 | 22 | #include 23 | #include FT_INTERNAL_OBJECTS_H 24 | #include FT_INTERNAL_CFF_TYPES_H 25 | #include FT_INTERNAL_TRUETYPE_TYPES_H 26 | #include FT_SERVICE_POSTSCRIPT_CMAPS_H 27 | #include FT_INTERNAL_POSTSCRIPT_HINTS_H 28 | 29 | 30 | FT_BEGIN_HEADER 31 | 32 | 33 | typedef TT_Face CFF_Face; 34 | 35 | 36 | /************************************************************************** 37 | * 38 | * @type: 39 | * CFF_Size 40 | * 41 | * @description: 42 | * A handle to an OpenType size object. 43 | */ 44 | typedef struct CFF_SizeRec_ 45 | { 46 | FT_SizeRec root; 47 | FT_ULong strike_index; /* 0xFFFFFFFF to indicate invalid */ 48 | 49 | } CFF_SizeRec, *CFF_Size; 50 | 51 | 52 | /************************************************************************** 53 | * 54 | * @type: 55 | * CFF_GlyphSlot 56 | * 57 | * @description: 58 | * A handle to an OpenType glyph slot object. 59 | */ 60 | typedef struct CFF_GlyphSlotRec_ 61 | { 62 | FT_GlyphSlotRec root; 63 | 64 | FT_Bool hint; 65 | FT_Bool scaled; 66 | 67 | FT_Fixed x_scale; 68 | FT_Fixed y_scale; 69 | 70 | } CFF_GlyphSlotRec, *CFF_GlyphSlot; 71 | 72 | 73 | /************************************************************************** 74 | * 75 | * @type: 76 | * CFF_Internal 77 | * 78 | * @description: 79 | * The interface to the 'internal' field of `FT_Size`. 80 | */ 81 | typedef struct CFF_InternalRec_ 82 | { 83 | PSH_Globals topfont; 84 | PSH_Globals subfonts[CFF_MAX_CID_FONTS]; 85 | 86 | } CFF_InternalRec, *CFF_Internal; 87 | 88 | 89 | /************************************************************************** 90 | * 91 | * Subglyph transformation record. 92 | */ 93 | typedef struct CFF_Transform_ 94 | { 95 | FT_Fixed xx, xy; /* transformation matrix coefficients */ 96 | FT_Fixed yx, yy; 97 | FT_F26Dot6 ox, oy; /* offsets */ 98 | 99 | } CFF_Transform; 100 | 101 | 102 | FT_END_HEADER 103 | 104 | 105 | #endif /* CFFOTYPES_H_ */ 106 | 107 | 108 | /* END */ 109 | -------------------------------------------------------------------------------- /cstrike/core/interfaces.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../common.h" 4 | 5 | // used: globalvariables 6 | #include "../sdk/interfaces/iglobalvars.h" 7 | 8 | #pragma region sdk_definitons 9 | #define GAME_RESOURCE_SERVICE_CLIENT CS_XOR("GameResourceServiceClientV00") 10 | #define SOURCE2_CLIENT CS_XOR("Source2Client00") 11 | #define SCHEMA_SYSTEM CS_XOR("SchemaSystem_00") 12 | #define INPUT_SYSTEM_VERSION CS_XOR("InputSystemVersion00") 13 | #define SOURCE2_ENGINE_TO_CLIENT CS_XOR("Source2EngineToClient00") 14 | #define ENGINE_CVAR CS_XOR("VEngineCvar00") 15 | #define LOCALIZE CS_XOR("Localize_00") 16 | #define NETWORK_CLIENT_SERVICE CS_XOR("NetworkClientService_00") 17 | #define MATERIAL_SYSTEM2 CS_XOR("VMaterialSystem2_00") 18 | #define RESOURCE_SYSTEM CS_XOR("ResourceSystem013") 19 | #define RESOURCE_HANDLE_UTILS CS_XOR("ResourceHandleUtils001") 20 | 21 | // @source: master/game/shared/shareddefs.h 22 | #define TICK_INTERVAL 0.015625f 23 | #define TIME_TO_TICKS(TIME) (static_cast(0.5f + static_cast(TIME) / TICK_INTERVAL)) 24 | #define TICKS_TO_TIME(TICKS) (TICK_INTERVAL * static_cast(TICKS)) 25 | #define ROUND_TO_TICKS(TIME) (TICK_INTERVAL * TIME_TO_TICKS(TIME)) 26 | #define TICK_NEVER_THINK (-1) 27 | #pragma endregion 28 | 29 | // game interfaces 30 | class ISwapChainDx11; 31 | class IMemAlloc; 32 | class CCSGOInput; 33 | class ISchemaSystem; 34 | class IInputSystem; 35 | class IGameResourceService; 36 | class ISource2Client; 37 | class IEngineClient; 38 | class IEngineCVar; 39 | class INetworkClientService; 40 | class IMaterialSystem2; 41 | class IResourceSystem; 42 | class CResourceHandleUtils; 43 | class CPVS; 44 | class CGameTraceManager; 45 | 46 | // [d3d] struct 47 | struct ID3D11Device; 48 | struct ID3D11DeviceContext; 49 | struct ID3D11RenderTargetView; 50 | 51 | namespace I 52 | { 53 | bool Setup(); 54 | 55 | /* @section: helpers */ 56 | // create and destroy render target view for handling resize 57 | void CreateRenderTarget(); 58 | void DestroyRenderTarget(); 59 | 60 | inline IMemAlloc* MemAlloc = nullptr; 61 | inline ISwapChainDx11* SwapChain = nullptr; 62 | inline ID3D11Device* Device = nullptr; 63 | inline ID3D11DeviceContext* DeviceContext = nullptr; 64 | inline ID3D11RenderTargetView* RenderTargetView = nullptr; 65 | inline CCSGOInput* Input = nullptr; 66 | inline ISchemaSystem* SchemaSystem = nullptr; 67 | inline IGlobalVars* GlobalVars = nullptr; 68 | inline IInputSystem* InputSystem = nullptr; 69 | inline IGameResourceService* GameResourceService = nullptr; 70 | inline ISource2Client* Client = nullptr; 71 | inline IEngineClient* Engine = nullptr; 72 | inline IEngineCVar* Cvar = nullptr; 73 | inline INetworkClientService* NetworkClientService = nullptr; 74 | inline IMaterialSystem2* MaterialSystem2 = nullptr; 75 | inline IResourceSystem* ResourceSystem = nullptr; 76 | inline CResourceHandleUtils* ResourceHandleUtils = nullptr; 77 | inline CPVS* PVS = nullptr; 78 | inline CGameTraceManager* GameTraceManager = nullptr; 79 | } 80 | -------------------------------------------------------------------------------- /dependencies/freetype/include/freetype/internal/internal.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * internal.h 4 | * 5 | * Internal header files (specification only). 6 | * 7 | * Copyright (C) 1996-2019 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | /************************************************************************** 20 | * 21 | * This file is automatically included by `ft2build.h`. Do not include it 22 | * manually! 23 | * 24 | */ 25 | 26 | 27 | #define FT_INTERNAL_OBJECTS_H 28 | #define FT_INTERNAL_STREAM_H 29 | #define FT_INTERNAL_MEMORY_H 30 | #define FT_INTERNAL_DEBUG_H 31 | #define FT_INTERNAL_CALC_H 32 | #define FT_INTERNAL_HASH_H 33 | #define FT_INTERNAL_DRIVER_H 34 | #define FT_INTERNAL_TRACE_H 35 | #define FT_INTERNAL_GLYPH_LOADER_H 36 | #define FT_INTERNAL_SFNT_H 37 | #define FT_INTERNAL_SERVICE_H 38 | #define FT_INTERNAL_RFORK_H 39 | #define FT_INTERNAL_VALIDATE_H 40 | 41 | #define FT_INTERNAL_TRUETYPE_TYPES_H 42 | #define FT_INTERNAL_TYPE1_TYPES_H 43 | 44 | #define FT_INTERNAL_POSTSCRIPT_AUX_H 45 | #define FT_INTERNAL_POSTSCRIPT_HINTS_H 46 | #define FT_INTERNAL_POSTSCRIPT_PROPS_H 47 | 48 | #define FT_INTERNAL_AUTOHINT_H 49 | 50 | #define FT_INTERNAL_CFF_TYPES_H 51 | #define FT_INTERNAL_CFF_OBJECTS_TYPES_H 52 | 53 | 54 | #if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */ 55 | 56 | /* We disable the warning `conditional expression is constant' here */ 57 | /* in order to compile cleanly with the maximum level of warnings. */ 58 | /* In particular, the warning complains about stuff like `while(0)' */ 59 | /* which is very useful in macro definitions. There is no benefit */ 60 | /* in having it enabled. */ 61 | #pragma warning( disable : 4127 ) 62 | 63 | #endif /* _MSC_VER */ 64 | 65 | 66 | /* END */ 67 | -------------------------------------------------------------------------------- /dependencies/minhook/hde/hde64.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Hacker Disassembler Engine 64 3 | * Copyright (c) 2008-2009, Vyacheslav Patkov. 4 | * All rights reserved. 5 | * 6 | * hde64.h: C/C++ header file 7 | * 8 | */ 9 | 10 | #ifndef _HDE64_H_ 11 | #define _HDE64_H_ 12 | 13 | /* stdint.h - C99 standard header 14 | * http://en.wikipedia.org/wiki/stdint.h 15 | * 16 | * if your compiler doesn't contain "stdint.h" header (for 17 | * example, Microsoft Visual C++), you can download file: 18 | * http://www.azillionmonkeys.com/qed/pstdint.h 19 | * and change next line to: 20 | * #include "pstdint.h" 21 | */ 22 | #include "pstdint.h" 23 | 24 | #define F_MODRM 0x00000001 25 | #define F_SIB 0x00000002 26 | #define F_IMM8 0x00000004 27 | #define F_IMM16 0x00000008 28 | #define F_IMM32 0x00000010 29 | #define F_IMM64 0x00000020 30 | #define F_DISP8 0x00000040 31 | #define F_DISP16 0x00000080 32 | #define F_DISP32 0x00000100 33 | #define F_RELATIVE 0x00000200 34 | #define F_ERROR 0x00001000 35 | #define F_ERROR_OPCODE 0x00002000 36 | #define F_ERROR_LENGTH 0x00004000 37 | #define F_ERROR_LOCK 0x00008000 38 | #define F_ERROR_OPERAND 0x00010000 39 | #define F_PREFIX_REPNZ 0x01000000 40 | #define F_PREFIX_REPX 0x02000000 41 | #define F_PREFIX_REP 0x03000000 42 | #define F_PREFIX_66 0x04000000 43 | #define F_PREFIX_67 0x08000000 44 | #define F_PREFIX_LOCK 0x10000000 45 | #define F_PREFIX_SEG 0x20000000 46 | #define F_PREFIX_REX 0x40000000 47 | #define F_PREFIX_ANY 0x7f000000 48 | 49 | #define PREFIX_SEGMENT_CS 0x2e 50 | #define PREFIX_SEGMENT_SS 0x36 51 | #define PREFIX_SEGMENT_DS 0x3e 52 | #define PREFIX_SEGMENT_ES 0x26 53 | #define PREFIX_SEGMENT_FS 0x64 54 | #define PREFIX_SEGMENT_GS 0x65 55 | #define PREFIX_LOCK 0xf0 56 | #define PREFIX_REPNZ 0xf2 57 | #define PREFIX_REPX 0xf3 58 | #define PREFIX_OPERAND_SIZE 0x66 59 | #define PREFIX_ADDRESS_SIZE 0x67 60 | 61 | #pragma pack(push,1) 62 | 63 | typedef struct { 64 | uint8_t len; 65 | uint8_t p_rep; 66 | uint8_t p_lock; 67 | uint8_t p_seg; 68 | uint8_t p_66; 69 | uint8_t p_67; 70 | uint8_t rex; 71 | uint8_t rex_w; 72 | uint8_t rex_r; 73 | uint8_t rex_x; 74 | uint8_t rex_b; 75 | uint8_t opcode; 76 | uint8_t opcode2; 77 | uint8_t modrm; 78 | uint8_t modrm_mod; 79 | uint8_t modrm_reg; 80 | uint8_t modrm_rm; 81 | uint8_t sib; 82 | uint8_t sib_scale; 83 | uint8_t sib_index; 84 | uint8_t sib_base; 85 | union { 86 | uint8_t imm8; 87 | uint16_t imm16; 88 | uint32_t imm32; 89 | uint64_t imm64; 90 | } imm; 91 | union { 92 | uint8_t disp8; 93 | uint16_t disp16; 94 | uint32_t disp32; 95 | } disp; 96 | uint32_t flags; 97 | } hde64s; 98 | 99 | #pragma pack(pop) 100 | 101 | #ifdef __cplusplus 102 | extern "C" { 103 | #endif 104 | 105 | /* __cdecl */ 106 | unsigned int hde64_disasm(const void* code, hde64s* hs); 107 | 108 | #ifdef __cplusplus 109 | } 110 | #endif 111 | 112 | #endif /* _HDE64_H_ */ 113 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | # Default parameters 5 | indent_style = tab 6 | indent_size = 4 7 | end_of_line = lf 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [*.{c,cc,cpp,cppm,cxx,h,hh,hpp,hxx,inl,ipp,ixx,tlh,tli,hlsl,hlsli}] 12 | 13 | # Code style parameters Visual C++ 14 | cpp_generate_documentation_comments = doxygen_triple_slash 15 | 16 | # Formatting parameters Visual C++ 17 | cpp_indent_braces = false 18 | cpp_indent_multi_line_relative_to = innermost_parenthesis 19 | cpp_indent_within_parentheses = indent 20 | cpp_indent_preserve_within_parentheses = true 21 | cpp_indent_case_contents = true 22 | cpp_indent_case_labels = false 23 | cpp_indent_case_contents_when_block = false 24 | cpp_indent_lambda_braces_when_parameter = true 25 | cpp_indent_goto_labels = one_left 26 | cpp_indent_preprocessor = leftmost_column 27 | cpp_indent_access_specifiers = false 28 | cpp_indent_namespace_contents = true 29 | cpp_indent_preserve_comments = false 30 | cpp_new_line_before_open_brace_namespace = new_line 31 | cpp_new_line_before_open_brace_type = new_line 32 | cpp_new_line_before_open_brace_function = new_line 33 | cpp_new_line_before_open_brace_block = new_line 34 | cpp_new_line_before_open_brace_lambda = ignore 35 | cpp_new_line_scope_braces_on_separate_lines = true 36 | cpp_new_line_close_brace_same_line_empty_type = true 37 | cpp_new_line_close_brace_same_line_empty_function = true 38 | cpp_new_line_before_catch = true 39 | cpp_new_line_before_else = true 40 | cpp_new_line_before_while_in_do_while = false 41 | cpp_space_before_function_open_parenthesis = remove 42 | cpp_space_within_parameter_list_parentheses = false 43 | cpp_space_between_empty_parameter_list_parentheses = false 44 | cpp_space_after_keywords_in_control_flow_statements = true 45 | cpp_space_within_control_flow_statement_parentheses = false 46 | cpp_space_before_lambda_open_parenthesis = false 47 | cpp_space_within_cast_parentheses = false 48 | cpp_space_after_cast_close_parenthesis = false 49 | cpp_space_within_expression_parentheses = false 50 | cpp_space_before_block_open_brace = true 51 | cpp_space_between_empty_braces = true 52 | cpp_space_before_initializer_list_open_brace = false 53 | cpp_space_within_initializer_list_braces = true 54 | cpp_space_preserve_in_initializer_list = true 55 | cpp_space_before_open_square_bracket = false 56 | cpp_space_within_square_brackets = false 57 | cpp_space_before_empty_square_brackets = false 58 | cpp_space_between_empty_square_brackets = true 59 | cpp_space_group_square_brackets = true 60 | cpp_space_within_lambda_brackets = false 61 | cpp_space_between_empty_lambda_brackets = true 62 | cpp_space_before_comma = false 63 | cpp_space_after_comma = true 64 | cpp_space_remove_around_member_operators = true 65 | cpp_space_before_inheritance_colon = true 66 | cpp_space_before_constructor_colon = true 67 | cpp_space_remove_before_semicolon = true 68 | cpp_space_after_semicolon = true 69 | cpp_space_remove_around_unary_operator = true 70 | cpp_space_around_binary_operator = insert 71 | cpp_space_around_assignment_operator = insert 72 | cpp_space_pointer_reference_alignment = left 73 | cpp_space_around_ternary_operator = insert 74 | cpp_wrap_preserve_blocks = one_liners 75 | -------------------------------------------------------------------------------- /dependencies/freetype/include/freetype/ftbbox.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * ftbbox.h 4 | * 5 | * FreeType exact bbox computation (specification). 6 | * 7 | * Copyright (C) 1996-2019 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | /************************************************************************** 20 | * 21 | * This component has a _single_ role: to compute exact outline bounding 22 | * boxes. 23 | * 24 | * It is separated from the rest of the engine for various technical 25 | * reasons. It may well be integrated in 'ftoutln' later. 26 | * 27 | */ 28 | 29 | 30 | #ifndef FTBBOX_H_ 31 | #define FTBBOX_H_ 32 | 33 | 34 | #include 35 | #include FT_FREETYPE_H 36 | 37 | #ifdef FREETYPE_H 38 | #error "freetype.h of FreeType 1 has been loaded!" 39 | #error "Please fix the directory search order for header files" 40 | #error "so that freetype.h of FreeType 2 is found first." 41 | #endif 42 | 43 | 44 | FT_BEGIN_HEADER 45 | 46 | 47 | /************************************************************************** 48 | * 49 | * @section: 50 | * outline_processing 51 | * 52 | */ 53 | 54 | 55 | /************************************************************************** 56 | * 57 | * @function: 58 | * FT_Outline_Get_BBox 59 | * 60 | * @description: 61 | * Compute the exact bounding box of an outline. This is slower than 62 | * computing the control box. However, it uses an advanced algorithm 63 | * that returns _very_ quickly when the two boxes coincide. Otherwise, 64 | * the outline Bezier arcs are traversed to extract their extrema. 65 | * 66 | * @input: 67 | * outline :: 68 | * A pointer to the source outline. 69 | * 70 | * @output: 71 | * abbox :: 72 | * The outline's exact bounding box. 73 | * 74 | * @return: 75 | * FreeType error code. 0~means success. 76 | * 77 | * @note: 78 | * If the font is tricky and the glyph has been loaded with 79 | * @FT_LOAD_NO_SCALE, the resulting BBox is meaningless. To get 80 | * reasonable values for the BBox it is necessary to load the glyph at a 81 | * large ppem value (so that the hinting instructions can properly shift 82 | * and scale the subglyphs), then extracting the BBox, which can be 83 | * eventually converted back to font units. 84 | */ 85 | FT_EXPORT( FT_Error ) 86 | FT_Outline_Get_BBox( FT_Outline* outline, 87 | FT_BBox *abbox ); 88 | 89 | /* */ 90 | 91 | 92 | FT_END_HEADER 93 | 94 | #endif /* FTBBOX_H_ */ 95 | 96 | 97 | /* END */ 98 | 99 | 100 | /* Local Variables: */ 101 | /* coding: utf-8 */ 102 | /* End: */ 103 | -------------------------------------------------------------------------------- /dependencies/freetype/include/freetype/internal/services/svcfftl.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * svcfftl.h 4 | * 5 | * The FreeType CFF tables loader service (specification). 6 | * 7 | * Copyright (C) 2017-2019 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef SVCFFTL_H_ 20 | #define SVCFFTL_H_ 21 | 22 | #include FT_INTERNAL_SERVICE_H 23 | #include FT_INTERNAL_CFF_TYPES_H 24 | 25 | 26 | FT_BEGIN_HEADER 27 | 28 | 29 | #define FT_SERVICE_ID_CFF_LOAD "cff-load" 30 | 31 | 32 | typedef FT_UShort 33 | (*FT_Get_Standard_Encoding_Func)( FT_UInt charcode ); 34 | 35 | typedef FT_Error 36 | (*FT_Load_Private_Dict_Func)( CFF_Font font, 37 | CFF_SubFont subfont, 38 | FT_UInt lenNDV, 39 | FT_Fixed* NDV ); 40 | 41 | typedef FT_Byte 42 | (*FT_FD_Select_Get_Func)( CFF_FDSelect fdselect, 43 | FT_UInt glyph_index ); 44 | 45 | typedef FT_Bool 46 | (*FT_Blend_Check_Vector_Func)( CFF_Blend blend, 47 | FT_UInt vsindex, 48 | FT_UInt lenNDV, 49 | FT_Fixed* NDV ); 50 | 51 | typedef FT_Error 52 | (*FT_Blend_Build_Vector_Func)( CFF_Blend blend, 53 | FT_UInt vsindex, 54 | FT_UInt lenNDV, 55 | FT_Fixed* NDV ); 56 | 57 | 58 | FT_DEFINE_SERVICE( CFFLoad ) 59 | { 60 | FT_Get_Standard_Encoding_Func get_standard_encoding; 61 | FT_Load_Private_Dict_Func load_private_dict; 62 | FT_FD_Select_Get_Func fd_select_get; 63 | FT_Blend_Check_Vector_Func blend_check_vector; 64 | FT_Blend_Build_Vector_Func blend_build_vector; 65 | }; 66 | 67 | 68 | #define FT_DEFINE_SERVICE_CFFLOADREC( class_, \ 69 | get_standard_encoding_, \ 70 | load_private_dict_, \ 71 | fd_select_get_, \ 72 | blend_check_vector_, \ 73 | blend_build_vector_ ) \ 74 | static const FT_Service_CFFLoadRec class_ = \ 75 | { \ 76 | get_standard_encoding_, \ 77 | load_private_dict_, \ 78 | fd_select_get_, \ 79 | blend_check_vector_, \ 80 | blend_build_vector_ \ 81 | }; 82 | 83 | 84 | FT_END_HEADER 85 | 86 | 87 | #endif 88 | 89 | 90 | /* END */ 91 | -------------------------------------------------------------------------------- /dependencies/freetype/include/freetype/ftlzw.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * ftlzw.h 4 | * 5 | * LZW-compressed stream support. 6 | * 7 | * Copyright (C) 2004-2019 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef FTLZW_H_ 20 | #define FTLZW_H_ 21 | 22 | #include 23 | #include FT_FREETYPE_H 24 | 25 | #ifdef FREETYPE_H 26 | #error "freetype.h of FreeType 1 has been loaded!" 27 | #error "Please fix the directory search order for header files" 28 | #error "so that freetype.h of FreeType 2 is found first." 29 | #endif 30 | 31 | 32 | FT_BEGIN_HEADER 33 | 34 | /************************************************************************** 35 | * 36 | * @section: 37 | * lzw 38 | * 39 | * @title: 40 | * LZW Streams 41 | * 42 | * @abstract: 43 | * Using LZW-compressed font files. 44 | * 45 | * @description: 46 | * This section contains the declaration of LZW-specific functions. 47 | * 48 | */ 49 | 50 | /************************************************************************** 51 | * 52 | * @function: 53 | * FT_Stream_OpenLZW 54 | * 55 | * @description: 56 | * Open a new stream to parse LZW-compressed font files. This is mainly 57 | * used to support the compressed `*.pcf.Z` fonts that come with XFree86. 58 | * 59 | * @input: 60 | * stream :: 61 | * The target embedding stream. 62 | * 63 | * source :: 64 | * The source stream. 65 | * 66 | * @return: 67 | * FreeType error code. 0~means success. 68 | * 69 | * @note: 70 | * The source stream must be opened _before_ calling this function. 71 | * 72 | * Calling the internal function `FT_Stream_Close` on the new stream will 73 | * **not** call `FT_Stream_Close` on the source stream. None of the 74 | * stream objects will be released to the heap. 75 | * 76 | * The stream implementation is very basic and resets the decompression 77 | * process each time seeking backwards is needed within the stream 78 | * 79 | * In certain builds of the library, LZW compression recognition is 80 | * automatically handled when calling @FT_New_Face or @FT_Open_Face. 81 | * This means that if no font driver is capable of handling the raw 82 | * compressed file, the library will try to open a LZW stream from it and 83 | * re-open the face with it. 84 | * 85 | * This function may return `FT_Err_Unimplemented_Feature` if your build 86 | * of FreeType was not compiled with LZW support. 87 | */ 88 | FT_EXPORT( FT_Error ) 89 | FT_Stream_OpenLZW( FT_Stream stream, 90 | FT_Stream source ); 91 | 92 | /* */ 93 | 94 | 95 | FT_END_HEADER 96 | 97 | #endif /* FTLZW_H_ */ 98 | 99 | 100 | /* END */ 101 | -------------------------------------------------------------------------------- /dependencies/freetype/include/freetype/ftbzip2.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * ftbzip2.h 4 | * 5 | * Bzip2-compressed stream support. 6 | * 7 | * Copyright (C) 2010-2019 by 8 | * Joel Klinghed. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef FTBZIP2_H_ 20 | #define FTBZIP2_H_ 21 | 22 | #include 23 | #include FT_FREETYPE_H 24 | 25 | #ifdef FREETYPE_H 26 | #error "freetype.h of FreeType 1 has been loaded!" 27 | #error "Please fix the directory search order for header files" 28 | #error "so that freetype.h of FreeType 2 is found first." 29 | #endif 30 | 31 | 32 | FT_BEGIN_HEADER 33 | 34 | /************************************************************************** 35 | * 36 | * @section: 37 | * bzip2 38 | * 39 | * @title: 40 | * BZIP2 Streams 41 | * 42 | * @abstract: 43 | * Using bzip2-compressed font files. 44 | * 45 | * @description: 46 | * This section contains the declaration of Bzip2-specific functions. 47 | * 48 | */ 49 | 50 | 51 | /************************************************************************** 52 | * 53 | * @function: 54 | * FT_Stream_OpenBzip2 55 | * 56 | * @description: 57 | * Open a new stream to parse bzip2-compressed font files. This is 58 | * mainly used to support the compressed `*.pcf.bz2` fonts that come with 59 | * XFree86. 60 | * 61 | * @input: 62 | * stream :: 63 | * The target embedding stream. 64 | * 65 | * source :: 66 | * The source stream. 67 | * 68 | * @return: 69 | * FreeType error code. 0~means success. 70 | * 71 | * @note: 72 | * The source stream must be opened _before_ calling this function. 73 | * 74 | * Calling the internal function `FT_Stream_Close` on the new stream will 75 | * **not** call `FT_Stream_Close` on the source stream. None of the 76 | * stream objects will be released to the heap. 77 | * 78 | * The stream implementation is very basic and resets the decompression 79 | * process each time seeking backwards is needed within the stream. 80 | * 81 | * In certain builds of the library, bzip2 compression recognition is 82 | * automatically handled when calling @FT_New_Face or @FT_Open_Face. 83 | * This means that if no font driver is capable of handling the raw 84 | * compressed file, the library will try to open a bzip2 compressed 85 | * stream from it and re-open the face with it. 86 | * 87 | * This function may return `FT_Err_Unimplemented_Feature` if your build 88 | * of FreeType was not compiled with bzip2 support. 89 | */ 90 | FT_EXPORT( FT_Error ) 91 | FT_Stream_OpenBzip2( FT_Stream stream, 92 | FT_Stream source ); 93 | 94 | /* */ 95 | 96 | 97 | FT_END_HEADER 98 | 99 | #endif /* FTBZIP2_H_ */ 100 | 101 | 102 | /* END */ 103 | -------------------------------------------------------------------------------- /cstrike/sdk/datatypes/utlmap.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "utlrbtree.h" 3 | 4 | // @source: master/public/tier1/utlmap.h 5 | 6 | template 7 | class CUtlMap 8 | { 9 | public: 10 | using KeyType_t = K; 11 | using ElementType_t = T; 12 | using IndexType_t = I; 13 | 14 | CUtlMap(int nGrowSize = 0, int nInitialSize = 0, const LessCallbackFn_t& fnLessCallback = nullptr) : 15 | tree(nGrowSize, nInitialSize, CKeyLess(fnLessCallback)) { } 16 | 17 | CUtlMap(LessCallbackFn_t fnLessCallback) : 18 | tree(CKeyLess(fnLessCallback)) { } 19 | 20 | [[nodiscard]] ElementType_t& operator[](IndexType_t nIndex) 21 | { 22 | return tree.Element(nIndex).nElement; 23 | } 24 | 25 | [[nodiscard]] const ElementType_t& operator[](IndexType_t nIndex) const 26 | { 27 | return tree.Element(nIndex).nElement; 28 | } 29 | 30 | [[nodiscard]] ElementType_t& Element(IndexType_t nIndex) 31 | { 32 | return tree.Element(nIndex).nElement; 33 | } 34 | 35 | [[nodiscard]] const ElementType_t& Element(IndexType_t nIndex) const 36 | { 37 | return tree.Element(nIndex).nElement; 38 | } 39 | 40 | [[nodiscard]] KeyType_t& Key(IndexType_t nIndex) 41 | { 42 | return tree.Element(nIndex).key; 43 | } 44 | 45 | [[nodiscard]] const KeyType_t& Key(IndexType_t nIndex) const 46 | { 47 | return tree.Element(nIndex).key; 48 | } 49 | 50 | [[nodiscard]] unsigned int Count() const 51 | { 52 | return tree.Count(); 53 | } 54 | 55 | [[nodiscard]] IndexType_t MaxElement() const 56 | { 57 | return tree.MaxElement(); 58 | } 59 | 60 | [[nodiscard]] bool IsValidIndex(IndexType_t nIndex) const 61 | { 62 | return tree.IsValidIndex(nIndex); 63 | } 64 | 65 | [[nodiscard]] bool IsValid() const 66 | { 67 | return tree.IsValid(); 68 | } 69 | 70 | [[nodiscard]] static IndexType_t InvalidIndex() 71 | { 72 | return CUtlRBTree::InvalidIndex(); 73 | } 74 | 75 | void EnsureCapacity(const int nCapacity) 76 | { 77 | tree.EnsureCapacity(nCapacity); 78 | } 79 | 80 | [[nodiscard]] IndexType_t Find(const KeyType_t& key) const 81 | { 82 | Node_t dummyNode; 83 | dummyNode.key = key; 84 | return tree.Find(dummyNode); 85 | } 86 | 87 | void RemoveAt(IndexType_t nIndex) 88 | { 89 | tree.RemoveAt(nIndex); 90 | } 91 | 92 | bool Remove(const KeyType_t& key) 93 | { 94 | Node_t dummyNode = { key }; 95 | return tree.Remove(dummyNode); 96 | } 97 | 98 | void RemoveAll() 99 | { 100 | tree.RemoveAll(); 101 | } 102 | 103 | void Purge() 104 | { 105 | tree.Purge(); 106 | } 107 | 108 | struct Node_t 109 | { 110 | KeyType_t key; 111 | ElementType_t nElement; 112 | }; 113 | 114 | class CKeyLess 115 | { 116 | public: 117 | CKeyLess(const LessCallbackFn_t& fnLessCallback) : 118 | fnLessCallback(fnLessCallback) { } 119 | 120 | bool operator!() const 121 | { 122 | return !fnLessCallback; 123 | } 124 | 125 | bool operator()(const Node_t& left, const Node_t& right) const 126 | { 127 | return fnLessCallback(left.key, right.key); 128 | } 129 | 130 | LessCallbackFn_t fnLessCallback; 131 | }; 132 | 133 | protected: 134 | CUtlRBTree tree; // 0x00 135 | }; -------------------------------------------------------------------------------- /dependencies/freetype/include/freetype/ftchapters.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * This file defines the structure of the FreeType reference. 4 | * It is used by the python script that generates the HTML files. 5 | * 6 | */ 7 | 8 | 9 | /************************************************************************** 10 | * 11 | * @chapter: 12 | * general_remarks 13 | * 14 | * @title: 15 | * General Remarks 16 | * 17 | * @sections: 18 | * header_inclusion 19 | * user_allocation 20 | * 21 | */ 22 | 23 | 24 | /************************************************************************** 25 | * 26 | * @chapter: 27 | * core_api 28 | * 29 | * @title: 30 | * Core API 31 | * 32 | * @sections: 33 | * version 34 | * basic_types 35 | * base_interface 36 | * glyph_variants 37 | * color_management 38 | * layer_management 39 | * glyph_management 40 | * mac_specific 41 | * sizes_management 42 | * header_file_macros 43 | * 44 | */ 45 | 46 | 47 | /************************************************************************** 48 | * 49 | * @chapter: 50 | * format_specific 51 | * 52 | * @title: 53 | * Format-Specific API 54 | * 55 | * @sections: 56 | * multiple_masters 57 | * truetype_tables 58 | * type1_tables 59 | * sfnt_names 60 | * bdf_fonts 61 | * cid_fonts 62 | * pfr_fonts 63 | * winfnt_fonts 64 | * font_formats 65 | * gasp_table 66 | * 67 | */ 68 | 69 | 70 | /************************************************************************** 71 | * 72 | * @chapter: 73 | * module_specific 74 | * 75 | * @title: 76 | * Controlling FreeType Modules 77 | * 78 | * @sections: 79 | * auto_hinter 80 | * cff_driver 81 | * t1_cid_driver 82 | * tt_driver 83 | * pcf_driver 84 | * properties 85 | * parameter_tags 86 | * lcd_rendering 87 | * 88 | */ 89 | 90 | 91 | /************************************************************************** 92 | * 93 | * @chapter: 94 | * cache_subsystem 95 | * 96 | * @title: 97 | * Cache Sub-System 98 | * 99 | * @sections: 100 | * cache_subsystem 101 | * 102 | */ 103 | 104 | 105 | /************************************************************************** 106 | * 107 | * @chapter: 108 | * support_api 109 | * 110 | * @title: 111 | * Support API 112 | * 113 | * @sections: 114 | * computations 115 | * list_processing 116 | * outline_processing 117 | * quick_advance 118 | * bitmap_handling 119 | * raster 120 | * glyph_stroker 121 | * system_interface 122 | * module_management 123 | * gzip 124 | * lzw 125 | * bzip2 126 | * 127 | */ 128 | 129 | 130 | /************************************************************************** 131 | * 132 | * @chapter: 133 | * error_codes 134 | * 135 | * @title: 136 | * Error Codes 137 | * 138 | * @sections: 139 | * error_enumerations 140 | * error_code_values 141 | * 142 | */ 143 | 144 | 145 | /* END */ 146 | -------------------------------------------------------------------------------- /dependencies/imgui/imgui_impl_win32.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Platform Backend for Windows (standard windows API for 32-bits AND 64-bits applications) 2 | // This needs to be used along with a Renderer (e.g. DirectX11, OpenGL3, Vulkan..) 3 | 4 | // Implemented features: 5 | // [X] Platform: Clipboard support (for Win32 this is actually part of core dear imgui) 6 | // [X] Platform: Mouse support. Can discriminate Mouse/TouchScreen/Pen. 7 | // [X] Platform: Keyboard support. Since 1.87 we are using the io.AddKeyEvent() function. Pass ImGuiKey values to all key functions e.g. ImGui::IsKeyPressed(ImGuiKey_Space). [Legacy VK_* values will also be supported unless IMGUI_DISABLE_OBSOLETE_KEYIO is set] 8 | // [X] Platform: Gamepad support. Enabled with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'. 9 | // [X] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'. 10 | 11 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 12 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 13 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 14 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 15 | 16 | #pragma once 17 | #include "imgui.h" // IMGUI_IMPL_API 18 | #ifndef IMGUI_DISABLE 19 | 20 | IMGUI_IMPL_API bool ImGui_ImplWin32_Init(void* hwnd); 21 | IMGUI_IMPL_API bool ImGui_ImplWin32_InitForOpenGL(void* hwnd); 22 | IMGUI_IMPL_API void ImGui_ImplWin32_Shutdown(); 23 | IMGUI_IMPL_API void ImGui_ImplWin32_NewFrame(); 24 | 25 | // Win32 message handler your application need to call. 26 | // - Intentionally commented out in a '#if 0' block to avoid dragging dependencies on from this helper. 27 | // - You should COPY the line below into your .cpp code to forward declare the function and then you can call it. 28 | // - Call from your application's message handler. Keep calling your message handler unless this function returns TRUE. 29 | 30 | #if 0 31 | extern IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); 32 | #endif 33 | 34 | // DPI-related helpers (optional) 35 | // - Use to enable DPI awareness without having to create an application manifest. 36 | // - Your own app may already do this via a manifest or explicit calls. This is mostly useful for our examples/ apps. 37 | // - In theory we could call simple functions from Windows SDK such as SetProcessDPIAware(), SetProcessDpiAwareness(), etc. 38 | // but most of the functions provided by Microsoft require Windows 8.1/10+ SDK at compile time and Windows 8/10+ at runtime, 39 | // neither we want to require the user to have. So we dynamically select and load those functions to avoid dependencies. 40 | IMGUI_IMPL_API void ImGui_ImplWin32_EnableDpiAwareness(); 41 | IMGUI_IMPL_API float ImGui_ImplWin32_GetDpiScaleForHwnd(void* hwnd); // HWND hwnd 42 | IMGUI_IMPL_API float ImGui_ImplWin32_GetDpiScaleForMonitor(void* monitor); // HMONITOR monitor 43 | 44 | // Transparency related helpers (optional) [experimental] 45 | // - Use to enable alpha compositing transparency with the desktop. 46 | // - Use together with e.g. clearing your framebuffer with zero-alpha. 47 | IMGUI_IMPL_API void ImGui_ImplWin32_EnableAlphaCompositing(void* hwnd); // HWND hwnd 48 | 49 | #endif // #ifndef IMGUI_DISABLE 50 | -------------------------------------------------------------------------------- /cstrike/utilities/math.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../common.h" 4 | // used: std::is_integral_v 5 | #include 6 | // used: sin, cos, pow, abs, sqrt 7 | #include // used: MATH::Sin, cos, MATH::Pow, abs, sqrt 8 | // used: rand, srand 9 | #include 10 | // used: time 11 | #include 12 | 13 | // convert angle in degrees to radians 14 | #define M_DEG2RAD(DEGREES) ((DEGREES) * (MATH::_PI / 180.f)) 15 | // convert angle in radians to degrees 16 | #define M_RAD2DEG(RADIANS) ((RADIANS) * (180.f / MATH::_PI)) 17 | /// linearly interpolate the value between @a'X0' and @a'X1' by @a'FACTOR' 18 | #define M_LERP(X0, X1, FACTOR) ((X0) + ((X1) - (X0)) * (FACTOR)) 19 | /// trigonometry 20 | #define M_COS(ANGLE) cos(ANGLE) 21 | #define M_SIN(ANGLE) sin(ANGLE) 22 | #define M_TAN(ANGLE) tan(ANGLE) 23 | /// power 24 | #define M_POW(BASE, EXPONENT) pow(BASE, EXPONENT) 25 | /// absolute value 26 | #define M_ABS(VALUE) abs(VALUE) 27 | /// square root 28 | #define M_SQRT(VALUE) sqrt(VALUE) 29 | /// floor 30 | #define M_FLOOR(VALUE) floor(VALUE) 31 | 32 | /* 33 | * MATHEMATICS 34 | * - basic trigonometry, algebraic mathematical functions and constants 35 | */ 36 | namespace MATH 37 | { 38 | /* @section: constants */ 39 | // pi value 40 | inline constexpr float _PI = 3.141592654f; 41 | // double of pi 42 | inline constexpr float _2PI = 6.283185307f; 43 | // half of pi 44 | inline constexpr float _HPI = 1.570796327f; 45 | // quarter of pi 46 | inline constexpr float _QPI = 0.785398163f; 47 | // reciprocal of double of pi 48 | inline constexpr float _1DIV2PI = 0.159154943f; 49 | // golden ratio 50 | inline constexpr float _PHI = 1.618033988f; 51 | 52 | // capture game's exports 53 | bool Setup(); 54 | 55 | /* @section: algorithm */ 56 | /// alternative of 'std::min' 57 | /// @returns : minimal value of the given comparable values 58 | template 59 | [[nodiscard]] CS_INLINE constexpr const T& Min(const T& left, const T& right) noexcept 60 | { 61 | return (right < left) ? right : left; 62 | } 63 | 64 | /// alternative of 'std::max' 65 | /// @returns : maximal value of the given comparable values 66 | template 67 | [[nodiscard]] CS_INLINE constexpr const T& Max(const T& left, const T& right) noexcept 68 | { 69 | return (right > left) ? right : left; 70 | } 71 | 72 | /// alternative of 'std::clamp' 73 | /// @returns : value clamped in range ['minimal' .. 'maximal'] 74 | template 75 | [[nodiscard]] CS_INLINE constexpr const T& Clamp(const T& value, const T& minimal, const T& maximal) noexcept 76 | { 77 | return (value < minimal) ? minimal : (value > maximal) ? maximal : 78 | value; 79 | } 80 | 81 | /* @section: exponential */ 82 | /// @returns: true if given number is power of two, false otherwise 83 | template requires (std::is_integral_v) 84 | [[nodiscard]] CS_INLINE constexpr bool IsPowerOfTwo(const T value) noexcept 85 | { 86 | return value != 0 && (value & (value - 1)) == 0; 87 | } 88 | 89 | /* @section: random using game's exports */ 90 | inline int(CS_CDECL* fnRandomSeed)(int iSeed) = nullptr; 91 | inline float(CS_CDECL* fnRandomFloat)(float flMinValue, float flMaxValue) = nullptr; 92 | inline float(CS_CDECL* fnRandomFloatExp)(float flMinValue, float flMaxValue, float flExponent) = nullptr; 93 | inline int(CS_CDECL* fnRandomInt)(int iMinValue, int iMaxValue) = nullptr; 94 | inline float(CS_CDECL* fnRandomGaussianFloat)(float flMean, float flStdDev) = nullptr; 95 | } 96 | -------------------------------------------------------------------------------- /cstrike/features/CRC.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | // used: MEM_PAD and virtual funcs 5 | #include "../utilities/memory.h" 6 | // used: CUtlBuffer 7 | #include "../sdk/datatypes/utlbuffer.h" 8 | // used: CBaseUserCmdPB 9 | #include "../sdk/datatypes/usercmd.h"; 10 | 11 | namespace CRC 12 | { 13 | struct CInButtonStateNoVTable 14 | { 15 | public: 16 | std::uint64_t nValue; 17 | std::uint64_t nValueChanged; 18 | std::uint64_t nValueScroll; 19 | }; 20 | 21 | struct SavedData_t 22 | { 23 | CInButtonStateNoVTable nButtons; 24 | QAngle_t angView; 25 | }; 26 | 27 | inline SavedData_t savedData; 28 | 29 | inline void Save(CBaseUserCmdPB* pBaseCmd) 30 | { 31 | if (pBaseCmd->pViewAngles != nullptr) 32 | savedData.angView = pBaseCmd->pViewAngles->angValue; 33 | 34 | savedData.nButtons.nValue = pBaseCmd->pInButtonState->nValue; 35 | savedData.nButtons.nValueChanged = pBaseCmd->pInButtonState->nValueChanged; 36 | savedData.nButtons.nValueScroll = pBaseCmd->pInButtonState->nValueScroll; 37 | } 38 | 39 | inline void Apply(CUserCmd* pCmd) 40 | { 41 | CBaseUserCmdPB* pBaseCmd = pCmd->csgoUserCmd.pBaseCmd; 42 | if (pBaseCmd == nullptr) 43 | return; 44 | 45 | pCmd->nButtons.nValue = savedData.nButtons.nValue; 46 | pCmd->nButtons.nValueChanged = savedData.nButtons.nValueChanged; 47 | pCmd->nButtons.nValueScroll = savedData.nButtons.nValueScroll; 48 | 49 | if (pBaseCmd->pViewAngles != nullptr) 50 | pBaseCmd->pViewAngles->angValue = savedData.angView; 51 | } 52 | 53 | inline bool CalculateCRC(CBaseUserCmdPB* pBaseCmd) 54 | { 55 | int nCalcualtedCRCSize = pBaseCmd->CalculateCmdCRCSize(); 56 | CUtlBuffer protobufBuffer(0, 0, 0); 57 | protobufBuffer.EnsureCapacity(nCalcualtedCRCSize + 1); 58 | 59 | using fnSerializePartialToArray = bool(__fastcall*)(CBaseUserCmdPB*, CUtlBuffer, int); 60 | static const fnSerializePartialToArray oSerializePartialToArray = reinterpret_cast(MEM::FindPattern(CLIENT_DLL, CS_XOR("48 89 5C 24 18 55 56 57 48 81 EC 90"))); 61 | 62 | #ifdef CS_PARANOID 63 | CS_ASSERT(oSerializePartialToArray != nullptr); 64 | #endif 65 | 66 | if (oSerializePartialToArray(pBaseCmd, protobufBuffer, nCalcualtedCRCSize)) 67 | { 68 | std::uintptr_t* pMessage = reinterpret_cast(I::MemAlloc->Alloc(0x18)); 69 | pBaseCmd->nCachedBits |= 1; 70 | auto nHasBits = static_cast(pBaseCmd->nHasBits & 0xFFFFFFFFFFFFFFFC); 71 | if ((pBaseCmd->nHasBits & 1) != 0) 72 | nHasBits = static_cast(nHasBits); 73 | 74 | using fnWriteMessage = void(__fastcall*)(std::uintptr_t*, CUtlBuffer, int); 75 | static const fnWriteMessage oWriteMessage = reinterpret_cast(MEM::FindPattern(CLIENT_DLL, CS_XOR("48 89 5C 24 10 48 89 6C 24 18 48 89 7C 24 20 41 56 48 83 EC 20 48 BF"))); 76 | 77 | #ifdef CS_PARANOID 78 | CS_ASSERT(oWriteMessage != nullptr); 79 | #endif 80 | 81 | using fnSetMessageData = std::string*(__fastcall*)(void*, std::uintptr_t*, void*); 82 | static const fnSetMessageData oSetMessageData = reinterpret_cast(MEM::FindPattern(CLIENT_DLL, CS_XOR("48 89 5C 24 20 55 56 57 48 83 EC 30 49"))); 83 | 84 | #ifdef CS_PARANOID 85 | CS_ASSERT(oSetMessageData != nullptr); 86 | #endif 87 | 88 | oWriteMessage(pMessage, protobufBuffer, nCalcualtedCRCSize); 89 | pBaseCmd->strMoveCrc = oSetMessageData(&pBaseCmd->strMoveCrc, pMessage, &nHasBits); 90 | I::MemAlloc->Free(pMessage); 91 | 92 | return true; 93 | } 94 | 95 | return false; 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /cstrike/core/hooks.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // used: [d3d] api 4 | #include 5 | #include 6 | 7 | // used: chookobject 8 | #include "../utilities/detourhook.h" 9 | 10 | // used: viewmatrix_t 11 | #include "../sdk/datatypes/matrix.h" 12 | 13 | namespace VTABLE 14 | { 15 | namespace D3D 16 | { 17 | enum 18 | { 19 | PRESENT = 8U, 20 | RESIZEBUFFERS = 13U, 21 | RESIZEBUFFERS_CSTYLE = 39U, 22 | }; 23 | } 24 | 25 | namespace DXGI 26 | { 27 | enum 28 | { 29 | CREATESWAPCHAIN = 10U, 30 | }; 31 | } 32 | 33 | namespace CLIENT 34 | { 35 | enum 36 | { 37 | CREATEMOVE = 5U, 38 | MOUSEINPUTENABLED = 16U, 39 | FRAMESTAGENOTIFY = 36U, 40 | }; 41 | } 42 | 43 | namespace INPUTSYSTEM 44 | { 45 | enum 46 | { 47 | ISRELATIVEMOUSEMODE = 78U, 48 | }; 49 | } 50 | } 51 | 52 | class CRenderGameSystem; 53 | class IViewRender; 54 | class CCSGOInput; 55 | class CViewSetup; 56 | class CMeshData; 57 | 58 | namespace H 59 | { 60 | bool Setup(); 61 | void Destroy(); 62 | 63 | /* @section: handlers */ 64 | // d3d11 & wndproc 65 | HRESULT WINAPI Present(IDXGISwapChain* pSwapChain, UINT uSyncInterval, UINT uFlags); 66 | HRESULT CS_FASTCALL ResizeBuffers(IDXGISwapChain* pSwapChain, std::uint32_t nBufferCount, std::uint32_t nWidth, std::uint32_t nHeight, DXGI_FORMAT newFormat, std::uint32_t nFlags); 67 | HRESULT WINAPI CreateSwapChain(IDXGIFactory* pFactory, IUnknown* pDevice, DXGI_SWAP_CHAIN_DESC* pDesc, IDXGISwapChain** ppSwapChain); 68 | long CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 69 | 70 | // game's functions 71 | ViewMatrix_t* CS_FASTCALL GetMatrixForView(CRenderGameSystem* pRenderGameSystem, IViewRender* pViewRender, ViewMatrix_t* pOutWorldToView, ViewMatrix_t* pOutViewToProjection, ViewMatrix_t* pOutWorldToProjection, ViewMatrix_t* pOutWorldToPixels); 72 | bool CS_FASTCALL CreateMove(CCSGOInput* pInput, int nSlot, bool bActive); 73 | bool CS_FASTCALL MouseInputEnabled(void* pThisptr); 74 | void CS_FASTCALL FrameStageNotify(void* rcx, int nFrameStage); 75 | __int64* CS_FASTCALL LevelInit(void* pClientModeShared, const char* szNewMap); 76 | __int64 CS_FASTCALL LevelShutdown(void* pClientModeShared); 77 | void CS_FASTCALL OverrideView(void* pClientModeCSNormal, CViewSetup* pSetup); 78 | void CS_FASTCALL DrawObject(void* pAnimatableSceneObjectDesc, void* pDx11, CMeshData* arrMeshDraw, int nDataCount, void* pSceneView, void* pSceneLayer, void* pUnk, void* pUnk2); 79 | void* IsRelativeMouseMode(void* pThisptr, bool bActive); 80 | 81 | /* @section: managers */ 82 | inline CBaseHookObject hkPresent = {}; 83 | inline CBaseHookObject hkResizeBuffers = {}; 84 | inline CBaseHookObject hkCreateSwapChain = {}; 85 | inline CBaseHookObject hkWndProc = {}; 86 | 87 | inline CBaseHookObject hkGetMatrixForView = {}; 88 | inline CBaseHookObject hkCreateMove = {}; 89 | inline CBaseHookObject hkMouseInputEnabled = {}; 90 | inline CBaseHookObject hkIsRelativeMouseMode = {}; 91 | inline CBaseHookObject hkFrameStageNotify = {}; 92 | inline CBaseHookObject hkLevelInit = {}; 93 | inline CBaseHookObject hkLevelShutdown = {}; 94 | inline CBaseHookObject hkOverrideView = {}; 95 | 96 | inline CBaseHookObject hkDrawObject = {}; 97 | } 98 | -------------------------------------------------------------------------------- /cstrike/core/menu.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // used: [stl] vector 4 | #include 5 | 6 | #include "../common.h" 7 | 8 | // used: [ext] imgui, draw, animation 9 | #include "../utilities/draw.h" 10 | 11 | #define MENU_MAX_BACKGROUND_PARTICLES 100 12 | 13 | class CTab 14 | { 15 | public: 16 | const char* szName; 17 | void (*pRenderFunction)(); 18 | }; 19 | 20 | namespace MENU 21 | { 22 | void RenderMainWindow(); 23 | void RenderOverlayPreviewWindow(); 24 | void RenderWatermark(); 25 | 26 | void UpdateStyle(ImGuiStyle* pStyle = nullptr); 27 | 28 | /* @section: particles */ 29 | struct ParticleData_t 30 | { 31 | ParticleData_t(const ImVec2& vecPosition, const ImVec2& vecVelocity) : 32 | vecPosition(vecPosition), vecVelocity(vecVelocity) { } 33 | 34 | // current particle position 35 | ImVec2 vecPosition = {}; 36 | // current particle velocity 37 | ImVec2 vecVelocity = {}; 38 | }; 39 | 40 | struct ParticleContext_t 41 | { 42 | ParticleContext_t(const int nMaxParticles = 100) 43 | { 44 | // allocate memory for particles 45 | this->vecParticles.reserve(nMaxParticles); 46 | // create particles if needed 47 | } 48 | 49 | ~ParticleContext_t() 50 | { 51 | // since no memory allocated, just clear vector 52 | this->vecParticles.clear(); 53 | } 54 | 55 | void Render(ImDrawList* pDrawList, const ImVec2& vecScreenSize, const float flAlpha); 56 | 57 | // create particle with random velocity/position 58 | void AddParticle(const ImVec2& vecScreenSize); 59 | // current size of particles 60 | const size_t Count() const { return this->vecParticles.size(); } 61 | private: 62 | // draw particle (circle) 63 | void DrawParticle(ImDrawList* pDrawList, ParticleData_t& particle, const Color_t& colPrimary); 64 | 65 | // find & draw connection as a line between particles 66 | void FindConnections(ImDrawList* pDrawList, ParticleData_t& particle, const Color_t& colPrimary, float flMaxDistance); 67 | void DrawConnection(ImDrawList* pDrawList, ParticleData_t& particle, ParticleData_t& otherParticle, float flAlpha, const Color_t& colPrimary) const; 68 | 69 | // update particle position/velocity 70 | // reversed direction when particle is out of screen 71 | void UpdatePosition(ParticleData_t& particle, const ImVec2& vecScreenSize) const; 72 | void ResolveScreenCollision(ParticleData_t& particle, const ImVec2& vecScreenSize) const; 73 | 74 | // all our particles data 75 | std::vector vecParticles; 76 | }; 77 | 78 | inline bool bMainWindowOpened = false; 79 | inline bool bMainActive = false; 80 | inline int nCurrentMainTab = 0; 81 | inline ParticleContext_t menuParticle = ParticleContext_t(MENU_MAX_BACKGROUND_PARTICLES); 82 | inline AnimationHandler_t animMenuDimBackground; 83 | inline float flDpiScale = 1.f; 84 | } 85 | 86 | namespace T 87 | { 88 | /* @section: main */ 89 | void Render(const char* szTabBar, const CTab* arrTabs, const unsigned long long nTabsCount, int* nCurrentTab, ImGuiTabBarFlags flags = ImGuiTabBarFlags_NoCloseWithMiddleMouseButton | ImGuiTabBarFlags_NoTooltip); 90 | 91 | /* @section: tabs */ 92 | void RageBot(); 93 | void LegitBot(); 94 | void Visuals(); 95 | void Miscellaneous(); 96 | void SkinsChanger(); 97 | 98 | /* @section: values */ 99 | // user-defined configuration filename in miscellaneous tab 100 | inline char szConfigFile[256U] = {}; 101 | // current selected configuration in miscellaneous tab 102 | inline unsigned long long nSelectedConfig = ~1U; 103 | // current sub tab overlay in visuals tab 104 | inline int nCurrentOverlaySubtab = 0; 105 | } 106 | -------------------------------------------------------------------------------- /cstrike/sdk/interfaces/cgametracemanager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | // used: pad and findpattern 3 | #include "../../utilities/memory.h" 4 | // used: vector 5 | #include "../../sdk/datatypes/vector.h" 6 | // used: array 7 | #include 8 | 9 | struct Ray_t 10 | { 11 | public: 12 | Vector_t m_vecStart; 13 | Vector_t m_vecEnd; 14 | Vector_t m_vecMins; 15 | Vector_t m_vecMaxs; 16 | MEM_PAD(0x4); 17 | std::uint8_t UnkType; 18 | }; 19 | static_assert(sizeof(Ray_t) == 0x38); 20 | 21 | struct SurfaceData_t 22 | { 23 | public: 24 | MEM_PAD(0x8) 25 | float m_flPenetrationModifier; 26 | float m_flDamageModifier; 27 | MEM_PAD(0x4) 28 | int m_iMaterial; 29 | }; 30 | 31 | static_assert(sizeof(SurfaceData_t) == 0x18); 32 | 33 | struct TraceHitboxData_t 34 | { 35 | public: 36 | MEM_PAD(0x38); 37 | int m_nHitGroup; 38 | MEM_PAD(0x4); 39 | int m_nHitboxId; 40 | }; 41 | static_assert(sizeof(TraceHitboxData_t) == 0x44); 42 | 43 | class C_CSPlayerPawn; 44 | struct GameTrace_t 45 | { 46 | public: 47 | GameTrace_t() = default; 48 | 49 | SurfaceData_t* GetSurfaceData(); 50 | int GetHitboxId(); 51 | int GetHitgroup(); 52 | bool IsVisible() const; 53 | 54 | void* m_pSurface; 55 | C_CSPlayerPawn* m_pHitEntity; 56 | TraceHitboxData_t* m_pHitboxData; 57 | MEM_PAD(0x38); 58 | std::uint32_t m_uContents; 59 | MEM_PAD(0x24); 60 | Vector_t m_vecStartPos; 61 | Vector_t m_vecEndPos; 62 | Vector_t m_vecNormal; 63 | Vector_t m_vecPosition; 64 | MEM_PAD(0x4); 65 | float m_flFraction; 66 | MEM_PAD(0x6); 67 | bool m_bAllSolid; 68 | MEM_PAD(0x4D) 69 | }; // Size: 0x108 70 | 71 | static_assert(sizeof(GameTrace_t) == 0x108); 72 | 73 | struct TraceFilter_t 74 | { 75 | public: 76 | MEM_PAD(0x8); 77 | std::int64_t m_uTraceMask; 78 | std::array m_v1; 79 | std::array m_arrSkipHandles; 80 | std::array m_arrCollisions; 81 | std::int16_t m_v2; 82 | std::uint8_t m_v3; 83 | std::uint8_t m_v4; 84 | std::uint8_t m_v5; 85 | 86 | TraceFilter_t() = default; 87 | TraceFilter_t(std::uint64_t uMask, C_CSPlayerPawn* pSkip1, C_CSPlayerPawn* pSkip2, int nLayer); 88 | }; 89 | static_assert(sizeof(TraceFilter_t) == 0x40); 90 | 91 | class CGameTraceManager 92 | { 93 | public: 94 | bool TraceShape(Ray_t* pRay, Vector_t vecStart, Vector_t vecEnd, TraceFilter_t* pFilter, GameTrace_t* pGameTrace) 95 | { 96 | using fnTraceShape = bool(__fastcall*)(CGameTraceManager*, Ray_t*, Vector_t*, Vector_t*, TraceFilter_t*, GameTrace_t*); 97 | static fnTraceShape oTraceShape = reinterpret_cast(MEM::GetAbsoluteAddress(MEM::FindPattern(CLIENT_DLL, CS_XOR("E8 ? ? ? ? 80 7D ? ? 75 ? F3 0F 10 45")), 0x1, 0x0)); 98 | 99 | #ifdef CS_PARANOID 100 | CS_ASSERT(oTraceShape != nullptr); 101 | #endif 102 | 103 | return oTraceShape(this, pRay, &vecStart, &vecEnd, pFilter, pGameTrace); 104 | } 105 | 106 | bool ClipRayToEntity(Ray_t* pRay, Vector_t vecStart, Vector_t vecEnd, C_CSPlayerPawn* pPawn, TraceFilter_t* pFilter, GameTrace_t* pGameTrace) 107 | { 108 | using fnClipRayToEntity = bool(__fastcall*)(CGameTraceManager*, Ray_t*, Vector_t*, Vector_t*, C_CSPlayerPawn*, TraceFilter_t*, GameTrace_t*); 109 | static fnClipRayToEntity oClipRayToEntity = reinterpret_cast(MEM::FindPattern(CLIENT_DLL, CS_XOR("48 89 5C 24 08 48 89 6C 24 10 48 89 74 24 18 48 89 7C 24 20 41 54 41 56 41 57 48 81 EC C0 00 00 00 48 8B 9C"))); 110 | 111 | #ifdef CS_PARANOID 112 | CS_ASSERT(oClipRayToEntity != nullptr); 113 | #endif 114 | 115 | return oClipRayToEntity(this, pRay, &vecStart, &vecEnd, pPawn, pFilter, pGameTrace); 116 | } 117 | }; 118 | -------------------------------------------------------------------------------- /dependencies/freetype/include/freetype/ftsynth.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * ftsynth.h 4 | * 5 | * FreeType synthesizing code for emboldening and slanting 6 | * (specification). 7 | * 8 | * Copyright (C) 2000-2019 by 9 | * David Turner, Robert Wilhelm, and Werner Lemberg. 10 | * 11 | * This file is part of the FreeType project, and may only be used, 12 | * modified, and distributed under the terms of the FreeType project 13 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 14 | * this file you indicate that you have read the license and 15 | * understand and accept it fully. 16 | * 17 | */ 18 | 19 | 20 | /*************************************************************************/ 21 | /*************************************************************************/ 22 | /*************************************************************************/ 23 | /*************************************************************************/ 24 | /*************************************************************************/ 25 | /********* *********/ 26 | /********* WARNING, THIS IS ALPHA CODE! THIS API *********/ 27 | /********* IS DUE TO CHANGE UNTIL STRICTLY NOTIFIED BY THE *********/ 28 | /********* FREETYPE DEVELOPMENT TEAM *********/ 29 | /********* *********/ 30 | /*************************************************************************/ 31 | /*************************************************************************/ 32 | /*************************************************************************/ 33 | /*************************************************************************/ 34 | /*************************************************************************/ 35 | 36 | 37 | /* Main reason for not lifting the functions in this module to a */ 38 | /* 'standard' API is that the used parameters for emboldening and */ 39 | /* slanting are not configurable. Consider the functions as a */ 40 | /* code resource that should be copied into the application and */ 41 | /* adapted to the particular needs. */ 42 | 43 | 44 | #ifndef FTSYNTH_H_ 45 | #define FTSYNTH_H_ 46 | 47 | 48 | #include 49 | #include FT_FREETYPE_H 50 | 51 | #ifdef FREETYPE_H 52 | #error "freetype.h of FreeType 1 has been loaded!" 53 | #error "Please fix the directory search order for header files" 54 | #error "so that freetype.h of FreeType 2 is found first." 55 | #endif 56 | 57 | 58 | FT_BEGIN_HEADER 59 | 60 | /* Embolden a glyph by a 'reasonable' value (which is highly a matter of */ 61 | /* taste). This function is actually a convenience function, providing */ 62 | /* a wrapper for @FT_Outline_Embolden and @FT_Bitmap_Embolden. */ 63 | /* */ 64 | /* For emboldened outlines the height, width, and advance metrics are */ 65 | /* increased by the strength of the emboldening -- this even affects */ 66 | /* mono-width fonts! */ 67 | /* */ 68 | /* You can also call @FT_Outline_Get_CBox to get precise values. */ 69 | FT_EXPORT( void ) 70 | FT_GlyphSlot_Embolden( FT_GlyphSlot slot ); 71 | 72 | /* Slant an outline glyph to the right by about 12 degrees. */ 73 | FT_EXPORT( void ) 74 | FT_GlyphSlot_Oblique( FT_GlyphSlot slot ); 75 | 76 | /* */ 77 | 78 | 79 | FT_END_HEADER 80 | 81 | #endif /* FTSYNTH_H_ */ 82 | 83 | 84 | /* END */ 85 | -------------------------------------------------------------------------------- /dependencies/imgui/imgui_freetype.h: -------------------------------------------------------------------------------- 1 | // dear imgui: FreeType font builder (used as a replacement for the stb_truetype builder) 2 | // (headers) 3 | 4 | #pragma once 5 | #include "imgui.h" // IMGUI_API 6 | #ifndef IMGUI_DISABLE 7 | 8 | // Forward declarations 9 | struct ImFontAtlas; 10 | struct ImFontBuilderIO; 11 | 12 | // Hinting greatly impacts visuals (and glyph sizes). 13 | // - By default, hinting is enabled and the font's native hinter is preferred over the auto-hinter. 14 | // - When disabled, FreeType generates blurrier glyphs, more or less matches the stb_truetype.h 15 | // - The Default hinting mode usually looks good, but may distort glyphs in an unusual way. 16 | // - The Light hinting mode generates fuzzier glyphs but better matches Microsoft's rasterizer. 17 | // You can set those flags globaly in ImFontAtlas::FontBuilderFlags 18 | // You can set those flags on a per font basis in ImFontConfig::FontBuilderFlags 19 | enum ImGuiFreeTypeBuilderFlags 20 | { 21 | ImGuiFreeTypeBuilderFlags_NoHinting = 1 << 0, // Disable hinting. This generally generates 'blurrier' bitmap glyphs when the glyph are rendered in any of the anti-aliased modes. 22 | ImGuiFreeTypeBuilderFlags_NoAutoHint = 1 << 1, // Disable auto-hinter. 23 | ImGuiFreeTypeBuilderFlags_ForceAutoHint = 1 << 2, // Indicates that the auto-hinter is preferred over the font's native hinter. 24 | ImGuiFreeTypeBuilderFlags_LightHinting = 1 << 3, // A lighter hinting algorithm for gray-level modes. Many generated glyphs are fuzzier but better resemble their original shape. This is achieved by snapping glyphs to the pixel grid only vertically (Y-axis), as is done by Microsoft's ClearType and Adobe's proprietary font renderer. This preserves inter-glyph spacing in horizontal text. 25 | ImGuiFreeTypeBuilderFlags_MonoHinting = 1 << 4, // Strong hinting algorithm that should only be used for monochrome output. 26 | ImGuiFreeTypeBuilderFlags_Bold = 1 << 5, // Styling: Should we artificially embolden the font? 27 | ImGuiFreeTypeBuilderFlags_Oblique = 1 << 6, // Styling: Should we slant the font, emulating italic style? 28 | ImGuiFreeTypeBuilderFlags_Monochrome = 1 << 7, // Disable anti-aliasing. Combine this with MonoHinting for best results! 29 | ImGuiFreeTypeBuilderFlags_LoadColor = 1 << 8, // Enable FreeType color-layered glyphs 30 | ImGuiFreeTypeBuilderFlags_Bitmap = 1 << 9 // Enable FreeType bitmap glyphs 31 | }; 32 | 33 | namespace ImGuiFreeType 34 | { 35 | // This is automatically assigned when using '#define IMGUI_ENABLE_FREETYPE'. 36 | // If you need to dynamically select between multiple builders: 37 | // - you can manually assign this builder with 'atlas->FontBuilderIO = ImGuiFreeType::GetBuilderForFreeType()' 38 | // - prefer deep-copying this into your own ImFontBuilderIO instance if you use hot-reloading that messes up static data. 39 | IMGUI_API const ImFontBuilderIO* GetBuilderForFreeType(); 40 | 41 | // Override allocators. By default ImGuiFreeType will use IM_ALLOC()/IM_FREE() 42 | // However, as FreeType does lots of allocations we provide a way for the user to redirect it to a separate memory heap if desired. 43 | IMGUI_API void SetAllocatorFunctions(void* (*alloc_func)(size_t sz, void* user_data), void (*free_func)(void* ptr, void* user_data), void* user_data = nullptr); 44 | 45 | // Obsolete names (will be removed soon) 46 | // Prefer using '#define IMGUI_ENABLE_FREETYPE' 47 | #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS 48 | static inline bool BuildFontAtlas(ImFontAtlas* atlas, unsigned int flags = 0) { atlas->FontBuilderIO = GetBuilderForFreeType(); atlas->FontBuilderFlags = flags; return atlas->Build(); } 49 | #endif 50 | } 51 | 52 | #endif // #ifndef IMGUI_DISABLE 53 | -------------------------------------------------------------------------------- /dependencies/minhook/hde/table32.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Hacker Disassembler Engine 32 C 3 | * Copyright (c) 2008-2009, Vyacheslav Patkov. 4 | * All rights reserved. 5 | * 6 | */ 7 | 8 | #define C_NONE 0x00 9 | #define C_MODRM 0x01 10 | #define C_IMM8 0x02 11 | #define C_IMM16 0x04 12 | #define C_IMM_P66 0x10 13 | #define C_REL8 0x20 14 | #define C_REL32 0x40 15 | #define C_GROUP 0x80 16 | #define C_ERROR 0xff 17 | 18 | #define PRE_ANY 0x00 19 | #define PRE_NONE 0x01 20 | #define PRE_F2 0x02 21 | #define PRE_F3 0x04 22 | #define PRE_66 0x08 23 | #define PRE_67 0x10 24 | #define PRE_LOCK 0x20 25 | #define PRE_SEG 0x40 26 | #define PRE_ALL 0xff 27 | 28 | #define DELTA_OPCODES 0x4a 29 | #define DELTA_FPU_REG 0xf1 30 | #define DELTA_FPU_MODRM 0xf8 31 | #define DELTA_PREFIXES 0x130 32 | #define DELTA_OP_LOCK_OK 0x1a1 33 | #define DELTA_OP2_LOCK_OK 0x1b9 34 | #define DELTA_OP_ONLY_MEM 0x1cb 35 | #define DELTA_OP2_ONLY_MEM 0x1da 36 | 37 | unsigned char hde32_table[] = { 38 | 0xa3,0xa8,0xa3,0xa8,0xa3,0xa8,0xa3,0xa8,0xa3,0xa8,0xa3,0xa8,0xa3,0xa8,0xa3, 39 | 0xa8,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xac,0xaa,0xb2,0xaa,0x9f,0x9f, 40 | 0x9f,0x9f,0xb5,0xa3,0xa3,0xa4,0xaa,0xaa,0xba,0xaa,0x96,0xaa,0xa8,0xaa,0xc3, 41 | 0xc3,0x96,0x96,0xb7,0xae,0xd6,0xbd,0xa3,0xc5,0xa3,0xa3,0x9f,0xc3,0x9c,0xaa, 42 | 0xaa,0xac,0xaa,0xbf,0x03,0x7f,0x11,0x7f,0x01,0x7f,0x01,0x3f,0x01,0x01,0x90, 43 | 0x82,0x7d,0x97,0x59,0x59,0x59,0x59,0x59,0x7f,0x59,0x59,0x60,0x7d,0x7f,0x7f, 44 | 0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x9a,0x88,0x7d, 45 | 0x59,0x50,0x50,0x50,0x50,0x59,0x59,0x59,0x59,0x61,0x94,0x61,0x9e,0x59,0x59, 46 | 0x85,0x59,0x92,0xa3,0x60,0x60,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59, 47 | 0x59,0x59,0x9f,0x01,0x03,0x01,0x04,0x03,0xd5,0x03,0xcc,0x01,0xbc,0x03,0xf0, 48 | 0x10,0x10,0x10,0x10,0x50,0x50,0x50,0x50,0x14,0x20,0x20,0x20,0x20,0x01,0x01, 49 | 0x01,0x01,0xc4,0x02,0x10,0x00,0x00,0x00,0x00,0x01,0x01,0xc0,0xc2,0x10,0x11, 50 | 0x02,0x03,0x11,0x03,0x03,0x04,0x00,0x00,0x14,0x00,0x02,0x00,0x00,0xc6,0xc8, 51 | 0x02,0x02,0x02,0x02,0x00,0x00,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0xff,0xca, 52 | 0x01,0x01,0x01,0x00,0x06,0x00,0x04,0x00,0xc0,0xc2,0x01,0x01,0x03,0x01,0xff, 53 | 0xff,0x01,0x00,0x03,0xc4,0xc4,0xc6,0x03,0x01,0x01,0x01,0xff,0x03,0x03,0x03, 54 | 0xc8,0x40,0x00,0x0a,0x00,0x04,0x00,0x00,0x00,0x00,0x7f,0x00,0x33,0x01,0x00, 55 | 0x00,0x00,0x00,0x00,0x00,0xff,0xbf,0xff,0xff,0x00,0x00,0x00,0x00,0x07,0x00, 56 | 0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 57 | 0x00,0xff,0xff,0x00,0x00,0x00,0xbf,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 58 | 0x7f,0x00,0x00,0xff,0x4a,0x4a,0x4a,0x4a,0x4b,0x52,0x4a,0x4a,0x4a,0x4a,0x4f, 59 | 0x4c,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x55,0x45,0x40,0x4a,0x4a,0x4a, 60 | 0x45,0x59,0x4d,0x46,0x4a,0x5d,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a, 61 | 0x4a,0x4a,0x4a,0x4a,0x4a,0x61,0x63,0x67,0x4e,0x4a,0x4a,0x6b,0x6d,0x4a,0x4a, 62 | 0x45,0x6d,0x4a,0x4a,0x44,0x45,0x4a,0x4a,0x00,0x00,0x00,0x02,0x0d,0x06,0x06, 63 | 0x06,0x06,0x0e,0x00,0x00,0x00,0x00,0x06,0x06,0x06,0x00,0x06,0x06,0x02,0x06, 64 | 0x00,0x0a,0x0a,0x07,0x07,0x06,0x02,0x05,0x05,0x02,0x02,0x00,0x00,0x04,0x04, 65 | 0x04,0x04,0x00,0x00,0x00,0x0e,0x05,0x06,0x06,0x06,0x01,0x06,0x00,0x00,0x08, 66 | 0x00,0x10,0x00,0x18,0x00,0x20,0x00,0x28,0x00,0x30,0x00,0x80,0x01,0x82,0x01, 67 | 0x86,0x00,0xf6,0xcf,0xfe,0x3f,0xab,0x00,0xb0,0x00,0xb1,0x00,0xb3,0x00,0xba, 68 | 0xf8,0xbb,0x00,0xc0,0x00,0xc1,0x00,0xc7,0xbf,0x62,0xff,0x00,0x8d,0xff,0x00, 69 | 0xc4,0xff,0x00,0xc5,0xff,0x00,0xff,0xff,0xeb,0x01,0xff,0x0e,0x12,0x08,0x00, 70 | 0x13,0x09,0x00,0x16,0x08,0x00,0x17,0x09,0x00,0x2b,0x09,0x00,0xae,0xff,0x07, 71 | 0xb2,0xff,0x00,0xb4,0xff,0x00,0xb5,0xff,0x00,0xc3,0x01,0x00,0xc7,0xff,0xbf, 72 | 0xe7,0x08,0x00,0xf0,0x02,0x00 73 | }; 74 | -------------------------------------------------------------------------------- /dependencies/minhook/hde/table64.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Hacker Disassembler Engine 64 C 3 | * Copyright (c) 2008-2009, Vyacheslav Patkov. 4 | * All rights reserved. 5 | * 6 | */ 7 | 8 | #define C_NONE 0x00 9 | #define C_MODRM 0x01 10 | #define C_IMM8 0x02 11 | #define C_IMM16 0x04 12 | #define C_IMM_P66 0x10 13 | #define C_REL8 0x20 14 | #define C_REL32 0x40 15 | #define C_GROUP 0x80 16 | #define C_ERROR 0xff 17 | 18 | #define PRE_ANY 0x00 19 | #define PRE_NONE 0x01 20 | #define PRE_F2 0x02 21 | #define PRE_F3 0x04 22 | #define PRE_66 0x08 23 | #define PRE_67 0x10 24 | #define PRE_LOCK 0x20 25 | #define PRE_SEG 0x40 26 | #define PRE_ALL 0xff 27 | 28 | #define DELTA_OPCODES 0x4a 29 | #define DELTA_FPU_REG 0xfd 30 | #define DELTA_FPU_MODRM 0x104 31 | #define DELTA_PREFIXES 0x13c 32 | #define DELTA_OP_LOCK_OK 0x1ae 33 | #define DELTA_OP2_LOCK_OK 0x1c6 34 | #define DELTA_OP_ONLY_MEM 0x1d8 35 | #define DELTA_OP2_ONLY_MEM 0x1e7 36 | 37 | unsigned char hde64_table[] = { 38 | 0xa5,0xaa,0xa5,0xb8,0xa5,0xaa,0xa5,0xaa,0xa5,0xb8,0xa5,0xb8,0xa5,0xb8,0xa5, 39 | 0xb8,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xac,0xc0,0xcc,0xc0,0xa1,0xa1, 40 | 0xa1,0xa1,0xb1,0xa5,0xa5,0xa6,0xc0,0xc0,0xd7,0xda,0xe0,0xc0,0xe4,0xc0,0xea, 41 | 0xea,0xe0,0xe0,0x98,0xc8,0xee,0xf1,0xa5,0xd3,0xa5,0xa5,0xa1,0xea,0x9e,0xc0, 42 | 0xc0,0xc2,0xc0,0xe6,0x03,0x7f,0x11,0x7f,0x01,0x7f,0x01,0x3f,0x01,0x01,0xab, 43 | 0x8b,0x90,0x64,0x5b,0x5b,0x5b,0x5b,0x5b,0x92,0x5b,0x5b,0x76,0x90,0x92,0x92, 44 | 0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x6a,0x73,0x90, 45 | 0x5b,0x52,0x52,0x52,0x52,0x5b,0x5b,0x5b,0x5b,0x77,0x7c,0x77,0x85,0x5b,0x5b, 46 | 0x70,0x5b,0x7a,0xaf,0x76,0x76,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b, 47 | 0x5b,0x5b,0x86,0x01,0x03,0x01,0x04,0x03,0xd5,0x03,0xd5,0x03,0xcc,0x01,0xbc, 48 | 0x03,0xf0,0x03,0x03,0x04,0x00,0x50,0x50,0x50,0x50,0xff,0x20,0x20,0x20,0x20, 49 | 0x01,0x01,0x01,0x01,0xc4,0x02,0x10,0xff,0xff,0xff,0x01,0x00,0x03,0x11,0xff, 50 | 0x03,0xc4,0xc6,0xc8,0x02,0x10,0x00,0xff,0xcc,0x01,0x01,0x01,0x00,0x00,0x00, 51 | 0x00,0x01,0x01,0x03,0x01,0xff,0xff,0xc0,0xc2,0x10,0x11,0x02,0x03,0x01,0x01, 52 | 0x01,0xff,0xff,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0x10, 53 | 0x10,0x10,0x10,0x02,0x10,0x00,0x00,0xc6,0xc8,0x02,0x02,0x02,0x02,0x06,0x00, 54 | 0x04,0x00,0x02,0xff,0x00,0xc0,0xc2,0x01,0x01,0x03,0x03,0x03,0xca,0x40,0x00, 55 | 0x0a,0x00,0x04,0x00,0x00,0x00,0x00,0x7f,0x00,0x33,0x01,0x00,0x00,0x00,0x00, 56 | 0x00,0x00,0xff,0xbf,0xff,0xff,0x00,0x00,0x00,0x00,0x07,0x00,0x00,0xff,0x00, 57 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff, 58 | 0x00,0x00,0x00,0xbf,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0x00,0x00, 59 | 0xff,0x40,0x40,0x40,0x40,0x41,0x49,0x40,0x40,0x40,0x40,0x4c,0x42,0x40,0x40, 60 | 0x40,0x40,0x40,0x40,0x40,0x40,0x4f,0x44,0x53,0x40,0x40,0x40,0x44,0x57,0x43, 61 | 0x5c,0x40,0x60,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, 62 | 0x40,0x40,0x64,0x66,0x6e,0x6b,0x40,0x40,0x6a,0x46,0x40,0x40,0x44,0x46,0x40, 63 | 0x40,0x5b,0x44,0x40,0x40,0x00,0x00,0x00,0x00,0x06,0x06,0x06,0x06,0x01,0x06, 64 | 0x06,0x02,0x06,0x06,0x00,0x06,0x00,0x0a,0x0a,0x00,0x00,0x00,0x02,0x07,0x07, 65 | 0x06,0x02,0x0d,0x06,0x06,0x06,0x0e,0x05,0x05,0x02,0x02,0x00,0x00,0x04,0x04, 66 | 0x04,0x04,0x05,0x06,0x06,0x06,0x00,0x00,0x00,0x0e,0x00,0x00,0x08,0x00,0x10, 67 | 0x00,0x18,0x00,0x20,0x00,0x28,0x00,0x30,0x00,0x80,0x01,0x82,0x01,0x86,0x00, 68 | 0xf6,0xcf,0xfe,0x3f,0xab,0x00,0xb0,0x00,0xb1,0x00,0xb3,0x00,0xba,0xf8,0xbb, 69 | 0x00,0xc0,0x00,0xc1,0x00,0xc7,0xbf,0x62,0xff,0x00,0x8d,0xff,0x00,0xc4,0xff, 70 | 0x00,0xc5,0xff,0x00,0xff,0xff,0xeb,0x01,0xff,0x0e,0x12,0x08,0x00,0x13,0x09, 71 | 0x00,0x16,0x08,0x00,0x17,0x09,0x00,0x2b,0x09,0x00,0xae,0xff,0x07,0xb2,0xff, 72 | 0x00,0xb4,0xff,0x00,0xb5,0xff,0x00,0xc3,0x01,0x00,0xc7,0xff,0xbf,0xe7,0x08, 73 | 0x00,0xf0,0x02,0x00 74 | }; 75 | -------------------------------------------------------------------------------- /dependencies/freetype/include/freetype/internal/fthash.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * fthash.h 4 | * 5 | * Hashing functions (specification). 6 | * 7 | */ 8 | 9 | /* 10 | * Copyright 2000 Computing Research Labs, New Mexico State University 11 | * Copyright 2001-2015 12 | * Francesco Zappa Nardelli 13 | * 14 | * Permission is hereby granted, free of charge, to any person obtaining a 15 | * copy of this software and associated documentation files (the "Software"), 16 | * to deal in the Software without restriction, including without limitation 17 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | * and/or sell copies of the Software, and to permit persons to whom the 19 | * Software is furnished to do so, subject to the following conditions: 20 | * 21 | * The above copyright notice and this permission notice shall be included in 22 | * all copies or substantial portions of the Software. 23 | * 24 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 27 | * THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY 28 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 29 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR 30 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. 31 | */ 32 | 33 | /************************************************************************** 34 | * 35 | * This file is based on code from bdf.c,v 1.22 2000/03/16 20:08:50 36 | * 37 | * taken from Mark Leisher's xmbdfed package 38 | * 39 | */ 40 | 41 | 42 | #ifndef FTHASH_H_ 43 | #define FTHASH_H_ 44 | 45 | 46 | #include 47 | #include FT_FREETYPE_H 48 | 49 | 50 | FT_BEGIN_HEADER 51 | 52 | 53 | typedef union FT_Hashkey_ 54 | { 55 | FT_Int num; 56 | const char* str; 57 | 58 | } FT_Hashkey; 59 | 60 | 61 | typedef struct FT_HashnodeRec_ 62 | { 63 | FT_Hashkey key; 64 | size_t data; 65 | 66 | } FT_HashnodeRec; 67 | 68 | typedef struct FT_HashnodeRec_ *FT_Hashnode; 69 | 70 | 71 | typedef FT_ULong 72 | (*FT_Hash_LookupFunc)( FT_Hashkey* key ); 73 | 74 | typedef FT_Bool 75 | (*FT_Hash_CompareFunc)( FT_Hashkey* a, 76 | FT_Hashkey* b ); 77 | 78 | 79 | typedef struct FT_HashRec_ 80 | { 81 | FT_UInt limit; 82 | FT_UInt size; 83 | FT_UInt used; 84 | 85 | FT_Hash_LookupFunc lookup; 86 | FT_Hash_CompareFunc compare; 87 | 88 | FT_Hashnode* table; 89 | 90 | } FT_HashRec; 91 | 92 | typedef struct FT_HashRec_ *FT_Hash; 93 | 94 | 95 | FT_Error 96 | ft_hash_str_init( FT_Hash hash, 97 | FT_Memory memory ); 98 | 99 | FT_Error 100 | ft_hash_num_init( FT_Hash hash, 101 | FT_Memory memory ); 102 | 103 | void 104 | ft_hash_str_free( FT_Hash hash, 105 | FT_Memory memory ); 106 | 107 | #define ft_hash_num_free ft_hash_str_free 108 | 109 | FT_Error 110 | ft_hash_str_insert( const char* key, 111 | size_t data, 112 | FT_Hash hash, 113 | FT_Memory memory ); 114 | 115 | FT_Error 116 | ft_hash_num_insert( FT_Int num, 117 | size_t data, 118 | FT_Hash hash, 119 | FT_Memory memory ); 120 | 121 | size_t* 122 | ft_hash_str_lookup( const char* key, 123 | FT_Hash hash ); 124 | 125 | size_t* 126 | ft_hash_num_lookup( FT_Int num, 127 | FT_Hash hash ); 128 | 129 | 130 | FT_END_HEADER 131 | 132 | 133 | #endif /* FTHASH_H_ */ 134 | 135 | 136 | /* END */ 137 | -------------------------------------------------------------------------------- /premake5.lua: -------------------------------------------------------------------------------- 1 | workspace "asphyxia" 2 | configurations { "Debug", "Release" } 3 | system "windows" 4 | architecture "x64" 5 | 6 | project "cstrike" 7 | location "cstrike" 8 | targetname "cstrike" 9 | kind "SharedLib" 10 | defines { "NOMINMAX"} 11 | language "C++" 12 | cppdialect "c++20" 13 | 14 | -- specify physical include file paths 15 | files 16 | { 17 | "cstrike/**.cpp", 18 | "cstrike/**.h", 19 | 20 | -- core [features, sdk, etc...] 21 | "cstrike/core/**.cpp", 22 | "cstrike/core/**.h", 23 | 24 | -- features 25 | "cstrike/features/**.h", 26 | "cstrike/features/**.cpp", 27 | "cstrike/features/misc/**.h", 28 | "cstrike/features/misc/**.cpp", 29 | "cstrike/features/visuals/**.h", 30 | "cstrike/features/visuals/**.cpp", 31 | 32 | -- sdk 33 | "cstrike/sdk/**.h", 34 | "cstrike/sdk/**.cpp", 35 | "cstrike/sdk/datatypes/**.h", 36 | "cstrike/sdk/datatypes/**.cpp", 37 | "cstrike/sdk/interfaces/**.h", 38 | "cstrike/sdk/interfaces/**.cpp", 39 | 40 | -- utilities 41 | "cstrike/utilities/**.h", 42 | "cstrike/utilities/**.cpp", 43 | 44 | 45 | -- general like: stb_X library, xor_str, etc... 46 | "dependencies/*.h", 47 | "dependencies/*.hpp", 48 | 49 | -- imgui 50 | "dependencies/imgui/**.cpp", 51 | "dependencies/imgui/**.h", 52 | 53 | -- minhook 54 | "dependencies/minhook/**.h", 55 | "dependencies/minhook/**.c", 56 | "dependencies/minhook/hde/**.h", 57 | "dependencies/minhook/hde/**.c", 58 | 59 | -- extension 60 | "extension/**.h", 61 | 62 | -- resources [fonts, images, etc...] 63 | "resources/*.h" 64 | } 65 | 66 | -- specify virtual filter file paths 67 | vpaths 68 | { 69 | { ["*"] = "cstrike/*" }, 70 | 71 | -- core [features, sdk, etc...] 72 | { ["core/*"] = "cstrike/core/*" }, 73 | -- utilities 74 | { ["utilities/*"] = "cstrike/utilities/*" }, 75 | 76 | -- dependencies 77 | { ["dependencies/*"] = "dependencies/*" }, 78 | { ["dependencies/imgui/*"] = "dependencies/imgui/*" }, 79 | { ["dependencies/safetyhook/*"] = "dependencies/safetyhook/*" }, 80 | 81 | -- extension 82 | { ["extension/*"] = "extension/*" }, 83 | 84 | -- resources [fonts, images, etc...] 85 | { ["resources/*"] = "resources/*.h" } 86 | } 87 | 88 | -- @note: use the "!" prefix to force a specific directory using msvs's provided environment variables instead of premake tokens 89 | targetdir "$(SolutionDir)build/$(Configuration)/" 90 | objdir "!$(SolutionDir)intermediate/$(ProjectName)/$(Configuration)/" 91 | implibname "$(OutDir)$(TargetName)" 92 | 93 | -- link 94 | includedirs { 95 | "$(SolutionDir)dependencies", 96 | "$(SolutionDir)dependencies/freetype/include", 97 | } 98 | 99 | libdirs { "$(SolutionDir)dependencies/freetype/binary" } 100 | links { "d3d11.lib" } 101 | flags { "MultiProcessorCompile", "NoImportLib", "NoManifest", "NoPCH" } -- @test: NoImplicitLink 102 | 103 | -- compile 104 | conformancemode "on" 105 | editandcontinue "off" 106 | entrypoint "CoreEntryPoint" 107 | exceptionhandling "off" 108 | staticruntime "on" 109 | symbols "full" 110 | 111 | -- configuration specific 112 | filter "configurations:Debug" 113 | defines { "_DEBUG" } 114 | flags { "NoIncrementalLink" } 115 | justmycode "off" 116 | rtti "on" 117 | links { "freetype_debug.lib" } 118 | --sanitize { "Address" } --@test 119 | 120 | filter "configurations:Release" 121 | defines { "NDEBUG" } 122 | flags { "LinkTimeOptimization" } -- @test: NoRuntimeChecks 123 | optimize "speed" 124 | rtti "off" 125 | links { "freetype.lib" } 126 | --buildoptions { "/Zc:threadSafeInit-" }-- @test: "/Zc:threadSafeInit-" to disable thread-safe local static initialization ('__Init_thread_header'/'__Init_thread_footer' calls) 127 | -------------------------------------------------------------------------------- /dependencies/minhook/trampoline.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MinHook - The Minimalistic API Hooking Library for x64/x86 3 | * Copyright (C) 2009-2017 Tsuda Kageyu. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 20 | * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #pragma once 30 | 31 | #pragma pack(push, 1) 32 | 33 | // Structs for writing x86/x64 instructions. 34 | 35 | // 8-bit relative jump. 36 | typedef struct _JMP_REL_SHORT 37 | { 38 | UINT8 opcode; // EB xx: JMP +2+xx 39 | UINT8 operand; 40 | } JMP_REL_SHORT, * PJMP_REL_SHORT; 41 | 42 | // 32-bit direct relative jump/call. 43 | typedef struct _JMP_REL 44 | { 45 | UINT8 opcode; // E9/E8 xxxxxxxx: JMP/CALL +5+xxxxxxxx 46 | UINT32 operand; // Relative destination address 47 | } JMP_REL, * PJMP_REL, CALL_REL; 48 | 49 | // 64-bit indirect absolute jump. 50 | typedef struct _JMP_ABS 51 | { 52 | UINT8 opcode0; // FF25 00000000: JMP [+6] 53 | UINT8 opcode1; 54 | UINT32 dummy; 55 | UINT64 address; // Absolute destination address 56 | } JMP_ABS, * PJMP_ABS; 57 | 58 | // 64-bit indirect absolute call. 59 | typedef struct _CALL_ABS 60 | { 61 | UINT8 opcode0; // FF15 00000002: CALL [+6] 62 | UINT8 opcode1; 63 | UINT32 dummy0; 64 | UINT8 dummy1; // EB 08: JMP +10 65 | UINT8 dummy2; 66 | UINT64 address; // Absolute destination address 67 | } CALL_ABS; 68 | 69 | // 32-bit direct relative conditional jumps. 70 | typedef struct _JCC_REL 71 | { 72 | UINT8 opcode0; // 0F8* xxxxxxxx: J** +6+xxxxxxxx 73 | UINT8 opcode1; 74 | UINT32 operand; // Relative destination address 75 | } JCC_REL; 76 | 77 | // 64bit indirect absolute conditional jumps that x64 lacks. 78 | typedef struct _JCC_ABS 79 | { 80 | UINT8 opcode; // 7* 0E: J** +16 81 | UINT8 dummy0; 82 | UINT8 dummy1; // FF25 00000000: JMP [+6] 83 | UINT8 dummy2; 84 | UINT32 dummy3; 85 | UINT64 address; // Absolute destination address 86 | } JCC_ABS; 87 | 88 | #pragma pack(pop) 89 | 90 | typedef struct _TRAMPOLINE 91 | { 92 | LPVOID pTarget; // [In] Address of the target function. 93 | LPVOID pDetour; // [In] Address of the detour function. 94 | LPVOID pTrampoline; // [In] Buffer address for the trampoline and relay function. 95 | 96 | #if defined(_M_X64) || defined(__x86_64__) 97 | LPVOID pRelay; // [Out] Address of the relay function. 98 | #endif 99 | BOOL patchAbove; // [Out] Should use the hot patch area? 100 | UINT nIP; // [Out] Number of the instruction boundaries. 101 | UINT8 oldIPs[8]; // [Out] Instruction boundaries of the target function. 102 | UINT8 newIPs[8]; // [Out] Instruction boundaries of the trampoline function. 103 | } TRAMPOLINE, * PTRAMPOLINE; 104 | 105 | BOOL CreateTrampolineFunction(PTRAMPOLINE ct); 106 | -------------------------------------------------------------------------------- /cstrike/utilities/inputsystem.cpp: -------------------------------------------------------------------------------- 1 | // used: get_x_lparam, get_y_lparam 2 | #include 3 | 4 | #include "inputsystem.h" 5 | 6 | // used: menu open/panic keys 7 | #include "../core/variables.h" 8 | // used: wndproc hook 9 | #include "../core/hooks.h" 10 | // used: menu variables 11 | #include "../core/menu.h" 12 | // used: iinputsystem 13 | #include "../core/interfaces.h" 14 | #include "../sdk/interfaces/iinputsystem.h" 15 | 16 | // used: [ext] imrect 17 | #include "../dependencies/imgui/imgui_internal.h" 18 | 19 | static BOOL CALLBACK EnumWindowsCallback(HWND handle, LPARAM lParam) 20 | { 21 | const auto MainWindow = [handle]() 22 | { 23 | return GetWindow(handle, GW_OWNER) == nullptr && 24 | IsWindowVisible(handle) && handle != GetConsoleWindow(); 25 | }; 26 | 27 | DWORD nPID = 0; 28 | GetWindowThreadProcessId(handle, &nPID); 29 | 30 | if (GetCurrentProcessId() != nPID || !MainWindow()) 31 | return TRUE; 32 | 33 | *reinterpret_cast(lParam) = handle; 34 | return FALSE; 35 | } 36 | 37 | bool IPT::Setup() 38 | { 39 | while (hWindow == nullptr) 40 | { 41 | EnumWindows(::EnumWindowsCallback, reinterpret_cast(&hWindow)); 42 | ::Sleep(200U); 43 | } 44 | 45 | // change window message handle to our 46 | pOldWndProc = reinterpret_cast(SetWindowLongPtrW(hWindow, GWLP_WNDPROC, reinterpret_cast(H::WndProc))); 47 | if (pOldWndProc == nullptr) 48 | return false; 49 | 50 | return true; 51 | } 52 | 53 | void IPT::Destroy() 54 | { 55 | MENU::bMainWindowOpened = false; 56 | ::Sleep(200U); 57 | 58 | if (pOldWndProc != nullptr) 59 | { 60 | SetWindowLongPtrW(hWindow, GWLP_WNDPROC, reinterpret_cast(pOldWndProc)); 61 | pOldWndProc = nullptr; 62 | } 63 | } 64 | 65 | bool IPT::OnWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) 66 | { 67 | // prevent process when e.g. binding something in-menu 68 | if (wParam != C_GET(unsigned int, Vars.nMenuKey) && wParam != C_GET(unsigned int, Vars.nPanicKey) && MENU::bMainWindowOpened) 69 | return false; 70 | 71 | // current active key 72 | int nKey = 0; 73 | // current active key state 74 | KeyState_t state = KEY_STATE_NONE; 75 | 76 | switch (uMsg) 77 | { 78 | case WM_KEYDOWN: 79 | case WM_SYSKEYDOWN: 80 | if (wParam < 256U) 81 | { 82 | nKey = static_cast(wParam); 83 | state = KEY_STATE_DOWN; 84 | } 85 | break; 86 | case WM_KEYUP: 87 | case WM_SYSKEYUP: 88 | if (wParam < 256U) 89 | { 90 | nKey = static_cast(wParam); 91 | state = KEY_STATE_UP; 92 | } 93 | break; 94 | case WM_LBUTTONDOWN: 95 | case WM_LBUTTONUP: 96 | case WM_LBUTTONDBLCLK: 97 | nKey = VK_LBUTTON; 98 | state = uMsg == WM_LBUTTONUP ? KEY_STATE_UP : KEY_STATE_DOWN; 99 | break; 100 | case WM_RBUTTONDOWN: 101 | case WM_RBUTTONUP: 102 | case WM_RBUTTONDBLCLK: 103 | nKey = VK_RBUTTON; 104 | state = uMsg == WM_RBUTTONUP ? KEY_STATE_UP : KEY_STATE_DOWN; 105 | break; 106 | case WM_MBUTTONDOWN: 107 | case WM_MBUTTONUP: 108 | case WM_MBUTTONDBLCLK: 109 | nKey = VK_MBUTTON; 110 | state = uMsg == WM_MBUTTONUP ? KEY_STATE_UP : KEY_STATE_DOWN; 111 | break; 112 | case WM_XBUTTONDOWN: 113 | case WM_XBUTTONUP: 114 | case WM_XBUTTONDBLCLK: 115 | nKey = (GET_XBUTTON_WPARAM(wParam) == XBUTTON1 ? VK_XBUTTON1 : VK_XBUTTON2); 116 | state = uMsg == WM_XBUTTONUP ? KEY_STATE_UP : KEY_STATE_DOWN; 117 | break; 118 | default: 119 | return false; 120 | } 121 | 122 | // save key states 123 | if (state == KEY_STATE_UP && arrKeyState[nKey] == KEY_STATE_DOWN) // if swap states it will be pressed state 124 | arrKeyState[nKey] = KEY_STATE_RELEASED; 125 | else 126 | arrKeyState[nKey] = state; 127 | 128 | return true; 129 | } 130 | 131 | bool IPT::GetBindState(KeyBind_t& keyBind) 132 | { 133 | if (keyBind.uKey == 0U) 134 | return false; 135 | 136 | switch (keyBind.nMode) 137 | { 138 | case EKeyBindMode::HOLD: 139 | keyBind.bEnable = IsKeyDown(keyBind.uKey); 140 | break; 141 | case EKeyBindMode::TOGGLE: 142 | if (IsKeyReleased(keyBind.uKey)) 143 | keyBind.bEnable = !keyBind.bEnable; 144 | break; 145 | } 146 | 147 | return keyBind.bEnable; 148 | } 149 | 150 | bool IPT::IsHovered(const ImVec2& vecPosition, const ImVec2& vecSize) 151 | { 152 | const ImVec2 vecMousePosition = ImGui::GetMousePos(); 153 | return ImRect(vecPosition, vecPosition + vecSize).Contains(vecMousePosition); 154 | } 155 | -------------------------------------------------------------------------------- /dependencies/freetype/include/freetype/internal/services/svmetric.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * svmetric.h 4 | * 5 | * The FreeType services for metrics variations (specification). 6 | * 7 | * Copyright (C) 2016-2019 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef SVMETRIC_H_ 20 | #define SVMETRIC_H_ 21 | 22 | #include FT_INTERNAL_SERVICE_H 23 | 24 | 25 | FT_BEGIN_HEADER 26 | 27 | 28 | /* 29 | * A service to manage the `HVAR, `MVAR', and `VVAR' OpenType tables. 30 | * 31 | */ 32 | 33 | #define FT_SERVICE_ID_METRICS_VARIATIONS "metrics-variations" 34 | 35 | 36 | /* HVAR */ 37 | 38 | typedef FT_Error 39 | (*FT_HAdvance_Adjust_Func)( FT_Face face, 40 | FT_UInt gindex, 41 | FT_Int *avalue ); 42 | 43 | typedef FT_Error 44 | (*FT_LSB_Adjust_Func)( FT_Face face, 45 | FT_UInt gindex, 46 | FT_Int *avalue ); 47 | 48 | typedef FT_Error 49 | (*FT_RSB_Adjust_Func)( FT_Face face, 50 | FT_UInt gindex, 51 | FT_Int *avalue ); 52 | 53 | /* VVAR */ 54 | 55 | typedef FT_Error 56 | (*FT_VAdvance_Adjust_Func)( FT_Face face, 57 | FT_UInt gindex, 58 | FT_Int *avalue ); 59 | 60 | typedef FT_Error 61 | (*FT_TSB_Adjust_Func)( FT_Face face, 62 | FT_UInt gindex, 63 | FT_Int *avalue ); 64 | 65 | typedef FT_Error 66 | (*FT_BSB_Adjust_Func)( FT_Face face, 67 | FT_UInt gindex, 68 | FT_Int *avalue ); 69 | 70 | typedef FT_Error 71 | (*FT_VOrg_Adjust_Func)( FT_Face face, 72 | FT_UInt gindex, 73 | FT_Int *avalue ); 74 | 75 | /* MVAR */ 76 | 77 | typedef void 78 | (*FT_Metrics_Adjust_Func)( FT_Face face ); 79 | 80 | 81 | FT_DEFINE_SERVICE( MetricsVariations ) 82 | { 83 | FT_HAdvance_Adjust_Func hadvance_adjust; 84 | FT_LSB_Adjust_Func lsb_adjust; 85 | FT_RSB_Adjust_Func rsb_adjust; 86 | 87 | FT_VAdvance_Adjust_Func vadvance_adjust; 88 | FT_TSB_Adjust_Func tsb_adjust; 89 | FT_BSB_Adjust_Func bsb_adjust; 90 | FT_VOrg_Adjust_Func vorg_adjust; 91 | 92 | FT_Metrics_Adjust_Func metrics_adjust; 93 | }; 94 | 95 | 96 | #define FT_DEFINE_SERVICE_METRICSVARIATIONSREC( class_, \ 97 | hadvance_adjust_, \ 98 | lsb_adjust_, \ 99 | rsb_adjust_, \ 100 | vadvance_adjust_, \ 101 | tsb_adjust_, \ 102 | bsb_adjust_, \ 103 | vorg_adjust_, \ 104 | metrics_adjust_ ) \ 105 | static const FT_Service_MetricsVariationsRec class_ = \ 106 | { \ 107 | hadvance_adjust_, \ 108 | lsb_adjust_, \ 109 | rsb_adjust_, \ 110 | vadvance_adjust_, \ 111 | tsb_adjust_, \ 112 | bsb_adjust_, \ 113 | vorg_adjust_, \ 114 | metrics_adjust_ \ 115 | }; 116 | 117 | /* */ 118 | 119 | 120 | FT_END_HEADER 121 | 122 | #endif /* SVMETRIC_H_ */ 123 | 124 | 125 | /* END */ 126 | -------------------------------------------------------------------------------- /cstrike/core/variables.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "config.h" 4 | 5 | #pragma region variables_combo_entries 6 | using VisualOverlayBox_t = int; 7 | 8 | enum EVisualOverlayBox : VisualOverlayBox_t 9 | { 10 | VISUAL_OVERLAY_BOX_NONE = 0, 11 | VISUAL_OVERLAY_BOX_FULL, 12 | VISUAL_OVERLAY_BOX_CORNERS, 13 | VISUAL_OVERLAY_BOX_MAX 14 | }; 15 | 16 | using VisualChamMaterial_t = int; 17 | enum EVisualsChamMaterials : VisualChamMaterial_t 18 | { 19 | VISUAL_MATERIAL_PRIMARY_WHITE = 0, 20 | VISUAL_MATERIAL_ILLUMINATE, 21 | VISUAL_MATERIAL_MAX 22 | }; 23 | 24 | using MiscDpiScale_t = int; 25 | 26 | enum EMiscDpiScale : MiscDpiScale_t 27 | { 28 | MISC_DPISCALE_DEFAULT = 0, 29 | MISC_DPISCALE_125, 30 | MISC_DPISCALE_150, 31 | MISC_DPISCALE_175, 32 | MISC_DPISCALE_200, 33 | MISC_DPISCALE_MAX 34 | }; 35 | 36 | #pragma endregion 37 | 38 | #pragma region variables_multicombo_entries 39 | using MenuAddition_t = unsigned int; 40 | enum EMenuAddition : MenuAddition_t 41 | { 42 | MENU_ADDITION_NONE = 0U, 43 | MENU_ADDITION_DIM_BACKGROUND = 1 << 0, 44 | MENU_ADDITION_BACKGROUND_PARTICLE = 1 << 1, 45 | MENU_ADDITION_GLOW = 1 << 2, 46 | MENU_ADDITION_ALL = MENU_ADDITION_DIM_BACKGROUND | MENU_ADDITION_BACKGROUND_PARTICLE | MENU_ADDITION_GLOW 47 | }; 48 | #pragma endregion 49 | 50 | struct Variables_t 51 | { 52 | #pragma region variables_visuals 53 | C_ADD_VARIABLE(bool, bVisualOverlay, false); 54 | 55 | C_ADD_VARIABLE(FrameOverlayVar_t, overlayBox, FrameOverlayVar_t(false)); 56 | C_ADD_VARIABLE(TextOverlayVar_t, overlayName, TextOverlayVar_t(false)); 57 | C_ADD_VARIABLE(BarOverlayVar_t, overlayHealthBar, BarOverlayVar_t(false, false, false, 1.f, Color_t(0, 255, 0), Color_t(255, 0, 0))); 58 | C_ADD_VARIABLE(BarOverlayVar_t, overlayArmorBar, BarOverlayVar_t(false, false, false, 1.f, Color_t(0, 255, 255), Color_t(255, 0, 0))); 59 | 60 | C_ADD_VARIABLE(bool, bVisualChams, false); 61 | C_ADD_VARIABLE(int, nVisualChamMaterial, VISUAL_MATERIAL_PRIMARY_WHITE); 62 | C_ADD_VARIABLE(bool, bVisualChamsIgnoreZ, false); // invisible chams 63 | C_ADD_VARIABLE(Color_t, colVisualChams, Color_t(0, 255, 0)); 64 | C_ADD_VARIABLE(Color_t, colVisualChamsIgnoreZ, Color_t(255, 0, 0)); 65 | #pragma endregion 66 | 67 | #pragma region variables_misc 68 | C_ADD_VARIABLE(bool, bAntiUntrusted, true); 69 | C_ADD_VARIABLE(bool, bWatermark, true); 70 | 71 | C_ADD_VARIABLE(bool, bAutoBHop, false); 72 | C_ADD_VARIABLE(int, nAutoBHopChance, 100); 73 | 74 | C_ADD_VARIABLE(bool, bAutoStrafe, false); 75 | #pragma endregion 76 | 77 | #pragma region variables_menu 78 | C_ADD_VARIABLE(unsigned int, nMenuKey, VK_INSERT); 79 | C_ADD_VARIABLE(unsigned int, nPanicKey, VK_END); 80 | C_ADD_VARIABLE(int, nDpiScale, 0); 81 | 82 | /* 83 | * color navigation: 84 | * [definition N][purpose] 85 | * 1. primitive: 86 | * - primtv 0 (text) 87 | * - primtv 1 (background) 88 | * - primtv 2 (disabled) 89 | * - primtv 3 (control bg) 90 | * - primtv 4 (border) 91 | * - primtv 5 (hover) 92 | * 93 | * 2. accents: 94 | * - accent 0 (main) 95 | * - accent 1 (dark) 96 | * - accent 2 (darker) 97 | */ 98 | C_ADD_VARIABLE(unsigned int, bMenuAdditional, MENU_ADDITION_ALL); 99 | C_ADD_VARIABLE(float, flAnimationSpeed, 1.f); 100 | 101 | 102 | C_ADD_VARIABLE(ColorPickerVar_t, colPrimtv0, ColorPickerVar_t(255, 255, 255)); // (text) 103 | C_ADD_VARIABLE(ColorPickerVar_t, colPrimtv1, ColorPickerVar_t(50, 55, 70)); // (background) 104 | C_ADD_VARIABLE(ColorPickerVar_t, colPrimtv2, ColorPickerVar_t(190, 190, 190)); // (disabled) 105 | C_ADD_VARIABLE(ColorPickerVar_t, colPrimtv3, ColorPickerVar_t(20, 20, 30)); // (control bg) 106 | C_ADD_VARIABLE(ColorPickerVar_t, colPrimtv4, ColorPickerVar_t(0, 0, 0)); // (border) 107 | 108 | C_ADD_VARIABLE(ColorPickerVar_t, colAccent0, ColorPickerVar_t(85, 90, 160)); // (main) 109 | C_ADD_VARIABLE(ColorPickerVar_t, colAccent1, ColorPickerVar_t(100, 105, 175)); // (dark) 110 | C_ADD_VARIABLE(ColorPickerVar_t, colAccent2, ColorPickerVar_t(115, 120, 190)); // (darker) 111 | #pragma endregion 112 | #pragma region variables_legitbot 113 | C_ADD_VARIABLE(bool, bLegitbot, false); 114 | C_ADD_VARIABLE(float, flSmoothing, 10.0f); 115 | C_ADD_VARIABLE(float, aim_range, 5.f); 116 | C_ADD_VARIABLE(bool, bLegitbotAlwaysOn, false); 117 | C_ADD_VARIABLE(unsigned int, nLegitbotActivationKey, VK_HOME); 118 | #pragma endregion 119 | }; 120 | 121 | inline Variables_t Vars = {}; 122 | -------------------------------------------------------------------------------- /cstrike/utilities/notify.cpp: -------------------------------------------------------------------------------- 1 | #include "notify.h" 2 | 3 | // used: cheat variables 4 | #include "../core/variables.h" 5 | // used: menu::bMainWindowOpened 6 | #include "../core/menu.h" 7 | // used: [resources] font awesome icons definitions 8 | #include "../../resources/font_awesome_5.h" 9 | // used: easingg library 10 | #include "easing.h" 11 | 12 | inline static const float GetTime() noexcept 13 | { 14 | return static_cast(clock() / 1000.f); 15 | } 16 | 17 | inline static bool IsEmptyOrNullptr(const char* szText) 18 | { 19 | return szText == nullptr || szText[0] == '\0'; 20 | } 21 | 22 | NOTIFY::NotificationData_t::NotificationData_t(ENotificationType nType, const char* szFormat, ...) : 23 | nType(nType), flCreateionTime(GetTime()), animHandler(&EASING::InQuad, &EASING::OutQuad) 24 | { 25 | va_list args; 26 | va_start(args, szFormat); 27 | stbsp_vsnprintf(this->szBuffer, sizeof(szBuffer), szFormat, args); 28 | va_end(args); 29 | } 30 | 31 | const Color_t& NOTIFY::NotificationData_t::GetTypeColor() const 32 | { 33 | switch (nType) 34 | { 35 | case N_TYPE_INFO: 36 | // cyan 37 | return Color_t(0, 255, 255); 38 | case N_TYPE_SUCCESS: 39 | // green 40 | return Color_t(0, 255, 0); 41 | case N_TYPE_WARNING: 42 | // yellow 43 | return Color_t(255, 255, 0); 44 | case N_TYPE_ERROR: 45 | // red 46 | return Color_t(255, 0, 0); 47 | default: 48 | // white 49 | return Color_t(255, 255, 255); 50 | } 51 | } 52 | 53 | const char* NOTIFY::NotificationData_t::Data() const 54 | { 55 | return this->szBuffer; 56 | } 57 | 58 | const char* NOTIFY::NotificationData_t::GetIcon() const 59 | { 60 | switch (nType) 61 | { 62 | case N_TYPE_INFO: 63 | return ICON_FA_INFO; 64 | case N_TYPE_SUCCESS: 65 | return ICON_FA_CHECK; 66 | case N_TYPE_WARNING: 67 | return ICON_FA_EXCLAMATION; 68 | case N_TYPE_ERROR: 69 | return ICON_FA_TIMES; 70 | default: 71 | return nullptr; 72 | } 73 | } 74 | 75 | const float NOTIFY::NotificationData_t::GetTimeDelta(const float flCurrentTime) const 76 | { 77 | return flCurrentTime - this->flCreateionTime; 78 | } 79 | 80 | void NOTIFY::Push(const NotificationData_t& notification) 81 | { 82 | vecNotifications.push_back(notification); 83 | } 84 | 85 | void NOTIFY::_Remove(size_t nIndex) 86 | { 87 | vecNotifications.erase(vecNotifications.begin() + nIndex); 88 | } 89 | 90 | void NOTIFY::Render() 91 | { 92 | if (vecNotifications.empty()) 93 | return; 94 | 95 | ImGuiStyle& style = ImGui::GetStyle(); 96 | ImGuiIO& io = ImGui::GetIO(); 97 | 98 | // padding with menu watermark 99 | float flPaddingY = (MENU::bMainWindowOpened && C_GET(bool, Vars.bWatermark)) ? ImGui::GetFrameHeight() : 0.f; 100 | 101 | for (size_t i = 0U; i < vecNotifications.size(); i++) 102 | { 103 | NotificationData_t* pData = &vecNotifications[i]; 104 | 105 | // shouldn't happen, but maybe it does 106 | if (IsEmptyOrNullptr(pData->Data())) 107 | continue; 108 | 109 | // handling animation 110 | const float flTimeDelta = pData->GetTimeDelta(GetTime()); 111 | pData->animHandler.Update(io.DeltaTime, style.AnimationSpeed); 112 | 113 | if (flTimeDelta >= (_MAX_TIME - 0.25f)) 114 | pData->animHandler.SetSwitch(false); 115 | else if (flTimeDelta <= 0.25f) 116 | pData->animHandler.SetSwitch(true); 117 | 118 | const float flAnimValue = pData->animHandler.GetValue(1.f); 119 | 120 | // if animation is done, remove notification 121 | if (!pData->animHandler.GetSwitch()) 122 | { 123 | _Remove(i); 124 | continue; 125 | } 126 | 127 | // render frame and notification 128 | CRT::String_t<32U> szWindowName(CS_XOR("notification##%d"), i); 129 | ImGui::SetNextWindowPos(ImVec2(style.WindowPadding.x * flAnimValue, flPaddingY * flAnimValue), ImGuiCond_Always); 130 | ImGui::Begin(szWindowName.Data(), nullptr, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_NoInputs | ImGuiWindowFlags_NoNav | ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_NoFocusOnAppearing); 131 | { 132 | if (const char* szIcon = pData->GetIcon(); szIcon != nullptr) 133 | { 134 | ImGui::TextColored(pData->GetTypeColor().GetVec4(flAnimValue), szIcon); 135 | ImGui::SameLine(); 136 | } 137 | 138 | ImGui::TextColored(C_GET(ColorPickerVar_t, Vars.colPrimtv0).colValue.GetVec4(flAnimValue), pData->Data()); 139 | 140 | flPaddingY += ImGui::GetWindowHeight(); 141 | } 142 | ImGui::End(); 143 | } 144 | } -------------------------------------------------------------------------------- /cstrike/sdk/interfaces/imaterialsystem.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // used: call virtual function 4 | #include "../../utilities/memory.h" 5 | 6 | // used: color_t 7 | #include "../datatypes/color.h" 8 | // used: stronghandle 9 | #include "../datatypes/stronghandle.h" 10 | // used: keyvalue3 11 | #include "../datatypes/keyvalue3.h" 12 | // used vector4d_t 13 | #include "../datatypes/vector.h" 14 | 15 | // used: cbasehandle 16 | #include "../entity_handle.h" 17 | 18 | class CMaterial2 19 | { 20 | public: 21 | virtual const char* GetName() = 0; 22 | virtual const char* GetShareName() = 0; 23 | }; 24 | 25 | // idk 26 | struct MaterialKeyVar_t 27 | { 28 | std::uint64_t uKey; 29 | const char* szName; 30 | 31 | MaterialKeyVar_t(std::uint64_t uKey, const char* szName) : 32 | uKey(uKey), szName(szName) { } 33 | 34 | MaterialKeyVar_t(const char* szName, bool bShouldFindKey = false) : 35 | szName(szName) 36 | { 37 | uKey = bShouldFindKey ? FindKey(szName) : 0x0; 38 | } 39 | 40 | std::uint64_t FindKey(const char* szName) 41 | { 42 | using fnFindKeyVar = std::uint64_t(CS_FASTCALL*)(const char*, unsigned int, int); 43 | static auto oFindKeyVar = reinterpret_cast(MEM::FindPattern(PARTICLES_DLL, CS_XOR("48 89 5C 24 ? 57 48 81 EC ? ? ? ? 33 C0 8B DA"))); 44 | 45 | #ifdef CS_PARANOID 46 | CS_ASSERT(oFindKeyVar != nullptr); 47 | #endif 48 | 49 | // idk those enum flags, just saw it called like that soooo yea 50 | return oFindKeyVar(szName, 0x12, 0x31415926); 51 | } 52 | }; 53 | 54 | class CObjectInfo 55 | { 56 | MEM_PAD(0xB0); 57 | int nId; 58 | }; 59 | 60 | class CSceneAnimatableObject 61 | { 62 | MEM_PAD(0xB8); 63 | CBaseHandle hOwner; 64 | }; 65 | 66 | // the naming is incorrect but i dont care atm 67 | class CMeshData 68 | { 69 | public: 70 | void SetShaderType(const char* szShaderName) 71 | { 72 | // @ida: #STR: shader, spritecard.vfx 73 | using fnSetMaterialShaderType = void(CS_FASTCALL*)(void*, MaterialKeyVar_t, const char*, int); 74 | static auto oSetMaterialShaderType = reinterpret_cast(MEM::FindPattern(PARTICLES_DLL, CS_XOR("48 89 5C 24 ? 48 89 6C 24 ? 56 57 41 54 41 56 41 57 48 83 EC ? 0F B6 01 45 0F B6 F9 8B 2A 4D 8B E0 4C 8B 72 ? 48 8B F9 C0 E8 ? 24 ? 3C ? 74 ? 41 B0 ? B2 ? E8 ? ? ? ? 0F B6 07 33 DB C0 E8 ? 24 ? 3C ? 75 ? 48 8B 77 ? EB ? 48 8B F3 4C 8D 44 24 ? C7 44 24 ? ? ? ? ? 48 8D 54 24 ? 89 6C 24 ? 48 8B CE 4C 89 74 24 ? E8 ? ? ? ? 8B D0 83 F8 ? 75 ? 45 33 C9 89 6C 24 ? 4C 8D 44 24 ? 4C 89 74 24 ? 48 8B D7 48 8B CE E8 ? ? ? ? 8B D0 0F B6 0F C0 E9 ? 80 E1 ? 80 F9 ? 75 ? 48 8B 4F ? EB ? 48 8B CB 8B 41 ? 85 C0 74 ? 48 8D 59 ? 83 F8 ? 76 ? 48 8B 1B 48 63 C2 4D 85 E4"))); 75 | 76 | #ifdef CS_PARANOID 77 | CS_ASSERT(oSetMaterialShaderType != nullptr); 78 | #endif 79 | 80 | MaterialKeyVar_t shaderVar(0x162C1777, CS_XOR("shader")); 81 | oSetMaterialShaderType(this, shaderVar, szShaderName, 0x18); 82 | } 83 | 84 | void SetMaterialFunction(const char* szFunctionName, int nValue) 85 | { 86 | using fnSetMaterialFunction = void(__fastcall*)(void*, MaterialKeyVar_t, int, int); 87 | static auto oSetMaterialFunction = reinterpret_cast(MEM::FindPattern(PARTICLES_DLL, CS_XOR("48 89 5C 24 ? 48 89 6C 24 ? 56 57 41 54 41 56 41 57 48 83 EC ? 0F B6 01 45 0F B6 F9 8B 2A 48 8B F9"))); 88 | 89 | #ifdef CS_PARANOID 90 | CS_ASSERT(oSetMaterialFunction != nullptr); 91 | #endif 92 | 93 | MaterialKeyVar_t functionVar(szFunctionName, true); 94 | oSetMaterialFunction(this, functionVar, nValue, 0x18); 95 | } 96 | 97 | MEM_PAD(0x18); // 0x0 98 | CSceneAnimatableObject* pSceneAnimatableObject; // 0x18 99 | CMaterial2* pMaterial; // 0x20 100 | MEM_PAD(0x18); // 0x28 101 | Color_t colValue; // 0x40 102 | MEM_PAD(0x4); // 0x44 103 | CObjectInfo* pObjectInfo; // 0x48 104 | }; 105 | 106 | class IMaterialSystem2 107 | { 108 | public: 109 | CMaterial2*** FindOrCreateFromResource(CMaterial2*** pOutMaterial, const char* szMaterialName) 110 | { 111 | return MEM::CallVFunc(this, pOutMaterial, szMaterialName); 112 | } 113 | 114 | CMaterial2** CreateMaterial(CMaterial2*** pOutMaterial, const char* szMaterialName, CMeshData* pData) 115 | { 116 | return MEM::CallVFunc(this, pOutMaterial, szMaterialName, pData, 0, 0, 0, 0, 0, 1); 117 | } 118 | 119 | void SetCreateDataByMaterial(const void* pData, CMaterial2*** const pInMaterial) 120 | { 121 | return MEM::CallVFunc(this, pInMaterial, pData); 122 | } 123 | }; 124 | -------------------------------------------------------------------------------- /cstrike/utilities/detourhook.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | // used: [ext] minhook 3 | // @credits: https://github.com/TsudaKageyu/minhook 4 | #include "../../dependencies/minhook/minhook.h" 5 | 6 | // used: l_print 7 | #include "log.h" 8 | 9 | template 10 | class CBaseHookObject 11 | { 12 | public: 13 | /// setup hook and replace function 14 | /// @returns: true if hook has been successfully created, false otherwise 15 | bool Create(void* pFunction, void* pDetour) 16 | { 17 | if (pFunction == nullptr || pDetour == nullptr) 18 | return false; 19 | 20 | pBaseFn = pFunction; 21 | pReplaceFn = pDetour; 22 | 23 | if (const MH_STATUS status = MH_CreateHook(pBaseFn, pReplaceFn, &pOriginalFn); status != MH_OK) 24 | { 25 | #ifdef _DEBUG 26 | L_PRINT(LOG_ERROR) << CS_XOR("failed to create hook, status: \"") << MH_StatusToString(status) << CS_XOR("\" with base address: ") << L::AddFlags(LOG_MODE_INT_SHOWBASE | LOG_MODE_INT_FORMAT_HEX) << reinterpret_cast(pBaseFn); 27 | #else 28 | L_PRINT(LOG_ERROR) << CS_XOR("failed to create hook"); 29 | #endif 30 | 31 | CS_ASSERT(false); 32 | return false; 33 | } 34 | 35 | if (!Replace()) 36 | return false; 37 | 38 | return true; 39 | } 40 | 41 | /// patch memory to jump to our function instead of original 42 | /// @returns: true if hook has been successfully applied, false otherwise 43 | bool Replace() 44 | { 45 | // check is hook has been created 46 | if (pBaseFn == nullptr) 47 | return false; 48 | 49 | // check that function isn't already hooked 50 | if (bIsHooked) 51 | return false; 52 | 53 | if (const MH_STATUS status = MH_EnableHook(pBaseFn); status != MH_OK) 54 | { 55 | #ifdef _DEBUG 56 | L_PRINT(LOG_ERROR) << CS_XOR("failed to enable hook, status: \"") << MH_StatusToString(status) << CS_XOR("\" with base address: ") << L::AddFlags(LOG_MODE_INT_SHOWBASE | LOG_MODE_INT_FORMAT_HEX) << reinterpret_cast(pBaseFn); 57 | #else 58 | L_PRINT(LOG_ERROR) << CS_XOR("failed to enable hook"); 59 | #endif 60 | 61 | CS_ASSERT(false); 62 | return false; 63 | } 64 | 65 | // switch hook state 66 | bIsHooked = true; 67 | return true; 68 | } 69 | 70 | /// restore original function call and cleanup hook data 71 | /// @returns: true if hook has been successfully removed, false otherwise 72 | bool Remove() 73 | { 74 | // restore it at first 75 | if (!Restore()) 76 | return false; 77 | 78 | if (const MH_STATUS status = MH_RemoveHook(pBaseFn); status != MH_OK) 79 | { 80 | #ifdef _DEBUG 81 | L_PRINT(LOG_ERROR) << CS_XOR("failed to remove hook, status: \"") << MH_StatusToString(status) << CS_XOR("\" with base address: ") << L::AddFlags(LOG_MODE_INT_SHOWBASE | LOG_MODE_INT_FORMAT_HEX) << reinterpret_cast(pBaseFn); 82 | #else 83 | L_PRINT(LOG_ERROR) << CS_XOR("failed to remove hook"); 84 | #endif 85 | 86 | CS_ASSERT(false); 87 | return false; 88 | } 89 | 90 | return true; 91 | } 92 | 93 | /// restore patched memory to original function call 94 | /// @returns: true if hook has been successfully restored, false otherwise 95 | bool Restore() 96 | { 97 | // check that function is hooked 98 | if (!bIsHooked) 99 | return false; 100 | 101 | if (const MH_STATUS status = MH_DisableHook(pBaseFn); status != MH_OK) 102 | { 103 | #ifdef _DEBUG 104 | L_PRINT(LOG_ERROR) << CS_XOR("failed to restore hook, status: \"") << MH_StatusToString(status) << CS_XOR("\" with base address: ") << L::AddFlags(LOG_MODE_INT_SHOWBASE | LOG_MODE_INT_FORMAT_HEX) << reinterpret_cast(pBaseFn); 105 | #else 106 | L_PRINT(LOG_ERROR) << CS_XOR("failed to restore hook"); 107 | #endif 108 | 109 | CS_ASSERT(false); 110 | return false; 111 | } 112 | 113 | // switch hook state 114 | bIsHooked = false; 115 | return true; 116 | } 117 | 118 | /// @returns: original, unwrapped function that would be called without the hook 119 | CS_INLINE T GetOriginal() 120 | { 121 | return reinterpret_cast(pOriginalFn); 122 | } 123 | 124 | /// @returns: true if hook is applied at the time, false otherwise 125 | CS_INLINE bool IsHooked() const 126 | { 127 | return bIsHooked; 128 | } 129 | 130 | private: 131 | // current hook state 132 | bool bIsHooked = false; 133 | // function base handle 134 | void* pBaseFn = nullptr; 135 | // function that being replace the original call 136 | void* pReplaceFn = nullptr; 137 | // original function 138 | void* pOriginalFn = nullptr; 139 | }; 140 | -------------------------------------------------------------------------------- /cstrike/features/visuals/chams.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | // used: stronghandle 3 | #include "../../sdk/datatypes/stronghandle.h" 4 | 5 | static constexpr char szVMatBufferWhiteVisible[] = 6 | R"( 7 | { 8 | shader = "csgo_unlitgeneric.vfx" 9 | 10 | F_PAINT_VERTEX_COLORS = 1 11 | F_TRANSLUCENT = 1 12 | F_BLEND_MODE = 1 13 | 14 | g_vColorTint = [1, 1, 1, 1] 15 | 16 | TextureAmbientOcclusion = resource:"materials/default/default_mask_tga_fde710a5.vtex" 17 | g_tAmbientOcclusion = resource:"materials/default/default_mask_tga_fde710a5.vtex" 18 | g_tColor = resource:"materials/default/default_mask_tga_fde710a5.vtex" 19 | g_tNormal = resource:"materials/default/default_mask_tga_fde710a5.vtex" 20 | g_tTintMask = resource:"materials/default/default_mask_tga_fde710a5.vtex" 21 | })"; 22 | 23 | static constexpr char szVMatBufferWhiteInvisible[] = 24 | R"( 25 | { 26 | shader = "csgo_unlitgeneric.vfx" 27 | 28 | F_PAINT_VERTEX_COLORS = 1 29 | F_TRANSLUCENT = 1 30 | F_BLEND_MODE = 1 31 | F_DISABLE_Z_BUFFERING = 1 32 | 33 | g_vColorTint = [1, 1, 1, 1] 34 | 35 | TextureAmbientOcclusion = resource:"materials/default/default_mask_tga_fde710a5.vtex" 36 | g_tAmbientOcclusion = resource:"materials/default/default_mask_tga_fde710a5.vtex" 37 | g_tColor = resource:"materials/default/default_mask_tga_fde710a5.vtex" 38 | g_tNormal = resource:"materials/default/default_mask_tga_fde710a5.vtex" 39 | g_tTintMask = resource:"materials/default/default_mask_tga_fde710a5.vtex" 40 | })"; 41 | 42 | static constexpr char szVMatBufferIlluminateVisible[] = 43 | R"( 44 | { 45 | shader = "csgo_complex.vfx" 46 | 47 | F_SELF_ILLUM = 1 48 | F_PAINT_VERTEX_COLORS = 1 49 | F_TRANSLUCENT = 1 50 | 51 | g_vColorTint = [ 1.000000, 1.000000, 1.000000, 1.000000 ] 52 | g_flSelfIllumScale = [ 3.000000, 3.000000, 3.000000, 3.000000 ] 53 | g_flSelfIllumBrightness = [ 3.000000, 3.000000, 3.000000, 3.000000 ] 54 | g_vSelfIllumTint = [ 10.000000, 10.000000, 10.000000, 10.000000 ] 55 | 56 | g_tColor = resource:"materials/default/default_mask_tga_fde710a5.vtex" 57 | g_tNormal = resource:"materials/default/default_mask_tga_fde710a5.vtex" 58 | g_tSelfIllumMask = resource:"materials/default/default_mask_tga_fde710a5.vtex" 59 | TextureAmbientOcclusion = resource:"materials/debug/particleerror.vtex" 60 | g_tAmbientOcclusion = resource:"materials/debug/particleerror.vtex" 61 | })"; 62 | 63 | static constexpr char szVMatBufferIlluminateInvisible[] = 64 | R"( 65 | { 66 | shader = "csgo_complex.vfx" 67 | 68 | F_SELF_ILLUM = 1 69 | F_PAINT_VERTEX_COLORS = 1 70 | F_TRANSLUCENT = 1 71 | F_DISABLE_Z_BUFFERING = 1 72 | 73 | g_vColorTint = [ 1.000000, 1.000000, 1.000000, 1.000000 ] 74 | g_flSelfIllumScale = [ 3.000000, 3.000000, 3.000000, 3.000000 ] 75 | g_flSelfIllumBrightness = [ 3.000000, 3.000000, 3.000000, 3.000000 ] 76 | g_vSelfIllumTint = [ 10.000000, 10.000000, 10.000000, 10.000000 ] 77 | 78 | g_tColor = resource:"materials/default/default_mask_tga_fde710a5.vtex" 79 | g_tNormal = resource:"materials/default/default_mask_tga_fde710a5.vtex" 80 | g_tSelfIllumMask = resource:"materials/default/default_mask_tga_fde710a5.vtex" 81 | TextureAmbientOcclusion = resource:"materials/debug/particleerror.vtex" 82 | g_tAmbientOcclusion = resource:"materials/debug/particleerror.vtex" 83 | })"; 84 | 85 | class CMaterial2; 86 | class CMeshData; 87 | 88 | namespace F::VISUALS::CHAMS 89 | { 90 | bool Initialize(); 91 | void Destroy(); 92 | 93 | bool OnDrawObject(void* pAnimatableSceneObjectDesc, void* pDx11, CMeshData* arrMeshDraw, int nDataCount, void* pSceneView, void* pSceneLayer, void* pUnk, void* pUnk2); 94 | 95 | // @note: bDisableZBuffering == true to create invisible material 96 | CStrongHandle CreateMaterial(const char* szMaterialName, const char szVmatBuffer[]); 97 | 98 | bool OverrideMaterial(void* pAnimatableSceneObjectDesc, void* pDx11, CMeshData* arrMeshDraw, int nDataCount, void* pSceneView, void* pSceneLayer, void* pUnk, void* pUnk2); 99 | 100 | inline bool bInitialized = false; 101 | } 102 | --------------------------------------------------------------------------------