├── .gitattributes ├── .gitignore ├── README.md ├── purpura sdk.sln └── purpura sdk ├── dll_main.cpp ├── hooks ├── hooks.cpp └── hooks.h ├── interfaces ├── interfaces.cpp └── interfaces.h ├── purpura sdk.vcxproj ├── purpura sdk.vcxproj.filters ├── purpura sdk.vcxproj.user ├── sdk ├── c_global_vars.h ├── c_input.h ├── i_app_system.h ├── i_client_entity.h ├── i_client_mode.h ├── i_panel.h ├── i_surface.h ├── iv_engine_client.h ├── sdk.h └── structs.h └── utilities ├── globals.cpp ├── globals.h ├── render_manager.cpp ├── render_manager.h ├── utilities.cpp ├── utilities.h ├── vector.h ├── vmatrix.h └── vmt.h /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.suo 2 | *.db 3 | *.opendb 4 | *.ipch 5 | *.obj 6 | *.exe 7 | *.dll 8 | *.pdb 9 | *.ilk 10 | *.log 11 | *.tlog 12 | *.idb 13 | *.iobj 14 | *.ipdb 15 | *.pdb 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # purpura sdk - for csgo 2 | 3 | this is nothing but a little public base/cheat i'm currently working on 4 | 5 | yes, you can download it and modify it to your heart's content, just credit me. 6 | 7 | 8 | important missing features as of latest commit: netvar manager, some valve stuff 9 | 10 | # looking for something more complete? 11 | 12 | check this out! https://github.com/swoopae/impact-csgo 13 | -------------------------------------------------------------------------------- /purpura sdk.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28307.136 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "purpura sdk", "purpura sdk\purpura sdk.vcxproj", "{8F406BA2-4B0A-4B01-B7B3-0B6CAB9C9247}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {8F406BA2-4B0A-4B01-B7B3-0B6CAB9C9247}.Debug|x64.ActiveCfg = Debug|x64 17 | {8F406BA2-4B0A-4B01-B7B3-0B6CAB9C9247}.Debug|x64.Build.0 = Debug|x64 18 | {8F406BA2-4B0A-4B01-B7B3-0B6CAB9C9247}.Debug|x86.ActiveCfg = Debug|Win32 19 | {8F406BA2-4B0A-4B01-B7B3-0B6CAB9C9247}.Debug|x86.Build.0 = Debug|Win32 20 | {8F406BA2-4B0A-4B01-B7B3-0B6CAB9C9247}.Release|x64.ActiveCfg = Release|x64 21 | {8F406BA2-4B0A-4B01-B7B3-0B6CAB9C9247}.Release|x64.Build.0 = Release|x64 22 | {8F406BA2-4B0A-4B01-B7B3-0B6CAB9C9247}.Release|x86.ActiveCfg = Release|Win32 23 | {8F406BA2-4B0A-4B01-B7B3-0B6CAB9C9247}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {864969A8-41D7-49A6-97C4-0866DF022C33} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /purpura sdk/dll_main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "utilities/utilities.h" 6 | #include "interfaces/interfaces.h" 7 | #include "utilities/render_manager.h" 8 | #include "hooks/hooks.h" 9 | 10 | VOID WINAPI setup_debug_console ( ) { 11 | 12 | AllocConsole(); 13 | 14 | freopen_s((FILE**)stdin, "CONIN$", "r", stdin); 15 | freopen_s((FILE**)stdout, "CONOUT$", "w", stdout); 16 | 17 | SetConsoleTitleA( "[purpura sdk] console: " ); 18 | 19 | } 20 | 21 | DWORD WINAPI dll_setup ( HINSTANCE module_handle ) { 22 | 23 | setup_debug_console ( ); 24 | 25 | global_utils::console_log ( "purpura console loaded." ); 26 | 27 | interfaces::init ( ); 28 | render_manager::init ( ); 29 | hooks::init ( ); 30 | 31 | while ( true ) { 32 | 33 | using namespace std::literals::chrono_literals; 34 | std::this_thread::sleep_for(1s); 35 | 36 | if ( GetAsyncKeyState ( VK_DELETE ) ) { 37 | 38 | fclose( ( FILE* ) stdin ); 39 | fclose( ( FILE* ) stdout ); 40 | 41 | HWND hw_ConsoleHwnd = GetConsoleWindow(); 42 | 43 | FreeConsole( ); 44 | PostMessageW( hw_ConsoleHwnd, WM_CLOSE, 0, 0 ); 45 | 46 | hooks::restore ( ); 47 | 48 | FreeLibraryAndExitThread( module_handle, 1 ); 49 | 50 | } 51 | } 52 | } 53 | 54 | BOOL APIENTRY DllMain( HMODULE module, DWORD reason_for_call, LPVOID reserved ) { 55 | 56 | switch ( reason_for_call ) { 57 | 58 | case DLL_PROCESS_ATTACH: 59 | 60 | DisableThreadLibraryCalls ( module ); 61 | CreateThread ( NULL, NULL, ( LPTHREAD_START_ROUTINE ) dll_setup, NULL, NULL, NULL ); 62 | break; 63 | 64 | } 65 | 66 | return TRUE; 67 | 68 | } -------------------------------------------------------------------------------- /purpura sdk/hooks/hooks.cpp: -------------------------------------------------------------------------------- 1 | #include "hooks.h" 2 | #include "../utilities/globals.h" 3 | #include "../utilities/render_manager.h" 4 | 5 | std::unique_ptr client_mode_hook; 6 | std::unique_ptr panel_hook; 7 | 8 | void hooks::init() { 9 | 10 | global_utils::console_log("initialising hooks..."); 11 | 12 | client_mode_hook = std::make_unique( interfaces::client_mode ); 13 | panel_hook = std::make_unique( interfaces::panel ); 14 | 15 | global_utils::console_log("hooks initialised, have fun!"); 16 | 17 | client_mode_hook->hook ( hooks::indexes::create_move, hooks::create_move_hook ); 18 | client_mode_hook->hook ( hooks::indexes::viewmodel_fov, hooks::viewmodel_fov_hook ); 19 | panel_hook->hook ( hooks::indexes::paint_traverse, hooks::paint_traverse_hook ); 20 | 21 | interfaces::engine_client->unrestricted_client_cmd ( "clear" ); 22 | interfaces::engine_client->unrestricted_client_cmd ( "echo purpura sdk." ); 23 | 24 | } 25 | 26 | void hooks::restore() { 27 | 28 | client_mode_hook->unhook ( hooks::indexes::create_move ); 29 | client_mode_hook->unhook ( hooks::indexes::viewmodel_fov ); 30 | 31 | panel_hook->unhook ( hooks::indexes::paint_traverse ); 32 | 33 | } 34 | 35 | bool __fastcall hooks::create_move_hook ( i_client_mode* thisptr, void* edx, float sample_frametime, c_usercmd* cmd ) { 36 | 37 | static auto o_create_move = client_mode_hook->get_original(hooks::indexes::create_move); 38 | 39 | o_create_move ( thisptr, edx, sample_frametime, cmd ); 40 | 41 | if( !interfaces::engine_client->game_and_connect ( ) || !cmd || !cmd->command_number ) 42 | return o_create_move; 43 | 44 | global_variables::global_cmd = cmd; 45 | 46 | cmd->buttons |= IN_BULLRUSH; 47 | 48 | global_utils::set_clantag ( "purpura", "purpura sdk" ); 49 | 50 | return false; 51 | 52 | } 53 | 54 | float __stdcall hooks::viewmodel_fov_hook ( ) { 55 | 56 | return 120.f; 57 | 58 | } 59 | 60 | void __fastcall hooks::paint_traverse_hook ( PVOID p_panel, int edx, unsigned int vgui_panel, bool force_repaint, bool allow_force ) { 61 | 62 | static auto o_paint_traverse = panel_hook->get_original(hooks::indexes::paint_traverse); 63 | 64 | static unsigned int panel_hud_id, panel_id; 65 | 66 | if (!panel_hud_id) 67 | 68 | if (!strcmp("HudZoom", interfaces::panel->get_name(vgui_panel))) 69 | 70 | panel_hud_id = vgui_panel; 71 | 72 | o_paint_traverse ( p_panel, vgui_panel, force_repaint, allow_force ); 73 | 74 | if (!panel_id) 75 | 76 | if (!strcmp("MatSystemTopPanel", interfaces::panel->get_name(vgui_panel))) 77 | 78 | panel_id = vgui_panel; 79 | 80 | if (panel_id == vgui_panel) 81 | { 82 | // draw shit here lmao 83 | render_manager::text ( "purpura sdk. // for sex having gamers" , 15, 15, render_manager::fonts::main_font, color ( 255,255,255,255 ) ); 84 | } 85 | 86 | } 87 | -------------------------------------------------------------------------------- /purpura sdk/hooks/hooks.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../utilities/vmt.h" 4 | #include "../interfaces/interfaces.h" 5 | 6 | #include "../sdk/c_input.h" 7 | 8 | namespace hooks { 9 | 10 | enum indexes { 11 | create_move = 24, 12 | viewmodel_fov = 35, 13 | paint_traverse = 41, 14 | }; 15 | 16 | void init ( ); 17 | void restore ( ); 18 | 19 | // hooked functions 20 | static bool __fastcall create_move_hook ( i_client_mode*, void*, float, c_usercmd* ); 21 | static void __fastcall paint_traverse_hook ( PVOID, int, unsigned int, bool, bool ); 22 | static float __stdcall viewmodel_fov_hook ( ); 23 | 24 | // hook prototypes 25 | typedef bool ( __fastcall* create_move_t ) ( i_client_mode*, void*, float, c_usercmd* ); 26 | typedef void ( __thiscall* paint_traverse_t ) ( PVOID, unsigned int, bool, bool ); 27 | 28 | } -------------------------------------------------------------------------------- /purpura sdk/interfaces/interfaces.cpp: -------------------------------------------------------------------------------- 1 | #include "interfaces.h" 2 | #include "../utilities/utilities.h" 3 | 4 | namespace interfaces { 5 | 6 | iv_engine_client* engine_client = nullptr; 7 | i_surface* surface = nullptr; 8 | i_base_client_dll* client = nullptr; 9 | i_client_mode* client_mode = nullptr; 10 | i_panel* panel = nullptr; 11 | c_global_vars* global_vars = nullptr; 12 | 13 | void interfaces::init ( ) { 14 | 15 | global_utils::console_log("trying to get interfaces..."); 16 | 17 | engine_client = global_utils::get_interface ( ( char* ) "engine.dll", ( char* ) "VEngineClient014" ); 18 | surface = global_utils::get_interface ( ( char* ) "vguimatsurface.dll", ( char* ) "VGUI_Surface031" ); 19 | client = global_utils::get_interface ( ( char* ) "client_panorama.dll", ( char* ) "VClient018" ); 20 | panel = reinterpret_cast < i_panel* > ( global_utils::find_interface ( "vgui2.dll", "VGUI_Panel" ) ); 21 | 22 | client_mode = **(i_client_mode***)((*(DWORD**)client)[10] + 0x5); 23 | global_vars = **reinterpret_cast((*reinterpret_cast(client))[0] + 0x1Bu); 24 | 25 | global_utils::console_log("got all interfaces..."); 26 | 27 | } 28 | } -------------------------------------------------------------------------------- /purpura sdk/interfaces/interfaces.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../sdk/i_surface.h" 4 | #include "../sdk/i_panel.h" 5 | #include "../sdk/iv_engine_client.h" 6 | #include "../sdk/i_client_mode.h" 7 | #include "../sdk/i_client_entity.h" 8 | #include "../sdk/c_global_vars.h" 9 | 10 | namespace interfaces { 11 | extern iv_engine_client* engine_client; 12 | extern i_surface* surface; 13 | extern i_panel* panel; 14 | extern i_base_client_dll* client; 15 | extern i_client_mode* client_mode; 16 | extern c_global_vars* global_vars; 17 | 18 | void init ( ); 19 | } -------------------------------------------------------------------------------- /purpura sdk/purpura sdk.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | 15.0 23 | {8F406BA2-4B0A-4B01-B7B3-0B6CAB9C9247} 24 | Win32Proj 25 | purpurasdk 26 | 10.0.17763.0 27 | 28 | 29 | 30 | DynamicLibrary 31 | true 32 | v141 33 | Unicode 34 | 35 | 36 | DynamicLibrary 37 | false 38 | v141 39 | true 40 | Unicode 41 | 42 | 43 | DynamicLibrary 44 | true 45 | v141 46 | Unicode 47 | 48 | 49 | DynamicLibrary 50 | false 51 | v141 52 | true 53 | Unicode 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | true 75 | 76 | 77 | true 78 | 79 | 80 | false 81 | 82 | 83 | false 84 | 85 | 86 | 87 | NotUsing 88 | TurnOffAllWarnings 89 | Disabled 90 | true 91 | WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;PURPURASDK_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 92 | true 93 | 94 | 95 | Windows 96 | true 97 | 98 | 99 | 100 | 101 | Use 102 | Level3 103 | Disabled 104 | true 105 | _DEBUG;PURPURASDK_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 106 | true 107 | 108 | 109 | Windows 110 | true 111 | 112 | 113 | 114 | 115 | NotUsing 116 | TurnOffAllWarnings 117 | Disabled 118 | true 119 | true 120 | true 121 | WIN32;_CRT_SECURE_NO_WARNINGS;NDEBUG;PURPURASDK_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 122 | true 123 | 124 | 125 | Windows 126 | true 127 | true 128 | true 129 | 130 | 131 | 132 | 133 | Use 134 | Level3 135 | MaxSpeed 136 | true 137 | true 138 | true 139 | NDEBUG;PURPURASDK_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 140 | true 141 | 142 | 143 | Windows 144 | true 145 | true 146 | true 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | -------------------------------------------------------------------------------- /purpura sdk/purpura sdk.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /purpura sdk/purpura sdk.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | true 5 | 6 | -------------------------------------------------------------------------------- /purpura sdk/sdk/c_global_vars.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class c_global_vars 4 | { 5 | public: 6 | float realtime; 7 | int framecount; 8 | float absolute_frame_time; 9 | float absolute_frame_start_time_std_dev; 10 | float curtime; 11 | float frametime; 12 | int max_clients; 13 | int tickcount; 14 | float interval_per_tick; 15 | float interpolation_amount; 16 | int sim_ticks_this_frame; 17 | int network_protocol; 18 | void* p_save_data; 19 | bool b_client; 20 | bool b_remote_client; 21 | }; -------------------------------------------------------------------------------- /purpura sdk/sdk/c_input.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../utilities/vector.h" 4 | 5 | #include 6 | 7 | // Removed all the useless shit about joysticks and cleaned up code slightly 8 | 9 | // --------------------------------------- DEFINES 10 | 11 | #define IN_ATTACK (1 << 0) 12 | #define IN_JUMP (1 << 1) 13 | #define IN_DUCK (1 << 2) 14 | #define IN_FORWARD (1 << 3) 15 | #define IN_BACK (1 << 4) 16 | #define IN_USE (1 << 5) 17 | #define IN_CANCEL (1 << 6) 18 | #define IN_LEFT (1 << 7) 19 | #define IN_RIGHT (1 << 8) 20 | #define IN_MOVELEFT (1 << 9) 21 | #define IN_MOVERIGHT (1 << 10) 22 | #define IN_ATTACK2 (1 << 11) 23 | #define IN_RUN (1 << 12) 24 | #define IN_RELOAD (1 << 13) 25 | #define IN_ALT1 (1 << 14) 26 | #define IN_ALT2 (1 << 15) 27 | #define IN_SCORE (1 << 16) // Used by client_panorama.dll for when scoreboard is held down 28 | #define IN_SPEED (1 << 17) // Player is holding the speed key 29 | #define IN_WALK (1 << 18) // Player holding walk key 30 | #define IN_ZOOM (1 << 19) // Zoom key for HUD zoom 31 | #define IN_WEAPON1 (1 << 20) // weapon defines these bits 32 | #define IN_WEAPON2 (1 << 21) // weapon defines these bits 33 | #define IN_BULLRUSH (1 << 22) 34 | #define IN_GRENADE1 (1 << 23) // grenade 1 35 | #define IN_GRENADE2 (1 << 24) // grenade 2 36 | #define IN_ATTACK3 (1 << 25) 37 | 38 | // --------------------------------------- CLASSES 39 | 40 | class bf_read; 41 | class bf_write; 42 | 43 | class c_usercmd 44 | { 45 | public: 46 | c_usercmd() 47 | { 48 | memset(this, 0, sizeof(*this)); 49 | }; 50 | virtual ~c_usercmd() {}; 51 | 52 | int command_number; // 0x04 For matching server and client commands for debugging 53 | int tick_count; // 0x08 the tick the client created this command 54 | vec3_t viewangles; // 0x0C Player instantaneous view angles. 55 | vec3_t aimdirection; // 0x18 56 | float forwardmove; // 0x24 57 | float sidemove; // 0x28 58 | float upmove; // 0x2C 59 | int buttons; // 0x30 Attack button states 60 | char impulse; // 0x34 61 | int weaponselect; // 0x38 Current weapon id 62 | int weaponsubtype; // 0x3C 63 | int random_seed; // 0x40 For shared random functions 64 | short mousedx; // 0x44 mouse accum in x from create move 65 | short mousedy; // 0x46 mouse accum in y from create move 66 | bool hasbeenpredicted; // 0x48 Client only, tracks whether we've predicted this command at least once 67 | char pad_0x4C[0x18]; // 0x4C Current sizeof( usercmd ) = 100 = 0x64 68 | }; 69 | 70 | class c_verified_usercmd 71 | { 72 | public: 73 | c_usercmd m_cmd; 74 | }; 75 | 76 | class c_input 77 | { 78 | public: 79 | void* pvftable; //0x00 80 | bool m_f_track_ir_available; //0x04 81 | bool m_f_mouse_initialized; //0x05 82 | bool m_f_mouse_is_active; //0x06 83 | bool m_fJoystickAdvancedInit; //0x07 84 | char pad_0x08[0x2C]; //0x08 85 | void* m_pkeys; //0x34 86 | char pad_0x38[0x6C]; //0x38 87 | int pad_0x41; 88 | int pad_0x42; 89 | bool m_fCameraInterceptingMouse; //0x9C 90 | bool m_fCameraInThirdPerson; //0x9D 91 | bool m_fCameraMovingWithMouse; //0x9E 92 | vec3_t m_vecCameraOffset; //0xA0 93 | bool m_fCameraDistanceMove; //0xAC 94 | int m_nCameraOldX; //0xB0 95 | int m_nCameraOldY; //0xB4 96 | int m_nCameraX; //0xB8 97 | int m_nCameraY; //0xBC 98 | bool m_CameraIsOrthographic; //0xC0 99 | vec3_t m_angPreviousViewAngles; //0xC4 100 | vec3_t m_angPreviousViewAnglesTilt; //0xD0 101 | float m_flLastForwardMove; //0xDC 102 | int m_nClearInputState; //0xE0 103 | char pad_0xE4[0x8]; //0xE4 104 | c_usercmd* m_pCommands; //0xEC 105 | c_verified_usercmd* m_pVerifiedCommands; //0xF0 106 | }; 107 | 108 | // --------------------------------------- ENUMS 109 | 110 | enum button_code_t : int 111 | { 112 | BUTTON_CODE_INVALID = -1, 113 | BUTTON_CODE_NONE = 0, 114 | 115 | KEY_FIRST = 0, 116 | 117 | KEY_NONE = KEY_FIRST, 118 | KEY_0, 119 | KEY_1, 120 | KEY_2, 121 | KEY_3, 122 | KEY_4, 123 | KEY_5, 124 | KEY_6, 125 | KEY_7, 126 | KEY_8, 127 | KEY_9, 128 | KEY_A, 129 | KEY_B, 130 | KEY_C, 131 | KEY_D, 132 | KEY_E, 133 | KEY_F, 134 | KEY_G, 135 | KEY_H, 136 | KEY_I, 137 | KEY_J, 138 | KEY_K, 139 | KEY_L, 140 | KEY_M, 141 | KEY_N, 142 | KEY_O, 143 | KEY_P, 144 | KEY_Q, 145 | KEY_R, 146 | KEY_S, 147 | KEY_T, 148 | KEY_U, 149 | KEY_V, 150 | KEY_W, 151 | KEY_X, 152 | KEY_Y, 153 | KEY_Z, 154 | KEY_PAD_0, 155 | KEY_PAD_1, 156 | KEY_PAD_2, 157 | KEY_PAD_3, 158 | KEY_PAD_4, 159 | KEY_PAD_5, 160 | KEY_PAD_6, 161 | KEY_PAD_7, 162 | KEY_PAD_8, 163 | KEY_PAD_9, 164 | KEY_PAD_DIVIDE, 165 | KEY_PAD_MULTIPLY, 166 | KEY_PAD_MINUS, 167 | KEY_PAD_PLUS, 168 | KEY_PAD_ENTER, 169 | KEY_PAD_DECIMAL, 170 | KEY_LBRACKET, 171 | KEY_RBRACKET, 172 | KEY_SEMICOLON, 173 | KEY_APOSTROPHE, 174 | KEY_BACKQUOTE, 175 | KEY_COMMA, 176 | KEY_PERIOD, 177 | KEY_SLASH, 178 | KEY_BACKSLASH, 179 | KEY_MINUS, 180 | KEY_EQUAL, 181 | KEY_ENTER, 182 | KEY_SPACE, 183 | KEY_BACKSPACE, 184 | KEY_TAB, 185 | KEY_CAPSLOCK, 186 | KEY_NUMLOCK, 187 | KEY_ESCAPE, 188 | KEY_SCROLLLOCK, 189 | KEY_INSERT, 190 | KEY_DELETE, 191 | KEY_HOME, 192 | KEY_END, 193 | KEY_PAGEUP, 194 | KEY_PAGEDOWN, 195 | KEY_BREAK, 196 | KEY_LSHIFT, 197 | KEY_RSHIFT, 198 | KEY_LALT, 199 | KEY_RALT, 200 | KEY_LCONTROL, 201 | KEY_RCONTROL, 202 | KEY_LWIN, 203 | KEY_RWIN, 204 | KEY_APP, 205 | KEY_UP, 206 | KEY_LEFT, 207 | KEY_DOWN, 208 | KEY_RIGHT, 209 | KEY_F1, 210 | KEY_F2, 211 | KEY_F3, 212 | KEY_F4, 213 | KEY_F5, 214 | KEY_F6, 215 | KEY_F7, 216 | KEY_F8, 217 | KEY_F9, 218 | KEY_F10, 219 | KEY_F11, 220 | KEY_F12, 221 | KEY_CAPSLOCKTOGGLE, 222 | KEY_NUMLOCKTOGGLE, 223 | KEY_SCROLLLOCKTOGGLE, 224 | 225 | KEY_LAST = KEY_SCROLLLOCKTOGGLE, 226 | KEY_COUNT = KEY_LAST - KEY_FIRST + 1, 227 | 228 | // Mouse 229 | MOUSE_FIRST = KEY_LAST + 1, 230 | 231 | MOUSE_LEFT = MOUSE_FIRST, 232 | MOUSE_RIGHT, 233 | MOUSE_MIDDLE, 234 | MOUSE_4, 235 | MOUSE_5, 236 | MOUSE_WHEEL_UP, // A fake button which is 'pressed' and 'released' when the wheel is moved up 237 | MOUSE_WHEEL_DOWN, // A fake button which is 'pressed' and 'released' when the wheel is moved down 238 | 239 | MOUSE_LAST = MOUSE_WHEEL_DOWN, 240 | MOUSE_COUNT = MOUSE_LAST - MOUSE_FIRST + 1 241 | }; 242 | 243 | enum mouse_code_state_t 244 | { 245 | BUTTON_RELEASED = 0, 246 | BUTTON_PRESSED, 247 | BUTTON_DOUBLECLICKED, 248 | }; -------------------------------------------------------------------------------- /purpura sdk/sdk/i_app_system.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | typedef void* (*create_interface_fn)(const char *p_name, int *p_code); 4 | 5 | class i_app_system 6 | { 7 | public: 8 | virtual bool connect(create_interface_fn factory) = 0; // 0 9 | virtual void disconnect() = 0; // 1 10 | virtual void* query_interface(const char *p_interface_name) = 0; // 2 11 | virtual int /*InitReturnVal_t*/ init() = 0; // 3 12 | virtual void shutdown() = 0; // 4 13 | virtual const void* /*AppSystemInfo_t*/ get_dependencies() = 0; // 5 14 | virtual int /*AppSystemTier_t*/ get_tier() = 0; // 6 15 | virtual void reconnect(create_interface_fn factory, const char *p_interface_name) = 0; // 7 16 | virtual void unk_func() = 0; // 8 17 | }; -------------------------------------------------------------------------------- /purpura sdk/sdk/i_client_entity.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class i_base_client_dll { 4 | 5 | }; 6 | 7 | class i_client_entity { 8 | 9 | public: 10 | int entity_index() { 11 | 12 | void *nigga_toilet = (void*)(this + 0x8); 13 | 14 | typedef int(__thiscall *o_fn)(void*); 15 | return global_utils::v_function(nigga_toilet, 10)(nigga_toilet); // yeah i was bored 16 | 17 | } 18 | }; -------------------------------------------------------------------------------- /purpura sdk/sdk/i_client_mode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "i_client_entity.h" 4 | 5 | class i_client_mode { 6 | 7 | public: 8 | bool should_draw_entity(i_client_entity *p_entity) { 9 | 10 | typedef bool(__thiscall *o_fn)(void*, i_client_entity*); 11 | return global_utils::v_function(this, 14)(this, p_entity); 12 | 13 | } 14 | }; -------------------------------------------------------------------------------- /purpura sdk/sdk/i_panel.h: -------------------------------------------------------------------------------- 1 | #include "../utilities/utilities.h" 2 | 3 | class i_panel 4 | { 5 | public: 6 | const char *get_name(unsigned int vgui_panel) { 7 | 8 | typedef const char*(__thiscall *o_fn)(PVOID, unsigned int); 9 | return global_utils::v_function(this, 36)(this, vgui_panel); 10 | 11 | } 12 | }; -------------------------------------------------------------------------------- /purpura sdk/sdk/i_surface.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "i_app_system.h" 4 | #include "../utilities/utilities.h" 5 | 6 | namespace vgui 7 | { 8 | typedef unsigned long h_font; 9 | typedef unsigned int vpanel; 10 | }; 11 | 12 | enum font_feature { 13 | 14 | FONT_FEATURE_ANTIALIASED_FONTS = 1, FONT_FEATURE_DROPSHADOW_FONTS = 2, FONT_FEATURE_OUTLINE_FONTS = 6 15 | 16 | }; 17 | 18 | enum font_draw_type { 19 | 20 | FONT_DRAW_DEFAULT = 0, FONT_DRAW_NONADDITIVE, FONT_DRAW_ADDITIVE, FONT_DRAW_TYPE_COUNT = 2 21 | 22 | }; 23 | 24 | enum font_flags { 25 | 26 | FONTFLAG_NONE, 27 | FONTFLAG_ITALIC = 0x001, 28 | FONTFLAG_UNDERLINE = 0x002, 29 | FONTFLAG_STRIKEOUT = 0x004, 30 | FONTFLAG_SYMBOL = 0x008, 31 | FONTFLAG_ANTIALIAS = 0x010, 32 | FONTFLAG_GAUSSIANBLUR = 0x020, 33 | FONTFLAG_ROTARY = 0x040, 34 | FONTFLAG_DROPSHADOW = 0x080, 35 | FONTFLAG_ADDITIVE = 0x100, 36 | FONTFLAG_OUTLINE = 0x200, 37 | FONTFLAG_CUSTOM = 0x400, 38 | FONTFLAG_BITMAP = 0x800 39 | 40 | }; 41 | 42 | class color { 43 | 44 | public: 45 | 46 | float r, g, b, a; 47 | 48 | color ( float red, float green, float blue, float alpha ) { 49 | 50 | r = red, g = green, b = blue, a = alpha; 51 | 52 | } 53 | 54 | color ( float red, float green, float blue ) { 55 | 56 | r = red, g = green, b = blue, a = 255.f; 57 | 58 | } 59 | }; 60 | 61 | struct int_rect 62 | { 63 | int x0; 64 | int y0; 65 | int x1; 66 | int y1; 67 | }; 68 | 69 | class i_surface : i_app_system { 70 | 71 | public: 72 | 73 | virtual void run_frame ( ) = 0; 74 | virtual vgui::vpanel get_embedded_panel ( ) = 0; 75 | virtual void set_embedded_panel ( vgui::vpanel p_panel ) = 0; 76 | virtual void push_make_current ( vgui::vpanel panel, bool use_insets ) = 0; 77 | virtual void pop_make_current ( vgui::vpanel panel ) = 0; 78 | virtual void draw_set_color ( int r, int g, int b, int a ) = 0; 79 | virtual void draw_set_color ( color col ) = 0; 80 | virtual void draw_filled_rect ( int x0, int y0, int x1, int y1 ) = 0; 81 | virtual void draw_filled_rect_int_array ( int_rect *p_rects, int num_rects ) = 0; 82 | virtual void draw_outline ( int x0, int y0, int x1, int y1 ) = 0; 83 | virtual void draw_line ( int x0, int y0, int x1, int y1 ) = 0; 84 | virtual void draw_point_line (int *px, int *py, int num_points) = 0; 85 | virtual void draw_set_depth ( float f ) = 0; 86 | virtual void draw_clear_depth ( void ) = 0; 87 | virtual void draw_set_text_font ( vgui::h_font font ) = 0; 88 | virtual void draw_set_text_color ( int r, int g, int b, int a ) = 0; 89 | virtual void draw_set_text_color ( color col ) = 0; 90 | virtual void draw_set_text_pos ( int x, int y ) = 0; 91 | virtual void draw_get_text_pos ( int& x, int& y ) = 0; 92 | virtual void draw_print_text ( const wchar_t *text, int text_len, font_draw_type draw_type = font_draw_type::FONT_DRAW_DEFAULT ) = 0; 93 | virtual void draw_unicode_character ( wchar_t wch, font_draw_type draw_type = font_draw_type::FONT_DRAW_DEFAULT ) = 0; 94 | virtual void draw_flush_text ( ) = 0; 95 | virtual void* create_html_window ( void *events, vgui::vpanel context ) = 0; // reminder: look into this html stuff, may be useful someday. 96 | virtual void paint_html_window ( void *htmlwin ) = 0; 97 | virtual void delete_html_window ( void *htmlwin ) = 0; 98 | virtual int draw_get_texture_id ( char const *filename ) = 0; 99 | virtual bool draw_get_texture_file ( int id, char *filename, int maxlen ) = 0; 100 | virtual void draw_set_texture_file ( int id, const char *filename, int hardware_filter, bool reload ) = 0; 101 | virtual void draw_set_texture_rgba ( int id, const unsigned char *rgba, int wide, int tall ) = 0; 102 | virtual void draw_set_texture ( int id ) = 0; 103 | virtual void delete_texture_id ( int id ) = 0; 104 | virtual void draw_get_texture_size ( int id, int &wide, int &tall ) = 0; 105 | virtual void draw_textured_rect ( int x0, int y0, int x1, int y1 ) = 0; 106 | virtual bool is_texture_id_valid ( int id ) = 0; 107 | virtual int create_new_texture_id ( bool procedural = false ) = 0; 108 | virtual void get_screen_size ( int &wide, int &tall ) = 0; 109 | virtual void set_as_top_most ( vgui::vpanel panel, bool state ) = 0; 110 | virtual void bring_to_front ( vgui::vpanel panel ) = 0; 111 | virtual void set_foreground_window ( vgui::vpanel panel ) = 0; 112 | virtual void set_panel_visibility ( vgui::vpanel panel, bool state ) = 0; 113 | virtual void set_panel_minimizised ( vgui::vpanel panel, bool state ) = 0; 114 | virtual bool is_panel_minimized ( vgui::vpanel panel ) = 0; 115 | virtual void flash_window ( vgui::vpanel panel, bool state ) = 0; 116 | virtual void set_title ( vgui::vpanel panel, const wchar_t *title ) = 0; 117 | virtual void set_as_toolbar ( vgui::vpanel panel, bool state ) = 0; 118 | virtual void create_popup ( vgui::vpanel panel, bool minimised, bool show_taskbar_icon = true, bool disabled = false, bool mouse_input = true, bool keyboard_input = true ) = 0; 119 | virtual void swap_buffers ( vgui::vpanel panel ) = 0; 120 | virtual void invalidate ( vgui::vpanel panel ) = 0; 121 | virtual void set_cursor ( unsigned long cursor ) = 0; 122 | virtual bool is_cursor_visible ( ) = 0; 123 | virtual void apply_changes ( ) = 0; 124 | virtual bool is_within ( int x, int y ) = 0; 125 | virtual bool has_focus ( ) = 0; 126 | virtual bool supports_feature ( int /*SurfaceFeature_t*/ feature ) = 0; 127 | virtual void restrict_paint_to_panel ( vgui::vpanel panel, bool allow_nonmodal_surface = false ) = 0; 128 | virtual void set_modal_panel ( vgui::vpanel ) = 0; 129 | virtual vgui::vpanel get_modal_panel ( ) = 0; 130 | virtual void unlock_cursor ( ) = 0; 131 | virtual void lock_cursor ( ) = 0; 132 | virtual void set_translate_extend_keys ( bool state ) = 0; 133 | virtual vgui::vpanel get_topmost_popup ( ) = 0; 134 | virtual void set_top_level_focus ( vgui::vpanel panel ) = 0; 135 | virtual vgui::h_font create_font ( ) = 0; 136 | virtual bool set_font_glyph_set ( vgui::h_font font, const char *windows_font_name, int tall, int weight, int blur, int scanlines, int flags, int range_minimum = 0, int range_maximum = 0 ) = 0; 137 | virtual bool add_custom_font ( const char *crack_fucking_cocaine_jk_issa_font_name_nigga ) = 0; // i'm so lonely i'm going insane please send fucking help 138 | virtual int get_font_tall ( vgui::h_font font ) = 0; 139 | virtual int get_font_ascent ( vgui::h_font font, wchar_t wch ) = 0; 140 | virtual bool is_font_additive ( vgui::h_font font ) = 0; 141 | virtual void get_char_wideness ( vgui::h_font font, int ch, int &a, int &b, int &c ) = 0; 142 | virtual int get_char_width ( vgui::h_font font, int ch ) = 0; 143 | virtual void get_text_size ( vgui::h_font font, const wchar_t *text, int &wide, int &tall ) = 0; 144 | virtual vgui::vpanel get_notify_panel ( ) = 0; 145 | virtual void set_notify_panel ( vgui::vpanel context, unsigned long icon, vgui::vpanel panel_to_recieve, const char *text ) = 0; 146 | virtual void play_sound ( const char *filename ) = 0; 147 | virtual int get_popup_count ( ) = 0; 148 | virtual vgui::vpanel get_popup ( int index ) = 0; 149 | virtual bool should_repaint_child_panel ( vgui::vpanel child_panel ) = 0; 150 | virtual bool recreate_context ( vgui::vpanel panel ) = 0; 151 | virtual void add_panel ( vgui::vpanel panel ) = 0; 152 | virtual void release_panel ( vgui::vpanel panel ) = 0; 153 | virtual void move_to_front ( vgui::vpanel panel ) = 0; 154 | virtual void move_to_back ( vgui::vpanel panel ) = 0; 155 | virtual void solve_traverse ( vgui::vpanel panel, bool force_apply = false ) = 0; 156 | virtual void paint_traverse ( vgui::vpanel panel ) = 0; 157 | virtual void enable_mouse_capture ( vgui::vpanel panel, bool state ) = 0; 158 | virtual void get_workspace_bounds ( int &x, int &y, int &wide, int &tall ) = 0; 159 | virtual void get_absolute_workspace_bounds ( int &x, int &y, int &wide, int &tall ) = 0; 160 | virtual void get_base ( int &width, int &height ) = 0; 161 | virtual void calculate_mouse_visible ( ) = 0; 162 | virtual bool need_keyboard_input ( ) = 0; 163 | virtual bool has_cursor_position_functions ( ) = 0; 164 | virtual void surface_get_cursor_position ( int &x, int &y ) = 0; 165 | virtual void surface_set_cursor_position ( int x, int y ) = 0; 166 | virtual void draw_outlined_circle ( int x, int y, int radius, int segments ) = 0; 167 | virtual void draw_textured_sub_rect ( int x0, int y0, int x1, int y1, float texs0, float text0, float texs1, float text1 ) = 0; 168 | 169 | }; -------------------------------------------------------------------------------- /purpura sdk/sdk/iv_engine_client.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../utilities/utilities.h" 4 | 5 | class iv_engine_client { 6 | 7 | public: 8 | 9 | void screen_size ( int& width, int& height ) { 10 | 11 | typedef int(__thiscall *o_fn)(void*, int&, int&); 12 | global_utils::v_function( this, 5 )( this, width, height ); 13 | 14 | } 15 | 16 | int get_localplayer ( ) { 17 | 18 | typedef int(__thiscall *o_fn)(void*); 19 | return global_utils::v_function(this, 12)(this); 20 | 21 | } 22 | 23 | float last_timestamp ( ) { 24 | 25 | typedef float(__thiscall *o_fn)(void*); 26 | return global_utils::v_function(this, 14)(this); 27 | 28 | } 29 | 30 | int get_max_clients ( ) { 31 | 32 | typedef int(__thiscall *o_fn)(void*); 33 | return global_utils::v_function(this, 20)(this); 34 | 35 | } 36 | 37 | bool in_game ( ) { 38 | 39 | typedef int(__thiscall *o_fn)(void*); 40 | return global_utils::v_function(this, 26)(this); 41 | 42 | } 43 | 44 | bool connected ( ) { 45 | 46 | typedef int(__thiscall *o_fn)(void*); 47 | return global_utils::v_function(this, 27)(this); 48 | 49 | } 50 | 51 | bool game_and_connect ( ) { 52 | 53 | return (this->connected ( ) && this->in_game ( )); // here u go phil126 54 | 55 | } 56 | 57 | void client_cmd ( const char* sz_cmd_string ) { 58 | 59 | typedef void(__thiscall *o_fn)(void*, const char *); 60 | return global_utils::v_function(this, 108)(this, sz_cmd_string); 61 | 62 | } 63 | 64 | void unrestricted_client_cmd ( const char* sz_cmd_string ) { 65 | 66 | typedef void(__thiscall* o_fn)(void*, const char*, char); 67 | return global_utils::v_function(this, 114)(this, sz_cmd_string, 1); 68 | 69 | } 70 | 71 | }; -------------------------------------------------------------------------------- /purpura sdk/sdk/sdk.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "i_surface.h" 4 | #include "iv_engine_client.h" 5 | #include "i_client_entity.h" 6 | #include "i_client_mode.h" 7 | -------------------------------------------------------------------------------- /purpura sdk/sdk/structs.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum class class_ids : int { 4 | CAI_BaseNPC = 0, 5 | CAK47, 6 | CBaseAnimating, 7 | CBaseAnimatingOverlay, 8 | CBaseAttributableItem, 9 | CBaseButton, 10 | CBaseCombatCharacter, 11 | CBaseCombatWeapon, 12 | CBaseCSGrenade, 13 | CBaseCSGrenadeProjectile, 14 | CBaseDoor, 15 | CBaseEntity, 16 | CBaseFlex, 17 | CBaseGrenade, 18 | CBaseParticleEntity, 19 | CBasePlayer, 20 | CBasePropDoor, 21 | CBaseTeamObjectiveResource, 22 | CBaseTempEntity, 23 | CBaseToggle, 24 | CBaseTrigger, 25 | CBaseViewModel, 26 | CBaseVPhysicsTrigger, 27 | CBaseWeaponWorldModel, 28 | CBeam, 29 | CBeamSpotlight, 30 | CBoneFollower, 31 | CBRC4Target, 32 | CBreachCharge, 33 | CBreachChargeProjectile, 34 | CBreakableProp, 35 | CBreakableSurface, 36 | CBumpMine, 37 | CBumpMineProjectile, 38 | CC4, 39 | CCascadeLight, 40 | CChicken, 41 | CColorCorrection, 42 | CColorCorrectionVolume, 43 | CCSGameRulesProxy, 44 | CCSPlayer, 45 | CCSPlayerResource, 46 | CCSRagdoll, 47 | CCSTeam, 48 | CDangerZone, 49 | CDangerZoneController, 50 | CDEagle, 51 | CDecoyGrenade, 52 | CDecoyProjectile, 53 | CDrone, 54 | CDronegun, 55 | CDynamicLight, 56 | CDynamicProp, 57 | CEconEntity, 58 | CEconWearable, 59 | CEmbers, 60 | CEntityDissolve, 61 | CEntityFlame, 62 | CEntityFreezing, 63 | CEntityParticleTrail, 64 | CEnvAmbientLight, 65 | CEnvDetailController, 66 | CEnvDOFController, 67 | CEnvGasCanister, 68 | CEnvParticleScript, 69 | CEnvProjectedTexture, 70 | CEnvQuadraticBeam, 71 | CEnvScreenEffect, 72 | CEnvScreenOverlay, 73 | CEnvTonemapController, 74 | CEnvWind, 75 | CFEPlayerDecal, 76 | CFireCrackerBlast, 77 | CFireSmoke, 78 | CFireTrail, 79 | CFish, 80 | CFists, 81 | CFlashbang, 82 | CFogController, 83 | CFootstepControl, 84 | CFunc_Dust, 85 | CFunc_LOD, 86 | CFuncAreaPortalWindow, 87 | CFuncBrush, 88 | CFuncConveyor, 89 | CFuncLadder, 90 | CFuncMonitor, 91 | CFuncMoveLinear, 92 | CFuncOccluder, 93 | CFuncReflectiveGlass, 94 | CFuncRotating, 95 | CFuncSmokeVolume, 96 | CFuncTrackTrain, 97 | CGameRulesProxy, 98 | CGrassBurn, 99 | CHandleTest, 100 | CHEGrenade, 101 | CHostage, 102 | CHostageCarriableProp, 103 | CIncendiaryGrenade, 104 | CInferno, 105 | CInfoLadderDismount, 106 | CInfoMapRegion, 107 | CInfoOverlayAccessor, 108 | CItem_Healthshot, 109 | CItemCash, 110 | CItemDogtags, 111 | CKnife, 112 | CKnifeGG, 113 | CLightGlow, 114 | CMaterialModifyControl, 115 | CMelee, 116 | CMolotovGrenade, 117 | CMolotovProjectile, 118 | CMovieDisplay, 119 | CParadropChopper, 120 | CParticleFire, 121 | CParticlePerformanceMonitor, 122 | CParticleSystem, 123 | CPhysBox, 124 | CPhysBoxMultiplayer, 125 | CPhysicsProp, 126 | CPhysicsPropMultiplayer, 127 | CPhysMagnet, 128 | CPhysPropAmmoBox, 129 | CPhysPropLootCrate, 130 | CPhysPropRadarJammer, 131 | CPhysPropWeaponUpgrade, 132 | CPlantedC4, 133 | CPlasma, 134 | CPlayerPing, 135 | CPlayerResource, 136 | CPointCamera, 137 | CPointCommentaryNode, 138 | CPointWorldText, 139 | CPoseController, 140 | CPostProcessController, 141 | CPrecipitation, 142 | CPrecipitationBlocker, 143 | CPredictedViewModel, 144 | CProp_Hallucination, 145 | CPropCounter, 146 | CPropDoorRotating, 147 | CPropJeep, 148 | CPropVehicleDriveable, 149 | CRagdollManager, 150 | CRagdollProp, 151 | CRagdollPropAttached, 152 | CRopeKeyframe, 153 | CSCAR17, 154 | CSceneEntity, 155 | CSensorGrenade, 156 | CSensorGrenadeProjectile, 157 | CShadowControl, 158 | CSlideshowDisplay, 159 | CSmokeGrenade, 160 | CSmokeGrenadeProjectile, 161 | CSmokeStack, 162 | CSnowball, 163 | CSnowballPile, 164 | CSnowballProjectile, 165 | CSpatialEntity, 166 | CSpotlightEnd, 167 | CSprite, 168 | CSpriteOriented, 169 | CSpriteTrail, 170 | CStatueProp, 171 | CSteamJet, 172 | CSun, 173 | CSunlightShadowControl, 174 | CSurvivalSpawnChopper, 175 | CTablet, 176 | CTeam, 177 | CTeamplayRoundBasedRulesProxy, 178 | CTEArmorRicochet, 179 | CTEBaseBeam, 180 | CTEBeamEntPoint, 181 | CTEBeamEnts, 182 | CTEBeamFollow, 183 | CTEBeamLaser, 184 | CTEBeamPoints, 185 | CTEBeamRing, 186 | CTEBeamRingPoint, 187 | CTEBeamSpline, 188 | CTEBloodSprite, 189 | CTEBloodStream, 190 | CTEBreakModel, 191 | CTEBSPDecal, 192 | CTEBubbles, 193 | CTEBubbleTrail, 194 | CTEClientProjectile, 195 | CTEDecal, 196 | CTEDust, 197 | CTEDynamicLight, 198 | CTEEffectDispatch, 199 | CTEEnergySplash, 200 | CTEExplosion, 201 | CTEFireBullets, 202 | CTEFizz, 203 | CTEFootprintDecal, 204 | CTEFoundryHelpers, 205 | CTEGaussExplosion, 206 | CTEGlowSprite, 207 | CTEImpact, 208 | CTEKillPlayerAttachments, 209 | CTELargeFunnel, 210 | CTEMetalSparks, 211 | CTEMuzzleFlash, 212 | CTEParticleSystem, 213 | CTEPhysicsProp, 214 | CTEPlantBomb, 215 | CTEPlayerAnimEvent, 216 | CTEPlayerDecal, 217 | CTEProjectedDecal, 218 | CTERadioIcon, 219 | CTEShatterSurface, 220 | CTEShowLine, 221 | CTesla, 222 | CTESmoke, 223 | CTESparks, 224 | CTESprite, 225 | CTESpriteSpray, 226 | CTest_ProxyToggle_Networkable, 227 | CTestTraceline, 228 | CTEWorldDecal, 229 | CTriggerPlayerMovement, 230 | CTriggerSoundOperator, 231 | CVGuiScreen, 232 | CVoteController, 233 | CWaterBullet, 234 | CWaterLODControl, 235 | CWeaponAug, 236 | CWeaponAWP, 237 | CWeaponBaseItem, 238 | CWeaponBizon, 239 | CWeaponCSBase, 240 | CWeaponCSBaseGun, 241 | CWeaponCycler, 242 | CWeaponElite, 243 | CWeaponFamas, 244 | CWeaponFiveSeven, 245 | CWeaponG3SG1, 246 | CWeaponGalil, 247 | CWeaponGalilAR, 248 | CWeaponGlock, 249 | CWeaponHKP2000, 250 | CWeaponM249, 251 | CWeaponM3, 252 | CWeaponM4A1, 253 | CWeaponMAC10, 254 | CWeaponMag7, 255 | CWeaponMP5Navy, 256 | CWeaponMP7, 257 | CWeaponMP9, 258 | CWeaponNegev, 259 | CWeaponNOVA, 260 | CWeaponP228, 261 | CWeaponP250, 262 | CWeaponP90, 263 | CWeaponSawedoff, 264 | CWeaponSCAR20, 265 | CWeaponScout, 266 | CWeaponSG550, 267 | CWeaponSG552, 268 | CWeaponSG556, 269 | CWeaponShield, 270 | CWeaponSSG08, 271 | CWeaponTaser, 272 | CWeaponTec9, 273 | CWeaponTMP, 274 | CWeaponUMP45, 275 | CWeaponUSP, 276 | CWeaponXM1014, 277 | CWorld, 278 | CWorldVguiText, 279 | DustTrail, 280 | MovieExplosion, 281 | ParticleSmokeGrenade, 282 | RocketTrail, 283 | SmokeTrail, 284 | SporeExplosion, 285 | SporeTrail 286 | }; 287 | -------------------------------------------------------------------------------- /purpura sdk/utilities/globals.cpp: -------------------------------------------------------------------------------- 1 | #include "globals.h" 2 | 3 | namespace global_variables { 4 | c_usercmd* global_cmd = nullptr; 5 | } -------------------------------------------------------------------------------- /purpura sdk/utilities/globals.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../sdk/c_input.h" 4 | 5 | namespace global_variables { 6 | extern c_usercmd* global_cmd; 7 | } -------------------------------------------------------------------------------- /purpura sdk/utilities/render_manager.cpp: -------------------------------------------------------------------------------- 1 | #include "render_manager.h" 2 | 3 | namespace render_manager { 4 | 5 | namespace fonts { 6 | 7 | DWORD main_font; 8 | 9 | } 10 | 11 | } 12 | 13 | void render_manager::init ( ) { 14 | 15 | global_utils::console_log ( "initialising draw manager..." ); 16 | 17 | fonts::main_font = interfaces::surface->create_font ( ); 18 | interfaces::surface->set_font_glyph_set ( fonts::main_font, "Calibri", 14, 500, 0, 0, FONTFLAG_ANTIALIAS | FONTFLAG_OUTLINE ); 19 | 20 | global_utils::console_log ( "draw manager initialised..." ); 21 | 22 | } 23 | 24 | void render_manager::rect ( int x, int y, int w, int h, color color ) { 25 | 26 | interfaces::surface->draw_set_color ( color.r , color.g , color.b , color.a ); 27 | interfaces::surface->draw_outline ( x, y, x + w, y + h ); 28 | 29 | } 30 | 31 | void render_manager::filled_rect ( int x, int y, int w, int h, color color ) { 32 | 33 | interfaces::surface->draw_set_color ( color.r, color.g, color.b, color.a ); 34 | interfaces::surface->draw_filled_rect ( x, y, x + w, y + h ); 35 | 36 | } 37 | 38 | void render_manager::text(const char* text, int x, int y, int font, color color) { 39 | 40 | std::string text_normal = text; 41 | std::wstring text_wide = std::wstring(text_normal.begin(), text_normal.end()); 42 | 43 | interfaces::surface->draw_set_text_color(color.r, color.g, color.b, color.a); 44 | interfaces::surface->draw_set_text_font(font); 45 | interfaces::surface->draw_set_text_pos(x, y); 46 | interfaces::surface->draw_print_text(text_wide.c_str(), text_wide.length(), FONT_DRAW_DEFAULT); 47 | 48 | } 49 | 50 | -------------------------------------------------------------------------------- /purpura sdk/utilities/render_manager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "vector.h" // i don't know why i include "vector.h" but i'm not going to remove it this commit, i really don't want it to break some shit 4 | 5 | #include "../interfaces/interfaces.h" 6 | 7 | namespace render_manager { 8 | 9 | namespace fonts { 10 | 11 | extern DWORD main_font; 12 | 13 | } 14 | 15 | void init ( ); 16 | void rect ( int x, int y, int w, int h, color color ); 17 | void filled_rect ( int x, int y, int w, int h, color color ); 18 | void text ( const char *text, int x, int y, int font, color color ); 19 | 20 | } -------------------------------------------------------------------------------- /purpura sdk/utilities/utilities.cpp: -------------------------------------------------------------------------------- 1 | #include "utilities.h" 2 | 3 | typedef void* ( *create_interface_fn ) ( const char *name, int *return_code ); 4 | 5 | void* global_utils::find_interface ( const char* module, const char* interface_name ) { 6 | 7 | void* interf = nullptr; 8 | auto create_interface = reinterpret_cast(GetProcAddress(GetModuleHandleA(module), "CreateInterface")); 9 | 10 | char possible_interface_name[1024]; 11 | for ( int i = 1; i < 100; i ++ ) 12 | { 13 | sprintf(possible_interface_name, "%s0%i", interface_name, i); 14 | interf = create_interface(possible_interface_name, 0); 15 | if (interf) 16 | break; 17 | 18 | sprintf(possible_interface_name, "%s00%i", interface_name, i); 19 | interf = create_interface(possible_interface_name, 0); 20 | if (interf) 21 | break; 22 | } 23 | 24 | return interf; 25 | 26 | } -------------------------------------------------------------------------------- /purpura sdk/utilities/utilities.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | #include "vmatrix.h" 13 | 14 | #define in_range(x,a,b) (x >= a && x <= b) 15 | 16 | #define get_bits( x ) (in_range((x&(~0x20)),'A','F') ? ((x&(~0x20)) - 'A' + 0xa) : (in_range(x,'0','9') ? x - '0' : 0)) 17 | #define get_byte( x ) (get_bits(x[0]) << 4 | get_bits(x[1])) 18 | 19 | namespace global_utils { 20 | 21 | template 22 | static T* get_interface(char* szModule, char* szInterface) { 23 | 24 | typedef void * (*o_interface_t)(char*, int); 25 | o_interface_t original = (o_interface_t)GetProcAddress(GetModuleHandleA(szModule), "CreateInterface"); 26 | return (T*)original(szInterface, 0); 27 | 28 | } 29 | 30 | void* find_interface(const char* module, const char* interface_name); 31 | 32 | static uintptr_t get_signature(const char* szModule, const char* szSignature) 33 | { 34 | const char* pat = szSignature; 35 | DWORD firstMatch = 0; 36 | DWORD rangeStart = (DWORD)GetModuleHandleA(szModule); 37 | MODULEINFO miModInfo; 38 | GetModuleInformation(GetCurrentProcess(), (HMODULE)rangeStart, &miModInfo, sizeof(MODULEINFO)); 39 | DWORD rangeEnd = rangeStart + miModInfo.SizeOfImage; 40 | for (DWORD pCur = rangeStart; pCur < rangeEnd; pCur++) 41 | { 42 | if (!*pat) 43 | return firstMatch; 44 | 45 | if (*(PBYTE)pat == '\?' || *(BYTE*)pCur == get_byte(pat)) 46 | { 47 | if (!firstMatch) 48 | firstMatch = pCur; 49 | 50 | if (!pat[2]) 51 | return firstMatch; 52 | 53 | if (*(PWORD)pat == '\?\?' || *(PBYTE)pat != '\?') 54 | pat += 3; 55 | 56 | else 57 | pat += 2; 58 | } 59 | else 60 | { 61 | pat = szSignature; 62 | firstMatch = 0; 63 | } 64 | } 65 | return NULL; 66 | 67 | } 68 | 69 | template 70 | static T v_function(void* pClass, int iIndex) { 71 | 72 | PDWORD p_vtable = *(PDWORD*)pClass; 73 | DWORD dw_address = p_vtable[iIndex]; 74 | 75 | return (T)(dw_address); 76 | 77 | } 78 | 79 | static void console_log(const std::string& szOutput) { 80 | 81 | std::cout << "[log:] " << szOutput << "\n"; 82 | 83 | } 84 | 85 | static void console_warn(const std::string& szOutput) { 86 | 87 | std::cout << "[warning:] " << szOutput << "\n"; 88 | 89 | } 90 | 91 | static void console_error(const std::string& szOutput) { 92 | 93 | std::cout << "[ERROR:] " << szOutput << "\n"; 94 | 95 | } 96 | 97 | static void set_clantag(const char* tag, const char* name) { 98 | 99 | static auto p_set_clantag = reinterpret_cast((DWORD)(global_utils::get_signature("engine.dll", "53 56 57 8B DA 8B F9 FF 15"))); 100 | p_set_clantag(tag, name); 101 | 102 | } 103 | 104 | /// - High priority - 105 | /// TODO: Write a netvar manager. 106 | 107 | // hey. if you see this, sorry i didn't add the netvar manager yet. i already wrote it but i'm struggling with it at the moment. thanks for peeping my base! <3 108 | } -------------------------------------------------------------------------------- /purpura sdk/utilities/vector.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class vec2_t { 4 | public: 5 | using vec_t = float; 6 | vec_t x, y; 7 | 8 | vec2_t(vec_t x = 0, vec_t y = 0) : x(x), y(y) {} 9 | }; 10 | 11 | using vec2_t = vec2_t; 12 | 13 | class vec3_t { 14 | public: 15 | using vec_t = float; 16 | vec_t x, y, z; 17 | 18 | vec_t operator[](size_t i) const; 19 | vec_t& operator[](size_t i); 20 | }; 21 | 22 | class q_angle : vec3_t { 23 | public: 24 | vec_t pitch(); 25 | vec_t yaw(); 26 | vec_t roll(); 27 | }; -------------------------------------------------------------------------------- /purpura sdk/utilities/vmatrix.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "vector.h" 5 | 6 | // stolen from my old-ass antario project hehehe... 7 | // wait, what do you mean it's public on valve's github and has been public for years? 8 | // fuck 9 | 10 | using vec_t = float; 11 | 12 | class matrix3x4_t 13 | { 14 | public: 15 | matrix3x4_t() {} 16 | matrix3x4_t( 17 | float m00, float m01, float m02, float m03, 18 | float m10, float m11, float m12, float m13, 19 | float m20, float m21, float m22, float m23) 20 | { 21 | flMatVal[0][0] = m00; flMatVal[0][1] = m01; flMatVal[0][2] = m02; flMatVal[0][3] = m03; 22 | flMatVal[1][0] = m10; flMatVal[1][1] = m11; flMatVal[1][2] = m12; flMatVal[1][3] = m13; 23 | flMatVal[2][0] = m20; flMatVal[2][1] = m21; flMatVal[2][2] = m22; flMatVal[2][3] = m23; 24 | } 25 | //----------------------------------------------------------------------------- 26 | // Creates a matrix where the X axis = forward 27 | // the Y axis = left, and the Z axis = up 28 | //----------------------------------------------------------------------------- 29 | void Init(const vec3_t& xAxis, const vec3_t& yAxis, const vec3_t& zAxis, const vec3_t &vecOrigin) 30 | { 31 | flMatVal[0][0] = xAxis.x; flMatVal[0][1] = yAxis.x; flMatVal[0][2] = zAxis.x; flMatVal[0][3] = vecOrigin.x; 32 | flMatVal[1][0] = xAxis.y; flMatVal[1][1] = yAxis.y; flMatVal[1][2] = zAxis.y; flMatVal[1][3] = vecOrigin.y; 33 | flMatVal[2][0] = xAxis.z; flMatVal[2][1] = yAxis.z; flMatVal[2][2] = zAxis.z; flMatVal[2][3] = vecOrigin.z; 34 | } 35 | 36 | //----------------------------------------------------------------------------- 37 | // Creates a matrix where the X axis = forward 38 | // the Y axis = left, and the Z axis = up 39 | //----------------------------------------------------------------------------- 40 | matrix3x4_t(const vec3_t& xAxis, const vec3_t& yAxis, const vec3_t& zAxis, const vec3_t &vecOrigin) 41 | { 42 | Init(xAxis, yAxis, zAxis, vecOrigin); 43 | } 44 | 45 | inline void SetOrigin(vec3_t const & p) 46 | { 47 | flMatVal[0][3] = p.x; 48 | flMatVal[1][3] = p.y; 49 | flMatVal[2][3] = p.z; 50 | } 51 | 52 | inline void Invalidate(void) 53 | { 54 | for (int i = 0; i < 3; i++) { 55 | for (int j = 0; j < 4; j++) { 56 | flMatVal[i][j] = std::numeric_limits::infinity();; 57 | } 58 | } 59 | } 60 | 61 | float *operator[](int i) { return flMatVal[i]; } 62 | const float *operator[](int i) const { return flMatVal[i]; } 63 | float *Base() { return &flMatVal[0][0]; } 64 | const float *Base() const { return &flMatVal[0][0]; } 65 | 66 | float flMatVal[3][4]; 67 | }; 68 | class VMatrix 69 | { 70 | public: 71 | 72 | VMatrix(); 73 | VMatrix( 74 | vec_t m00, vec_t m01, vec_t m02, vec_t m03, 75 | vec_t m10, vec_t m11, vec_t m12, vec_t m13, 76 | vec_t m20, vec_t m21, vec_t m22, vec_t m23, 77 | vec_t m30, vec_t m31, vec_t m32, vec_t m33 78 | ); 79 | 80 | // Creates a matrix where the X axis = forward 81 | // the Y axis = left, and the Z axis = up 82 | VMatrix(const vec3_t& forward, const vec3_t& left, const vec3_t& up); // cool 83 | 84 | // Construct from a 3x4 matrix 85 | VMatrix(const matrix3x4_t& matrix3x4); 86 | 87 | // Set the values in the matrix. 88 | void Init( 89 | vec_t m00, vec_t m01, vec_t m02, vec_t m03, 90 | vec_t m10, vec_t m11, vec_t m12, vec_t m13, 91 | vec_t m20, vec_t m21, vec_t m22, vec_t m23, 92 | vec_t m30, vec_t m31, vec_t m32, vec_t m33 93 | ); 94 | 95 | 96 | // Initialize from a 3x4 97 | void Init(const matrix3x4_t& matrix3x4); 98 | 99 | // array access 100 | inline float* operator[](int i) 101 | { 102 | return m[i]; 103 | } 104 | 105 | inline const float* operator[](int i) const 106 | { 107 | return m[i]; 108 | } 109 | 110 | // Get a pointer to m[0][0] 111 | inline float *Base() 112 | { 113 | return &m[0][0]; 114 | } 115 | 116 | inline const float *Base() const 117 | { 118 | return &m[0][0]; 119 | } 120 | 121 | void SetLeft(const vec3_t &vLeft); 122 | void SetUp(const vec3_t &vUp); 123 | void SetForward(const vec3_t &vForward); 124 | 125 | void GetBasisVectors(vec3_t &vForward, vec3_t &vLeft, vec3_t &vUp) const; 126 | void SetBasisVectors(const vec3_t &vForward, const vec3_t &vLeft, const vec3_t &vUp); 127 | 128 | // Get/set the translation. 129 | vec3_t & GetTranslation(vec3_t &vTrans) const; 130 | void SetTranslation(const vec3_t &vTrans); 131 | 132 | void PreTranslate(const vec3_t &vTrans); 133 | void PostTranslate(const vec3_t &vTrans); 134 | 135 | matrix3x4_t& As3x4(); 136 | const matrix3x4_t& As3x4() const; 137 | void CopyFrom3x4(const matrix3x4_t &m3x4); 138 | void Set3x4(matrix3x4_t& matrix3x4) const; 139 | 140 | bool operator==(const VMatrix& src) const; 141 | bool operator!=(const VMatrix& src) const { return !(*this == src); } 142 | 143 | // Access the basis vectors. 144 | vec3_t GetLeft() const; 145 | vec3_t GetUp() const; 146 | vec3_t GetForward() const; 147 | vec3_t GetTranslation() const; 148 | 149 | 150 | // Matrix->vector operations. 151 | public: 152 | // Multiply by a 3D vector (same as operator*). 153 | void V3Mul(const vec3_t &vIn, vec3_t &vOut) const; 154 | 155 | // Multiply by a 4D vector. 156 | //void V4Mul( const Vector4D &vIn, Vector4D &vOut ) const; 157 | 158 | // Applies the rotation (ignores translation in the matrix). (This just calls VMul3x3). 159 | vec3_t ApplyRotation(const vec3_t &vVec) const; 160 | 161 | // Multiply by a vector (divides by w, assumes input w is 1). 162 | vec3_t operator*(const vec3_t &vVec) const; 163 | 164 | // Multiply by the upper 3x3 part of the matrix (ie: only apply rotation). 165 | vec3_t VMul3x3(const vec3_t &vVec) const; 166 | 167 | // Apply the inverse (transposed) rotation (only works on pure rotation matrix) 168 | vec3_t VMul3x3Transpose(const vec3_t &vVec) const; 169 | 170 | // Multiply by the upper 3 rows. 171 | vec3_t VMul4x3(const vec3_t &vVec) const; 172 | 173 | // Apply the inverse (transposed) transformation (only works on pure rotation/translation) 174 | vec3_t VMul4x3Transpose(const vec3_t &vVec) const; 175 | 176 | 177 | // Matrix->plane operations. 178 | //public: 179 | // Transform the plane. The matrix can only contain translation and rotation. 180 | //void TransformPlane( const VPlane &inPlane, VPlane &outPlane ) const; 181 | 182 | // Just calls TransformPlane and returns the result. 183 | //VPlane operator*(const VPlane &thePlane) const; 184 | 185 | // Matrix->matrix operations. 186 | public: 187 | 188 | VMatrix& operator=(const VMatrix &mOther); 189 | 190 | // Multiply two matrices (out = this * vm). 191 | void MatrixMul(const VMatrix &vm, VMatrix &out) const; 192 | 193 | // Add two matrices. 194 | const VMatrix& operator+=(const VMatrix &other); 195 | 196 | // Just calls MatrixMul and returns the result. 197 | VMatrix operator*(const VMatrix &mOther) const; 198 | 199 | // Add/Subtract two matrices. 200 | VMatrix operator+(const VMatrix &other) const; 201 | VMatrix operator-(const VMatrix &other) const; 202 | 203 | // Negation. 204 | VMatrix operator-() const; 205 | 206 | // Return inverse matrix. Be careful because the results are undefined 207 | // if the matrix doesn't have an inverse (ie: InverseGeneral returns false). 208 | VMatrix operator~() const; 209 | 210 | // Matrix operations. 211 | public: 212 | // Set to identity. 213 | void Identity(); 214 | 215 | bool IsIdentity() const; 216 | 217 | // Setup a matrix for origin and angles. 218 | void SetupMatrixOrgAngles(const vec3_t &origin, const q_angle &vAngles); 219 | 220 | // General inverse. This may fail so check the return! 221 | bool InverseGeneral(VMatrix &vInverse) const; 222 | 223 | // Does a fast inverse, assuming the matrix only contains translation and rotation. 224 | void InverseTR(VMatrix &mRet) const; 225 | 226 | // Usually used for debug checks. Returns true if the upper 3x3 contains 227 | // unit vectors and they are all orthogonal. 228 | bool IsRotationMatrix() const; 229 | 230 | // This calls the other InverseTR and returns the result. 231 | VMatrix InverseTR() const; 232 | 233 | // Get the scale of the matrix's basis vectors. 234 | vec3_t GetScale() const; 235 | 236 | // (Fast) multiply by a scaling matrix setup from vScale. 237 | VMatrix Scale(const vec3_t &vScale); 238 | 239 | // Normalize the basis vectors. 240 | VMatrix NormalizeBasisVectors() const; 241 | 242 | // Transpose. 243 | VMatrix Transpose() const; 244 | 245 | // Transpose upper-left 3x3. 246 | VMatrix Transpose3x3() const; 247 | 248 | public: 249 | // The matrix. 250 | vec_t m[4][4]; 251 | }; -------------------------------------------------------------------------------- /purpura sdk/utilities/vmt.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | class vmt { 9 | private: 10 | 11 | std::unique_ptr p_newvmt = nullptr; 12 | std::uintptr_t** p_baseclass = nullptr; 13 | std::uintptr_t* p_ogvmt = nullptr; 14 | std::size_t index_count = 0; 15 | 16 | public: 17 | 18 | vmt ( void* pp_class ) { 19 | 20 | this->p_baseclass = static_cast < std::uintptr_t** > ( pp_class ); 21 | 22 | while ( static_cast < std::uintptr_t* > ( *this->p_baseclass ) [ this->index_count ] ) 23 | ++this->index_count; 24 | 25 | const std::size_t size_table = this->index_count * sizeof ( std::uintptr_t ); 26 | 27 | this->p_ogvmt = *this->p_baseclass; 28 | this->p_newvmt = std::make_unique < std::uintptr_t [ ] > ( this->index_count ); 29 | 30 | std::memcpy ( this->p_newvmt.get ( ), this->p_ogvmt, size_table ); 31 | 32 | *this->p_baseclass = this->p_newvmt.get ( ); 33 | 34 | }; 35 | ~vmt ( ) { *this->p_baseclass = this->p_ogvmt; }; 36 | 37 | template 38 | T get_original ( const std::size_t index ) { 39 | 40 | return reinterpret_cast < T > ( this->p_ogvmt [ index ] ); 41 | 42 | }; 43 | 44 | HRESULT hook( const std::size_t index, void* fn_new ) { 45 | 46 | if ( index > this->index_count ) 47 | return E_INVALIDARG; 48 | 49 | this->p_newvmt [ index ] = reinterpret_cast < std::uintptr_t > (fn_new); 50 | return S_OK; 51 | 52 | }; 53 | 54 | HRESULT unhook( const std::size_t index ) { 55 | 56 | if ( index > this->index_count ) 57 | return E_INVALIDARG; 58 | 59 | this->p_newvmt [ index ] = this->p_ogvmt [ index ]; 60 | return S_OK; 61 | 62 | }; 63 | 64 | }; --------------------------------------------------------------------------------