├── README.md ├── fatality_gui └── menu │ ├── config │ ├── config.cpp │ ├── config.h │ ├── json.h │ └── tsl │ │ ├── robin_growth_policy.h │ │ ├── robin_hash.h │ │ ├── robin_map.h │ │ └── robin_set.h │ ├── controls │ ├── button.cpp │ ├── button.h │ ├── checkbox.cpp │ ├── checkbox.h │ ├── colorpicker.cpp │ ├── colorpicker.h │ ├── combobox.cpp │ ├── combobox.h │ ├── control.cpp │ ├── control.h │ ├── keybind.cpp │ ├── keybind.h │ ├── listbox.cpp │ ├── listbox.h │ ├── multi-selectable.cpp │ ├── multi-selectable.h │ ├── slider.cpp │ ├── slider.h │ ├── subtab.cpp │ ├── subtab.h │ ├── tab.cpp │ ├── tab.h │ ├── textbox.cpp │ ├── textbox.h │ ├── window.cpp │ └── window.h │ ├── external_include.h │ ├── include_menu.h │ ├── menu.cpp │ ├── menu.h │ └── picture_data.h ├── internal_hvh.sln └── internal_hvh ├── DLLMain.cpp ├── Header.hpp ├── convar.h ├── cthash.h ├── features ├── aimbot.cpp ├── aimbot.h ├── animations - Kopie.cpp ├── animations.cpp ├── animations.h ├── antiaim.cpp ├── antiaim.h ├── autostrafer.cpp ├── autostrafer.h ├── beams.cpp ├── beams.h ├── bone_setup.cpp ├── bone_setup.h ├── chams.cpp ├── chams.h ├── console_log.cpp ├── console_log.h ├── dormant_esp.cpp ├── dormant_esp.h ├── fake_ping.cpp ├── fake_ping.h ├── freestanding.cpp ├── freestanding.h ├── glow.cpp ├── glow.h ├── grenade_predict.cpp ├── grenade_predict.h ├── hitmarker.cpp ├── hitmarker.h ├── include_features.h ├── inventorychanger.cpp ├── inventorychanger.h ├── lag_compensation.cpp ├── lag_compensation.h ├── misc.cpp ├── misc.h ├── player_log.cpp ├── player_log.h ├── prediction.cpp ├── prediction.h ├── resolver.cpp ├── resolver.h ├── skinchanger.cpp ├── skinchanger.h ├── structs.h ├── thirdperson.cpp ├── thirdperson.h ├── tickbase_shift.cpp ├── tickbase_shift.h ├── visuals.cpp ├── visuals.h ├── wall_penetration.cpp └── wall_penetration.h ├── globals.cpp ├── globals.h ├── hooks ├── con_vars.cpp ├── create_move.cpp ├── do_extra_bone_processing.cpp ├── do_post_screen_space_effects.cpp ├── draw_model_execute.cpp ├── emit_sound.cpp ├── eye_angles.cpp ├── fire_bullets.cpp ├── frame_stage_notify.cpp ├── hooks.cpp ├── hooks.h ├── is_box_visible.cpp ├── is_connected.cpp ├── is_hltv.cpp ├── m_angEyeAngles0Proxy.cpp ├── m_angEyeAngles1Proxy.cpp ├── m_angRotationProxy.cpp ├── m_flLowerBodyYawTargetProxy.cpp ├── override_view.cpp ├── paint_traverse.cpp ├── play_sound.cpp ├── prediction.cpp ├── present.cpp ├── process_input.cpp ├── render_view.cpp ├── reset.cpp ├── runcmd.cpp ├── scene_end.cpp ├── send_datagram.cpp ├── sequence.cpp ├── smoke_effect.cpp ├── temp_entities.cpp ├── trace_ray.cpp ├── wnd_proc.cpp └── writeusercmddeltatobuffer.cpp ├── include_cheat.h ├── includes.h ├── internal_hvh.vcxproj ├── internal_hvh.vcxproj.filters ├── internal_hvh.vcxproj.user ├── misc ├── d3dfont.cpp ├── d3dfont.h ├── datamap.h ├── dlight.h ├── hitsounds.h ├── hybrid_hook.h ├── init.cpp ├── init.h ├── listeners.cpp ├── listeners.h ├── math.cpp ├── math.h ├── netvars.cpp ├── netvars.h ├── offsets.cpp ├── offsets.h ├── recv_prop_hook.h ├── render.cpp ├── render.h ├── tinyformat.h ├── util.cpp └── util.h ├── resource.h ├── sdk ├── CBoneChache.h ├── CCSGOPlayerAnimState.h ├── CCSGameRulesProxy.h ├── CEconItem.cpp ├── CEconItem.h ├── CNetChannel.h ├── CPlayerInventory.cpp ├── CPlayerInventory.h ├── ClientClass.h ├── ConVar.h ├── IClientEntity.h ├── IMaterial.h ├── IMaterialVar.h ├── INetChannelInfo.h ├── IRefCounted.h ├── checksum_md5.cpp ├── checksum_md5.h ├── datatypes │ ├── CUtlVector.h │ ├── Color.h │ ├── QAngle.h │ ├── VMatrix.h │ ├── Vector.h │ ├── Vector2D.h │ ├── Vector4D.h │ └── matrix3x4_t.h ├── defines.h ├── entity_classes.cpp ├── entity_classes.h ├── include_sdk.h ├── interfaces │ ├── CGlowObjectManager.cpp │ ├── CGlowObjectManager.h │ ├── CHud.h │ ├── CSPlayerResource.h │ ├── IBaseClientDll.h │ ├── ICVar.h │ ├── IClientEntityList.h │ ├── IClientModeShared.h │ ├── IClientState.h │ ├── IEngineClient.h │ ├── IEngineTrace.h │ ├── IGameEventManager.h │ ├── IGlobalVarsBase.h │ ├── IInput.h │ ├── ILocalize.h │ ├── IMatRenderContext.h │ ├── IMaterialSystem.h │ ├── IMemAlloc.h │ ├── IMoveHelper.h │ ├── IPhysicsSurfaceProps.h │ ├── IPrediction.h │ ├── ISurface.h │ ├── IVDebugOverlay.h │ ├── IVModelInfo.h │ ├── IVModelRender.h │ ├── IVPanel.h │ ├── IVRenderView.h │ ├── IViewRender.h │ ├── IViewRenderBeams.h │ ├── IWeaponSystem.h │ ├── interfaces.cpp │ └── interfaces.h ├── misc.h ├── structs.h └── trace_ray.h ├── singleton.h └── threadsafe_deque.h /README.md: -------------------------------------------------------------------------------- 1 | # BloodNET 2 | My cheat for old HvH 3 | 4 | I will update it in future. Besides, I need help with this cheat and I`ll be glad to get it from you. 5 | Akatsuki#5644 or vk.com/akatsukisun 6 | 7 | https://i.imgur.com/OFUCyjM.png 8 | -------------------------------------------------------------------------------- /fatality_gui/menu/controls/button.cpp: -------------------------------------------------------------------------------- 1 | #include "../external_include.h" 2 | 3 | c_button::c_button( std::string name, bounds pbounds, uintptr_t function, c_subtab* parent ) 4 | { 5 | this->m_name = name; 6 | this->m_bounds = pbounds; 7 | this->m_function = function; 8 | this->m_parent = parent; 9 | } 10 | 11 | void c_button::render() 12 | { 13 | bool pressed = c_menu::get().is_holding(m_bounds) || c_menu::get().is_pressed(m_bounds); 14 | 15 | render::get().bordered_box(m_bounds.x, m_bounds.y, BUTTON_WIDTH, BUTTON_HEIGHT, 16 | pressed ? D3DCOLOR_RGBA(235, 5, 90, 250) : m_hovered ? D3DCOLOR_RGBA(235, 5, 90, (int)(220 * hover_progress)) : D3DCOLOR_RGBA(60, 53, 93, 190)); 17 | 18 | render::get().filled_box(m_bounds.x + 2, m_bounds.y + 2, BUTTON_WIDTH - 4, 19 | BUTTON_HEIGHT - 4, 20 | D3DCOLOR_RGBA(33, 27, 70, 250)); 21 | 22 | _u(name, m_name); 23 | render::get().text(Vector2D(m_bounds.x + BUTTON_WIDTH / 2, 24 | m_bounds.y + BUTTON_HEIGHT / 2 - (render::get().get_text_size(name, fonts::controlfont).y / 2)), 25 | name, Color(180, 180, 187, 250), fonts::controlfont, c_font::centered_x); 26 | } 27 | 28 | void c_button::update() 29 | { 30 | if ( c_menu::get().is_hovering( m_bounds ) ) 31 | m_hovered = true; 32 | else 33 | m_hovered = false; 34 | 35 | if ( m_hovered && hover_progress < 1.f ) 36 | hover_progress += m_frequence * g_pGlobals->frametime; 37 | else if ( !m_hovered && hover_progress > 0.f ) 38 | hover_progress -= m_frequence * g_pGlobals->frametime; 39 | 40 | if ( hover_progress < 0.f ) 41 | hover_progress = 0.f; 42 | if ( hover_progress > 1.f ) 43 | hover_progress = 1.f; 44 | 45 | if ( c_menu::get().is_pressed( m_bounds ) ) 46 | { 47 | auto function = m_function; 48 | if ( !function ) 49 | return; 50 | 51 | __asm 52 | { 53 | CALL function; 54 | } 55 | } 56 | 57 | } 58 | 59 | void c_button::update_pos_individual( LONG xdrag, LONG ydrag ) 60 | { 61 | 62 | } -------------------------------------------------------------------------------- /fatality_gui/menu/controls/button.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class c_subtab; 4 | struct bounds; 5 | class c_groupwindow; 6 | class c_button : public singleton, public c_control 7 | { 8 | public: 9 | c_button( std::string name, bounds bounds, uintptr_t function, c_subtab* parent ); 10 | 11 | void render(); 12 | void update(); 13 | void update_pos_individual( LONG xdrag, LONG ydrag ); 14 | private: 15 | float hover_progress; 16 | 17 | c_subtab* m_parent; 18 | 19 | bool m_hovered; 20 | 21 | uintptr_t m_function = 0; 22 | 23 | float m_frequence = 1.f / .1f; 24 | }; 25 | -------------------------------------------------------------------------------- /fatality_gui/menu/controls/checkbox.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class c_groupwindow; 4 | class c_checkbox : public singleton, public c_control 5 | { 6 | public: 7 | c_checkbox( std::string name, bounds bounds, std::string option, c_subtab* parent ); 8 | 9 | void render(); 10 | void update(); 11 | void update_pos_individual( LONG xdrag, LONG ydrag ); 12 | private: 13 | float anim_progress; 14 | float hover_progress; 15 | float checkmark_progress; 16 | 17 | c_subtab* m_parent; 18 | 19 | bool m_hovered; 20 | std::string m_value; 21 | 22 | float m_frequence = 1.f / .1f; 23 | }; 24 | -------------------------------------------------------------------------------- /fatality_gui/menu/controls/colorpicker.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class c_subtab; 4 | class c_colorpicker : public singleton, public c_control 5 | { 6 | public: 7 | c_colorpicker( std::string name, bounds bounds, std::string option, D3DCOLOR default_color, c_subtab* parent, bool alpha_slider = false ); 8 | 9 | void render(); 10 | void update(); 11 | void update_pos_individual( LONG xdrag, LONG ydrag ); 12 | private: 13 | c_subtab * m_parent; 14 | 15 | float m_colHSV[ 3 ]; 16 | 17 | float hover_progress; 18 | float anim_progress; 19 | 20 | bool m_hovered; 21 | 22 | bounds m_picker_bounds; 23 | bounds m_box_bounds; 24 | bounds m_hue_bounds; 25 | bounds m_alpha_bounds; 26 | 27 | POINT m_alpha_mouse_pos; 28 | POINT m_hue_mouse_pos; 29 | POINT m_picker_mouse_pos; 30 | 31 | std::string m_value; 32 | bool m_active; 33 | bool m_showalpha; 34 | 35 | int m_curfocus; //0-none 1-main 2-hue 3-alpha 36 | 37 | float m_frequence = 1.f / .1f; 38 | 39 | POINT m_pickerpos; 40 | }; 41 | 42 | -------------------------------------------------------------------------------- /fatality_gui/menu/controls/combobox.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct bounds; 4 | class c_subtab; 5 | class c_combobox : public singleton, public c_control 6 | { 7 | public: 8 | c_combobox( std::string name, bounds bounds, std::string option, std::vector* items, c_subtab* parent ); 9 | 10 | void render(); 11 | void update(); 12 | void update_pos_individual( LONG xdrag, LONG ydrag ); 13 | private: 14 | c_subtab * m_parent; 15 | 16 | std::vector m_items; 17 | 18 | float hover_progress; 19 | float anim_progress; 20 | 21 | bool m_hovered; 22 | 23 | std::string m_value; 24 | bool m_active; 25 | 26 | float m_frequence = 1.f / .1f; 27 | }; 28 | 29 | -------------------------------------------------------------------------------- /fatality_gui/menu/controls/control.cpp: -------------------------------------------------------------------------------- 1 | #include "../external_include.h" 2 | 3 | void c_control::update_pos( LONG xdrag, LONG ydrag ) 4 | { 5 | m_bounds.x += xdrag; 6 | m_bounds.y += ydrag; 7 | } 8 | 9 | int c_control::get_size() 10 | { 11 | return 0; 12 | } -------------------------------------------------------------------------------- /fatality_gui/menu/controls/control.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class c_control : public singleton 4 | { 5 | public: 6 | virtual void render( ) = 0; 7 | virtual void update( ) = 0; 8 | virtual void update_pos_individual( LONG xdrag, LONG ydrag ) = 0; 9 | 10 | void update_pos( LONG xdrag, LONG ydrag ); 11 | 12 | int get_size(); 13 | protected: 14 | std::string m_name; 15 | bounds m_bounds; 16 | }; -------------------------------------------------------------------------------- /fatality_gui/menu/controls/keybind.cpp: -------------------------------------------------------------------------------- 1 | #include "../external_include.h" 2 | 3 | const char* keys[] = { "NO KEY", "M1", "M2", "BRK", "M3", "M4", "M5", 4 | "UNK", "BSPC", "TAB", "UNK", "UNK", "UNK", "ENTER", "UNK", "UNK", "SHFT", 5 | "CTRL", "ALT","PAUSE","CAPS", "UNK", "UNK", "UNK", "UNK", "UNK", "UNK", 6 | "ESC", "UNK", "UNK", "UNK", "UNK", "SPACE","PGUP", "PGDOWN", "END", "HOME", "Left", 7 | "UP", "RIGHT", "DOWN", "UNK", "PRNT", "UNK", "PRTSCR", "INS","DEL", "UNK", "0", "1", 8 | "2", "3", "4", "5", "6", "7", "8", "9", "UNK", "UNK", "UNK", "UNK", "UNK", "UNK", 9 | "UNK", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", 10 | "V", "W", "X","Y", "Z", "LFTWIN", "RGHTWIN", "UNK", "UNK", "UNK", "NUM0", "NUM1", 11 | "NUM2", "NUM3", "NUM4", "NUM5", "NUM6","NUM7", "NUM8", "NUM9", "*", "+", "UNK", "-", ".", "/", "F1", "F2", "F3", 12 | "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12","F13", "F14", "F15", "F16", "F17", "F18", "F19", "F20", "F21", 13 | "F22", "F23", "F24", "UNK", "UNK", "UNK", "UNK", "UNK","UNK", "UNK", "UNK", 14 | "NUMLCK", "SCRLLCK", "UNK", "UNK", "UNK", "UNK", "UNK", "UNK", "UNK", 15 | "UNK", "UNK","UNK", "UNK", "UNK", "UNK", "UNK", "LSHFT", "RSHFT", "LCTRL", 16 | "RCTRL", "LMENU", "RMENU", "UNK","UNK", "UNK","UNK", "UNK", "UNK", "UNK", 17 | "UNK", "UNK", "UNK", "NTRK", "PTRK", "STOP", "PLAY", "UNK", "UNK", 18 | "UNK", "UNK", "UNK", "UNK", ";", "+", ",", "-", ".", "?", "~", "UNK", "UNK", 19 | "UNK", "UNK","UNK", "UNK", "UNK", "UNK", "UNK", "UNK", "UNK", 20 | "UNK", "UNK", "UNK", "UNK", "UNK", "UNK", "UNK", "UNK","UNK", 21 | "UNK", "UNK", "UNK", "UNK", "UNK", "UNK", "UNK", "UNK", "UNK", "UNK", "UNK", 22 | "UNK", "UNK", "UNK","UNK", "UNK", "UNK", "UNK", "UNK", "UNK", 23 | "UNK", "UNK", "UNK", "UNK", "UNK", "UNK", "UNK", "UNK", "UNK", 24 | "UNK", "UNK", "UNK", "UNK", "UNK", "UNK", "UNK", "UNK", "UNK", 25 | "UNK", "UNK" }; 26 | 27 | c_keybind::c_keybind(std::string name, bounds pbounds, std::string option, c_subtab* parent) 28 | { 29 | this->m_name = name; 30 | this->m_bounds = pbounds; 31 | this->m_value = option; 32 | this->m_parent = parent; 33 | } 34 | 35 | void c_keybind::render() 36 | { 37 | render::get().bordered_box(m_bounds.x, m_bounds.y, KEYBIND_WIDTH, BUTTON_HEIGHT, 38 | m_listening ? D3DCOLOR_RGBA(235, 5, 90, 250) : m_hovered ? D3DCOLOR_RGBA(235, 5, 90, (int)(220 * hover_progress)) : D3DCOLOR_RGBA(60, 53, 93, 190)); 39 | 40 | render::get().filled_box(m_bounds.x + 2, m_bounds.y + 2, KEYBIND_WIDTH - 4, 41 | KEYBIND_HEIGHT - 4, 42 | D3DCOLOR_RGBA(33, 27, 70, 250)); 43 | _u(key, m_value); 44 | 45 | render::get().text(Vector2D(m_bounds.x + KEYBIND_WIDTH / 2, 46 | m_bounds.y + 5), 47 | keys[g_cfg[key]->get()], Color(180, 180, 187, 250), fonts::controlfont, c_font::centered_x); 48 | 49 | _u(name, m_name); 50 | render::get().text(Vector2D(m_bounds.x + KEYBIND_WIDTH + 12, 51 | m_bounds.y + KEYBIND_HEIGHT / 2 - (render::get().get_text_size(name, fonts::controlfont).y / 2)), 52 | name, Color(180, 180, 187, 250), fonts::controlfont); 53 | } 54 | 55 | void c_keybind::update() 56 | { 57 | if (c_menu::get().is_hovering(m_bounds)) 58 | m_hovered = true; 59 | else 60 | m_hovered = false; 61 | 62 | if (m_hovered && hover_progress < 1.f) 63 | hover_progress += m_frequence * g_pGlobals->frametime; 64 | else if (!m_hovered && hover_progress > 0.f) 65 | hover_progress -= m_frequence * g_pGlobals->frametime; 66 | 67 | if (hover_progress < 0.f) 68 | hover_progress = 0.f; 69 | if (hover_progress > 1.f) 70 | hover_progress = 1.f; 71 | 72 | if (m_listening) 73 | { 74 | _u(key, m_value); 75 | for (auto i = 0; i < 255; ++i) 76 | { 77 | // a key is updated 78 | if (c_menu::get().key_updated(i)) 79 | { 80 | // menu or escape key kills the listener 81 | if (i == VK_ESCAPE) 82 | { 83 | g_cfg[key]->set(0); 84 | m_listening = false; 85 | break; 86 | } 87 | 88 | // we have a valid key 89 | else 90 | { 91 | g_cfg[key]->set(i); 92 | m_listening = false; 93 | break; 94 | } 95 | } 96 | } 97 | } 98 | if (c_menu::get().is_pressed(m_bounds) && !m_listening) 99 | { 100 | m_listening = true; 101 | } 102 | } 103 | 104 | void c_keybind::update_pos_individual(LONG xdrag, LONG ydrag) 105 | { 106 | 107 | } -------------------------------------------------------------------------------- /fatality_gui/menu/controls/keybind.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class c_groupwindow; 4 | class c_keybind : public singleton, public c_control 5 | { 6 | public: 7 | c_keybind( std::string name, bounds bounds, std::string option, c_subtab* parent ); 8 | 9 | void render(); 10 | void update(); 11 | void update_pos_individual( LONG xdrag, LONG ydrag ); 12 | private: 13 | float hover_progress; 14 | 15 | c_subtab* m_parent; 16 | 17 | bool m_listening; 18 | bool m_hovered; 19 | 20 | std::string m_value; 21 | 22 | float m_frequence = 1.f / .1f; 23 | }; 24 | -------------------------------------------------------------------------------- /fatality_gui/menu/controls/listbox.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class c_subtab; 4 | class c_listbox : public singleton, public c_control 5 | { 6 | public: 7 | c_listbox(std::string name, bounds bounds, std::string option, std::vector& items, c_subtab* paren); 8 | c_listbox(std::string name, bounds bounds, std::string option, std::vector& items, std::string& filter, c_subtab* paren); 9 | 10 | void render(); 11 | void update(); 12 | void update_pos_individual( LONG xdrag, LONG ydrag ); 13 | private: 14 | void handle_scrollbar( ); 15 | 16 | void get_items( ); 17 | bool should_show( std::string xd ); 18 | std::vector lower_items; 19 | 20 | void render_scroll(int x, int y, int h, float min, float max, void* value); 21 | c_subtab * m_parent; 22 | 23 | bounds m_scrollbounds; 24 | 25 | std::vector* m_items; 26 | std::string* filter; 27 | std::string prevfilter = "123123123123"; 28 | 29 | float hover_progress; 30 | float anim_progress; 31 | 32 | bool m_hovered; 33 | 34 | std::string m_value; 35 | bool m_active; 36 | 37 | int m_maxitems = 12; 38 | float m_cur = 0; 39 | 40 | bool m_scrolling; 41 | int m_scrollpos; 42 | 43 | std::vector< std::pair> temp; 44 | 45 | float m_frequence = 1.f / .1f; 46 | }; 47 | 48 | -------------------------------------------------------------------------------- /fatality_gui/menu/controls/multi-selectable.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class c_subtab; 4 | class c_multi : public singleton, public c_control 5 | { 6 | public: 7 | c_multi(std::string name, bounds bounds, std::vector* first_items, std::vector* second_items, c_subtab* parent); 8 | 9 | void render(); 10 | void update(); 11 | void update_pos_individual( LONG xdrag, LONG ydrag ); 12 | private: 13 | std::string get_preview(); 14 | 15 | c_subtab * m_parent; 16 | 17 | std::vector first_items; 18 | std::vector second_items; 19 | 20 | float hover_progress; 21 | float anim_progress; 22 | 23 | bool m_hovered; 24 | 25 | bool m_active; 26 | 27 | float m_frequence = 1.f / .1f; 28 | }; 29 | 30 | -------------------------------------------------------------------------------- /fatality_gui/menu/controls/slider.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class c_subtab; 4 | class c_slider : public singleton, public c_control 5 | { 6 | public: 7 | c_slider( std::string name, bounds bounds, std::string option, float min, float max, c_subtab* parent, std::string format = "%.2f" ); 8 | c_slider( std::string name, bounds bounds, std::string option, int min, int max, c_subtab* parent, std::string format = "" ); 9 | 10 | void render(); 11 | void update(); 12 | void update_pos_individual( LONG xdrag, LONG ydrag ); 13 | private: 14 | float round_value(); 15 | 16 | c_subtab * m_parent; 17 | 18 | float hover_progress; 19 | 20 | bool m_hovered; 21 | 22 | std::string m_format; 23 | 24 | float m_min; 25 | float m_max; 26 | 27 | bool m_roundvalue; 28 | 29 | std::string m_value; 30 | bool m_active; 31 | bool m_wasactive; 32 | bool m_cantuse; 33 | }; -------------------------------------------------------------------------------- /fatality_gui/menu/controls/subtab.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class c_subtab : public singleton 4 | { 5 | public: 6 | c_subtab( std::string name, int id, c_window* window, c_tab* tab ); 7 | void render( bool active ); 8 | bool update(); 9 | 10 | void add_checkbox( std::string name, std::string option, bool sameline = false ); 11 | void add_combobox( std::string name, std::string option, std::vector* items, bool sameline = false ); 12 | void add_slider( std::string name, std::string option, float min, float max, std::string format = "%.2f", bool sameline = false ); 13 | void add_slider( std::string name, std::string option, int min, int max, std::string format = "", bool sameline = false ); 14 | void add_button( std::string name, void* function, bool sameline = false ); 15 | void add_keybind( std::string name, std::string option, bool sameline = false ); 16 | void add_colorpicker( std::string name, std::string option, D3DCOLOR default_color, bool sameline = false, bool show_alpha = false ); 17 | void add_multi( std::string name, std::vector* first_items, std::vector* second_items, bool sameline = false ); 18 | void add_listbox( std::string name, std::vector& items, std::string option, float width, float height, bool sameline = false ); 19 | void add_listbox( std::string name, std::vector& items, std::string option, float width, float height, std::string& filter, bool sameline = false ); 20 | void add_textbox( std::string name, std::string& option, bool sameline = false ); 21 | 22 | std::vector m_controls; 23 | 24 | c_control* focussed_control; 25 | private: 26 | c_tab * parent_tab; 27 | c_window * parent_window; 28 | 29 | int m_id; 30 | std::string m_name; 31 | bool* m_selected; 32 | 33 | int m_current_ypos; 34 | int last_xpos; 35 | int last_ysize; 36 | }; 37 | -------------------------------------------------------------------------------- /fatality_gui/menu/controls/tab.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class c_tab : public singleton 4 | { 5 | public: 6 | c_tab( std::string name, int id, c_window* window ); 7 | void render( bool selected ); 8 | bool update(); 9 | 10 | bool is_selected(); 11 | 12 | c_subtab* add_subtab( std::string name ); 13 | void pushback_subtab( c_subtab* tab ); 14 | 15 | std::string m_name; 16 | 17 | std::vector m_subtabs; 18 | private: 19 | int m_tabamount; 20 | 21 | c_subtab * m_selected_subtab; 22 | 23 | c_window * parent_window; 24 | int m_id; 25 | bool* m_selected; 26 | int add = 80; 27 | }; 28 | -------------------------------------------------------------------------------- /fatality_gui/menu/controls/textbox.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class c_groupwindow; 4 | class c_textbox : public singleton, public c_control 5 | { 6 | public: 7 | c_textbox(std::string name, bounds bounds, std::string& option, c_subtab* parent); 8 | 9 | void render(); 10 | void update(); 11 | void update_pos_individual( LONG xdrag, LONG ydrag ); 12 | private: 13 | float hover_progress; 14 | 15 | c_subtab* m_parent; 16 | 17 | bool m_listening; 18 | bool m_hovered; 19 | 20 | std::string* m_value; 21 | 22 | float m_frequence = 1.f / .1f; 23 | }; 24 | -------------------------------------------------------------------------------- /fatality_gui/menu/controls/window.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class c_tab; 4 | class c_groupwindow; 5 | class c_subtab; 6 | class c_window : public singleton, public c_menu 7 | { 8 | public: 9 | c_window( std::string name, bounds bounds, bool tabs ); 10 | void set_active( bool active ); 11 | void render(); 12 | void update_controls( LONG xdrag, LONG ydrag ); 13 | void handle_movement(); 14 | 15 | c_tab* add_tab( std::string name ); 16 | void pushback_tab( c_tab* tab ); 17 | 18 | c_groupwindow* add_groupwindow( std::string name, bounds bounds ); 19 | void pushback_groupwindow( c_groupwindow* window ); 20 | 21 | std::vector m_tabs; 22 | std::vector m_groups; 23 | 24 | bounds m_area; 25 | bounds m_tabarea; 26 | bounds m_subtabarea; 27 | 28 | c_groupwindow* focussed_window; 29 | 30 | LPDIRECT3DTEXTURE9 img; 31 | LPD3DXSPRITE sprite; 32 | LPDIRECT3DTEXTURE9 img_big; 33 | LPD3DXSPRITE sprite_big; 34 | private: 35 | std::string m_name; 36 | 37 | bounds m_bounds; 38 | 39 | POINT m_drag_offset; 40 | bool m_is_dragged; 41 | 42 | c_tab* m_selected_tab; 43 | int m_tabamount; 44 | 45 | bool m_hastabs; 46 | bool m_active; 47 | }; 48 | -------------------------------------------------------------------------------- /fatality_gui/menu/external_include.h: -------------------------------------------------------------------------------- 1 | #include "../../internal_hvh/include_cheat.h" -------------------------------------------------------------------------------- /fatality_gui/menu/include_menu.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "menu.h" 4 | #include "controls/window.h" 5 | #include "controls/control.h" 6 | #include "controls/tab.h" 7 | #include "controls/button.h" 8 | #include "controls/checkbox.h" 9 | #include "controls/combobox.h" 10 | #include "controls/keybind.h" 11 | #include "controls/slider.h" 12 | #include "controls/tab.h" 13 | #include "controls/subtab.h" 14 | #include "controls/colorpicker.h" 15 | #include "controls/listbox.h" 16 | #include "controls/multi-selectable.h" 17 | #include "controls/textbox.h" 18 | 19 | #include "config/config.h" -------------------------------------------------------------------------------- /fatality_gui/menu/menu.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define CHECKBOX_HEIGHT 18 4 | 5 | #define COMBOBOX_HEIGHT 24 6 | #define COMBOBOX_WIDTH 200 7 | 8 | #define SLIDER_HEIGHT 18 9 | #define SLIDER_WIDTH 200 10 | 11 | #define BUTTON_WIDTH 200 12 | #define BUTTON_HEIGHT 24 13 | 14 | #define KEYBIND_WIDTH 60 15 | #define KEYBIND_HEIGHT 24 16 | 17 | #define TEXTBOX_WIDTH 200 18 | #define TEXTBOX_HEIGHT 24 19 | 20 | #define COLORPICKER_WIDTH 80 21 | #define COLORPICKER_HEIGHT 24 22 | 23 | struct mouse_info 24 | { 25 | POINT pos; 26 | 27 | POINT press_pos; 28 | POINT hold_pos; 29 | 30 | bool is_pressed; 31 | bool is_holding; // used to know of its holding/moving smth 32 | 33 | bool needs_reset; 34 | }; 35 | 36 | static mouse_info g_mouse; 37 | 38 | struct bounds 39 | { 40 | bounds() 41 | { 42 | this->x = 0; 43 | this->y = 0; 44 | this->w = 0; 45 | this->h = 0; 46 | } 47 | bounds( int x, int y, int w, int h ) 48 | { 49 | this->x = x; 50 | this->y = y; 51 | this->w = w; 52 | this->h = h; 53 | } 54 | bounds( int x, int y ) 55 | { 56 | this->x = x; 57 | this->y = y; 58 | this->w = 0; 59 | this->h = 0; 60 | } 61 | 62 | int x, y, w, h; 63 | }; 64 | 65 | class c_window; 66 | class c_menu : public singleton 67 | { 68 | public: 69 | void render(); 70 | void init(); 71 | 72 | bool is_hovering( bounds pbounds ); 73 | bool is_holding( bounds pbounds ) const; 74 | bool is_pressed( bounds pbounds ); 75 | 76 | bool mouse_is_pressed(); 77 | bool mouse_is_holding(); 78 | void reset_mouse_state(); 79 | 80 | bool key_updated( int key ); 81 | 82 | uintptr_t modulate_alpha( uintptr_t orig, int alpha ); 83 | 84 | static POINT get_mouse_pos(); 85 | static POINT get_hold_pos(); 86 | static POINT get_press_pos(); 87 | 88 | static bool is_in_area( POINT p, bounds pbounds ); 89 | bool& get_opened(); 90 | 91 | void toggle(); 92 | 93 | void release_images(); 94 | 95 | protected: 96 | 97 | IDirect3DDevice9 * m_device; 98 | private: 99 | 100 | 101 | 102 | bool m_keystate[ 256 ] = {}; 103 | bool m_oldstate[ 256 ] = {}; 104 | 105 | static void draw_cursor(); 106 | void update_input(); 107 | std::vector m_windows; 108 | 109 | bool m_opened = false; 110 | bool m_init = false; 111 | }; 112 | -------------------------------------------------------------------------------- /internal_hvh.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27130.2036 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "internal_hvh", "internal_hvh\internal_hvh.vcxproj", "{D1F5161A-D2FA-4BAB-9D72-F167448AA9C1}" 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 | {D1F5161A-D2FA-4BAB-9D72-F167448AA9C1}.Debug|x64.ActiveCfg = Debug|x64 17 | {D1F5161A-D2FA-4BAB-9D72-F167448AA9C1}.Debug|x64.Build.0 = Debug|x64 18 | {D1F5161A-D2FA-4BAB-9D72-F167448AA9C1}.Debug|x86.ActiveCfg = Debug|Win32 19 | {D1F5161A-D2FA-4BAB-9D72-F167448AA9C1}.Debug|x86.Build.0 = Debug|Win32 20 | {D1F5161A-D2FA-4BAB-9D72-F167448AA9C1}.Release|x64.ActiveCfg = Release|x64 21 | {D1F5161A-D2FA-4BAB-9D72-F167448AA9C1}.Release|x64.Build.0 = Release|x64 22 | {D1F5161A-D2FA-4BAB-9D72-F167448AA9C1}.Release|x86.ActiveCfg = Release|Win32 23 | {D1F5161A-D2FA-4BAB-9D72-F167448AA9C1}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {FB732B27-F00F-4F23-8A30-2F871494CC54} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /internal_hvh/DLLMain.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Akatsyk/BloodNET/aea2205332f6c22ebacb7b1bb9a65654a6c384ef/internal_hvh/DLLMain.cpp -------------------------------------------------------------------------------- /internal_hvh/Header.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | -------------------------------------------------------------------------------- /internal_hvh/cthash.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace random 6 | { 7 | constexpr auto time = __TIME__; 8 | constexpr auto seed = static_cast< unsigned >( time[ 7 ] ) + static_cast< unsigned >( time[ 6 ] ) * 10 + static_cast< unsigned >( time[ 4 ] ) * 60 + static_cast< unsigned >( time[ 3 ] ) * 600 + static_cast< unsigned >( time[ 1 ] ) * 3600 + static_cast< unsigned >( time[ 0 ] ) * 36000; 9 | 10 | template 11 | struct gen 12 | { 13 | private: 14 | static constexpr unsigned a = 16807; 15 | static constexpr unsigned m = 2147483647; 16 | 17 | static constexpr unsigned s = gen::value; 18 | static constexpr unsigned lo = a * ( s & 0xFFFFu ); 19 | static constexpr unsigned hi = a * ( s >> 16u ); 20 | static constexpr unsigned lo2 = lo + ( ( hi & 0x7FFFu ) << 16u ); 21 | static constexpr unsigned hi2 = hi >> 15u; 22 | static constexpr unsigned lo3 = lo2 + hi; 23 | 24 | public: 25 | static constexpr unsigned max = m; 26 | static constexpr unsigned value = lo3 > m ? lo3 - m : lo3; 27 | }; 28 | 29 | template <> 30 | struct gen<0> 31 | { 32 | static constexpr unsigned value = seed; 33 | }; 34 | 35 | template 36 | struct _int 37 | { 38 | static constexpr auto value = gen::value % m; 39 | }; 40 | 41 | template 42 | struct _char 43 | { 44 | static const char value = static_cast< char >( 1 + _int::value ); 45 | }; 46 | } 47 | 48 | 49 | template 50 | struct xorstr 51 | { 52 | private: 53 | constexpr char enc( const char c ) const 54 | { 55 | return c ^ key; // NOLINT 56 | } 57 | 58 | public: 59 | template 60 | constexpr __forceinline xorstr( const char* str, std::index_sequence ) : 61 | key( random::_char::value ), encrypted{ enc( str[ s ] )... } 62 | { 63 | } 64 | 65 | const size_t size = n; 66 | const char key; 67 | std::array encrypted; 68 | }; 69 | 70 | #define concat_impl(x, y) x##y 71 | #define concat(x, y) concat_impl(x, y) 72 | 73 | #define _i(s) xorstr(s, std::make_index_sequence()) 74 | 75 | #define _w(s) []() noexcept -> std::string { \ 76 | constexpr auto e = _i(s); \ 77 | std::string res; \ 78 | res += e.key; \ 79 | for (auto& j : e.encrypted) \ 80 | res += j; \ 81 | return res; \ 82 | }() 83 | 84 | // Only use this when there is no other way - this is dangerous! 85 | #define _w2(s) [&]() noexcept -> std::string { \ 86 | const auto key = rand() % 0x7F;\ 87 | std::string res; \ 88 | res += key; \ 89 | for (size_t i = 0; i < (s).length() + 1; i++) \ 90 | res += (s)[i] ^ key; \ 91 | return res; \ 92 | }() 93 | 94 | #define _rt(n, s) char* (n) = reinterpret_cast(alloca(((s).size + 1) * sizeof(char))); \ 95 | for (size_t i = 0; i < (s).size; i++) \ 96 | (n)[i] = (s).encrypted[i] ^ (s).key; \ 97 | (n)[(s).size] = '\0' 98 | 99 | #define _(n, s) constexpr auto concat(e, __LINE__) = _i(s); \ 100 | _rt(n, concat(e, __LINE__)) 101 | 102 | #define ___(n, s) constexpr auto concat(g, __LINE__) = _i(s); \ 103 | _rt(n, concat(g, __LINE__)) 104 | 105 | #define _u(n, s) const auto concat(t, __LINE__) = (s).substr(1); \ 106 | char* (n) = reinterpret_cast(alloca(((s).length() + 2) * sizeof(char))); \ 107 | for (size_t i = 0; i < (s).length(); i++) \ 108 | (n)[i] = (s)[i + 1] ^ (s)[0]; \ 109 | (n)[(s).length() - 2] = '\0' 110 | 111 | #define __(n, s) _(n, s) 112 | 113 | #define _n(s) (s) 114 | 115 | #define sig(name, signature) []{ __(s, signature); ___(n, name); return util::get_sig(n, s); }() -------------------------------------------------------------------------------- /internal_hvh/features/aimbot.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Akatsyk/BloodNET/aea2205332f6c22ebacb7b1bb9a65654a6c384ef/internal_hvh/features/aimbot.cpp -------------------------------------------------------------------------------- /internal_hvh/features/aimbot.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct aimpoint_t 4 | { 5 | aimpoint_t(const Vector& point, const Vector& center, const int hitbox) 6 | { 7 | this->point = point; 8 | this->center = center; 9 | this->hitbox = hitbox; 10 | } 11 | Vector point; 12 | Vector center; 13 | int hitbox; 14 | }; 15 | 16 | class aimbot : public singleton 17 | { 18 | public: 19 | bool m_shoot_next_tick; 20 | void run(); 21 | static void no_recoil(); 22 | static void no_visual_recoil( CViewSetup & v_view ); 23 | void quick_stop(); 24 | void automatic_revolver(); 25 | void full_stop(); 26 | bool get_quick_stop_state() const; 27 | static bool can_shoot(float time = prediction::get().get_curtime(), bool check = false); 28 | aimpoint_t get_best_damage(lag_record_t& log, float& damage, Vector* pos = nullptr); 29 | void multipoint_hitboxes(lag_record_t& log, std::vector& points, bool second_go = false); 30 | bool get_aimbot_state() const 31 | { 32 | return aimbot_called == prediction::get().get_unpred_curtime(); 33 | } 34 | private: 35 | void select_targets(); 36 | lag_record_t* find_first_record(player_log_t& log); 37 | lag_record_t* find_last_record(player_log_t& log); 38 | void scan_targets(); 39 | 40 | float calc_hc(QAngle vangles, const aimpoint_t& point, C_CSPlayer* player) const; 41 | //bool calculate_hitchance(QAngle vangles, const aimpoint_t& point, C_CSPlayer* player); 42 | bool calculate_hitchance(QAngle vangles, const aimpoint_t& point, matrix3x4_t* matrix, C_CSPlayer* player); 43 | 44 | std::vector targets; 45 | std::array enabled_hitboxes; 46 | float quick_stop_called = 0.f; 47 | float spike_shot_called = 0.f; 48 | float aimbot_called = 0.f; 49 | }; 50 | -------------------------------------------------------------------------------- /internal_hvh/features/animations.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct anim_state_info_t 4 | { 5 | CBaseHandle handle; 6 | float spawn_time; 7 | CCSGOPlayerAnimState* animstate; 8 | float animvel; 9 | std::array poses; 10 | }; 11 | 12 | class animations : public singleton 13 | { 14 | public: 15 | static void stop( const ClientFrameStage_t stage ); 16 | void update_local_animations(); 17 | void fix_local_anims( const ClientFrameStage_t stage ); 18 | static void update_player_animations( lag_record_t* record, C_CSPlayer* m_player ); 19 | void update_custom_anims( C_CSPlayer* player ); 20 | private: 21 | anim_state_info_t anim_info[ 65 ]; 22 | }; -------------------------------------------------------------------------------- /internal_hvh/features/antiaim.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class antiaim : public singleton 4 | { 5 | public: 6 | float lineLBY = 0.f, 7 | lineFakeAngle = 0.f, 8 | lineRealAngle = 0.f; 9 | public: 10 | void run(); 11 | static void fix_movement(); 12 | int get_rest_choke() const { return to_choke - g_pClientState->m_nChokedCommands; } 13 | int get_to_choke() const { return to_choke; } 14 | float get_next_update() const; 15 | float get_target_lby() const { return target_lby; } 16 | void choose_real(); 17 | void fakeduck(); 18 | bool get_fake_walk_state() const; 19 | int type = 0; 20 | bool update_lby = false; 21 | float next_lby_update = 0.f; 22 | float next_update = 0.f; 23 | 24 | private: 25 | void choose_fk(); 26 | void update_animstate(); 27 | void fake_lag(); 28 | void fake_walk(); 29 | 30 | static bool on_peek_fakelag(); 31 | void do_spin() const; 32 | void do_add(); 33 | void do_jitter( ); 34 | void do_freestand(); 35 | bool do_edge( ); 36 | void do_at_target() const; 37 | bool do_lby( ); 38 | 39 | bool lby_update( ); 40 | void lby_prediction(); 41 | 42 | uint32_t to_choke = 0; 43 | float fake_walk_called = 0.f; 44 | float initial_lby = 0.f; 45 | float target_lby = 0.f; 46 | bool firstupdate = true; 47 | bool secondupdate = true; 48 | bool switch_distortion = false; 49 | float timer_distortion = 0.f; 50 | }; 51 | -------------------------------------------------------------------------------- /internal_hvh/features/autostrafer.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | float speed, ideal, old_yaw; 4 | float switch_value = 1.f; 5 | 6 | void autostrafer::strafe() 7 | { 8 | Vector velocity; 9 | float delta, abs_delta, velocity_delta, correct; 10 | if (!vars.misc.autostrafe.get()) 11 | return; 12 | 13 | if (g_pLocalPlayer->get_flags() & FL_ONGROUND) 14 | return; 15 | 16 | if (g_pLocalPlayer->get_move_type() != MOVETYPE_WALK || !g_pLocalPlayer->get_alive()) 17 | return; 18 | 19 | if (g_cmd->buttons & IN_SPEED) 20 | return; 21 | 22 | __(cl_sidespeed_s, "cl_sidespeed"); 23 | static ConVar* cl_sidespeed = g_pCVar->FindVar(cl_sidespeed_s); 24 | 25 | // get networked velocity ( maybe absvelocity better here? ). 26 | // meh, should be predicted anyway? ill see. 27 | velocity = g_pLocalPlayer->get_abs_velocity(); 28 | 29 | // get the velocity len2d ( speed ). 30 | speed = velocity.Length2D(); 31 | 32 | // compute the ideal strafe angle for our velocity. 33 | ideal = (speed > 0.f) ? RAD2DEG(asin(15.f / speed)) : 90.f; 34 | 35 | // some additional sanity. 36 | clamp(ideal, 0.f, 90.f); 37 | 38 | // for changing direction. 39 | // we want to change strafe direction every call. 40 | switch_value *= -1.f; 41 | 42 | float wish_dir{ }; 43 | 44 | // get our key presses. 45 | bool holding_w = g_cmd->buttons & IN_FORWARD; 46 | bool holding_a = g_cmd->buttons & IN_MOVELEFT; 47 | bool holding_s = g_cmd->buttons & IN_BACK; 48 | bool holding_d = g_cmd->buttons & IN_MOVERIGHT; 49 | 50 | // move in the appropriate direction. 51 | if (holding_w) { 52 | if (holding_a) 53 | wish_dir += 45.f; 54 | else if (holding_d) 55 | wish_dir -= 45.f; 56 | else 57 | wish_dir += 0.f; 58 | } 59 | else if (holding_s) { 60 | if (holding_a) 61 | wish_dir += 135.f; 62 | else if (holding_d) 63 | wish_dir -= 135.f; 64 | else 65 | wish_dir += 180.f; 66 | } 67 | else if (holding_a) 68 | wish_dir += 90.f; 69 | else if (holding_d) 70 | wish_dir -= 90.f; 71 | 72 | autostrafer::get().m_strafe_angles.y = math::get().normalize_float(autostrafer::get().m_strafe_angles.y + wish_dir); 73 | 74 | // cancel out any forwardmove values. 75 | g_cmd->forwardmove = 0.f; 76 | 77 | // get our viewangle change. 78 | delta = math::get().normalize_float(autostrafer::get().m_strafe_angles.y - old_yaw); 79 | 80 | // convert to absolute change. 81 | abs_delta = abs(delta); 82 | 83 | // save old yaw for next call. 84 | old_yaw = autostrafer::get().m_strafe_angles.y; 85 | 86 | // set strafe direction based on mouse direction change. 87 | if (delta > 0.f) 88 | g_cmd->sidemove = -cl_sidespeed->get_float(); 89 | else if (delta < 0.f) 90 | g_cmd->sidemove = cl_sidespeed->get_float(); 91 | 92 | // we can accelerate more, because we strafed less then needed 93 | // or we got of track and need to be retracked. 94 | if (abs_delta <= ideal || abs_delta >= 30.f) { 95 | // compute angle of the direction we are traveling in. 96 | QAngle velocity_angle; 97 | math::get().vector_angles(velocity, velocity_angle); 98 | 99 | // get the delta between our direction and where we are looking at. 100 | velocity_delta = math::get().normalize_float(autostrafer::get().m_strafe_angles.y - velocity_angle.y); 101 | 102 | // correct our strafe amongst the path of a circle. 103 | correct = ideal; 104 | 105 | if (velocity_delta <= correct || speed <= 15.f) { 106 | // not moving mouse, switch strafe every tick. 107 | if (-correct <= velocity_delta || speed <= 15.f) { 108 | autostrafer::get().m_strafe_angles.y += (ideal * switch_value); 109 | g_cmd->sidemove = cl_sidespeed->get_float() * switch_value; 110 | } 111 | 112 | else { 113 | autostrafer::get().m_strafe_angles.y = velocity_angle.y - correct; 114 | g_cmd->sidemove = cl_sidespeed->get_float(); 115 | } 116 | } 117 | 118 | else { 119 | autostrafer::get().m_strafe_angles.y = velocity_angle.y + correct; 120 | g_cmd->sidemove = -cl_sidespeed->get_float(); 121 | } 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /internal_hvh/features/autostrafer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class autostrafer : public singleton 4 | { 5 | public: 6 | static void strafe(); 7 | QAngle m_strafe_angles; 8 | }; 9 | -------------------------------------------------------------------------------- /internal_hvh/features/beams.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | void beams::draw_impacts() 4 | { 5 | if ( !g_pEngine->IsInGame() || !g_pLocalPlayer ) 6 | { 7 | impacts.clear(); 8 | return; 9 | } 10 | 11 | if ( impacts.size() > 30 ) 12 | impacts.pop_back(); 13 | 14 | _( modelname, "sprites/purplelaser1.vmt" ); 15 | 16 | for ( size_t i = 0; i < impacts.size(); i++ ) 17 | { 18 | auto impact = impacts[ i ]; 19 | 20 | if ( !impact.player || impact.player->IsDormant() ) 21 | continue; 22 | 23 | BeamInfo_t beam_info; 24 | beam_info.m_vecStart = impact.start; 25 | if ( impact.player == g_pLocalPlayer ) 26 | beam_info.m_vecStart.z -= 2.f; 27 | beam_info.m_vecEnd = impact.pos; 28 | beam_info.m_nType = TE_BEAMPOINTS; 29 | beam_info.m_pszModelName = modelname; 30 | beam_info.m_nModelIndex = -1; 31 | beam_info.m_flHaloScale = 0.0f; 32 | beam_info.m_flLife = 6.f; 33 | beam_info.m_flWidth = 2.0f; 34 | beam_info.m_flEndWidth = 2.0f; 35 | beam_info.m_flFadeLength = 0.0f; 36 | beam_info.m_flAmplitude = 2.0f; 37 | beam_info.m_flBrightness = 255.f; 38 | beam_info.m_flSpeed = 0.2f; 39 | beam_info.m_nStartFrame = 0; 40 | beam_info.m_flFrameRate = 0.f; 41 | beam_info.m_flRed = float( impact.color.r() ); 42 | beam_info.m_flGreen = float( impact.color.g() ); 43 | beam_info.m_flBlue = float( impact.color.b() ); 44 | beam_info.m_nSegments = 2; 45 | beam_info.m_bRenderable = true; 46 | beam_info.m_nFlags = FBEAM_ONLYNOISEONCE | FBEAM_NOTILE | FBEAM_HALOBEAM; 47 | 48 | const auto beam = g_pBeams->CreateBeamPoints( beam_info ); 49 | if ( beam ) 50 | g_pBeams->DrawBeam( beam ); 51 | } 52 | 53 | impacts.clear(); 54 | } 55 | 56 | void beams::listener( IGameEvent * game_event ) 57 | { 58 | _( uid, "userid" ); 59 | 60 | const auto userid = g_pEngine->GetPlayerForUserID( game_event->GetInt( uid ) ); 61 | 62 | static float last_curtime; 63 | 64 | const auto player = get_entity( userid ); 65 | if ( !player ) 66 | return; 67 | 68 | if ( player->IsDormant() ) 69 | return; 70 | 71 | if ( player == g_pLocalPlayer ) 72 | return; 73 | if ( !vars.visuals.beams.enemy.enabled.get() && player->is_enemy() ) 74 | return; 75 | if ( !vars.visuals.beams.team.enabled.get() && !player->is_enemy() && player != g_pLocalPlayer ) 76 | return; 77 | 78 | _( x, "x" ); 79 | _( y, "y" ); 80 | _( z, "z" ); 81 | 82 | const Vector pos( game_event->GetFloat( x ), game_event->GetFloat( y ), game_event->GetFloat( z ) ); 83 | Color col; 84 | 85 | /*if ( player == g_pLocalPlayer ) 86 | col = get_col( vars.visuals.beams.local.color.get() );*/ 87 | if ( player->is_enemy() ) 88 | col = get_col( vars.visuals.beams.enemy.color.get() ); 89 | else if ( !player->is_enemy() ) 90 | col = get_col( vars.visuals.beams.team.color.get() ); 91 | 92 | impact_info_t impact( g_pGlobals->curtime, player->get_eye_pos(), pos, player, col ); 93 | 94 | if ( last_curtime == g_pGlobals->curtime ) 95 | { 96 | if ( !impacts.empty() && impact.length() < ( impacts.end() - 1 )->length() || impacts.empty() ) 97 | return; 98 | 99 | impacts.pop_back(); 100 | } 101 | 102 | last_curtime = g_pGlobals->curtime; 103 | 104 | impacts.push_back( impact ); 105 | } 106 | 107 | void beams::add_local_beam( const impact_info_t info ) 108 | { 109 | if ( !vars.visuals.beams.local.enabled.get() ) 110 | return; 111 | 112 | impacts.push_back( info ); 113 | } 114 | 115 | bool beams::beam_exists( C_CSPlayer* player, const float curtime ) 116 | { 117 | for ( auto& impact : impacts ) 118 | { 119 | if ( impact.time == curtime && player == impact.player ) 120 | return true; 121 | } 122 | 123 | return false; 124 | } 125 | -------------------------------------------------------------------------------- /internal_hvh/features/beams.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct impact_info_t 4 | { 5 | Vector start; 6 | Vector pos; 7 | Color color; 8 | C_CSPlayer* player; 9 | float time; 10 | 11 | impact_info_t( const float time, const Vector start, const Vector pos, C_CSPlayer* player, const Color col = Color::White() ) 12 | { 13 | this->player = player; 14 | this->start = start; 15 | this->pos = pos; 16 | this->color = col; 17 | this->time = time; 18 | } 19 | float length() const 20 | { 21 | return start.Dist( this->pos ); 22 | } 23 | bool equal( const impact_info_t& info ) const 24 | { 25 | if ( this->player != info.player ) 26 | return false; 27 | 28 | if ( this->time != info.time ) 29 | return false; 30 | 31 | return true; 32 | } 33 | }; 34 | 35 | class beams : public singleton 36 | { 37 | public: 38 | void draw_impacts(); 39 | void listener( IGameEvent * game_event ); 40 | void add_local_beam( impact_info_t info ); 41 | bool beam_exists( C_CSPlayer* player, const float curtime ); 42 | private: 43 | std::deque impacts; 44 | }; 45 | -------------------------------------------------------------------------------- /internal_hvh/features/bone_setup.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | bool bone_setup::handle_bone_setup(lag_record_t& record, const int bone_mask, matrix3x4_t* bone_out) 4 | { 5 | auto player = get_entity(record.index); 6 | if (!player) 7 | return false; 8 | 9 | const auto hdr = player->get_model_ptr(); 10 | if (!hdr) 11 | return false; 12 | 13 | auto bone_accessor = player->get_bone_accessor(); 14 | if (!bone_accessor) 15 | return false; 16 | 17 | const auto backup_matrix = bone_accessor->get_bone_array_for_write(); 18 | if (!backup_matrix) 19 | return false; 20 | 21 | // back up 22 | Vector vecAbsOrigin = player->get_abs_origin(); 23 | QAngle vecAbsAngles = player->get_abs_angles(); 24 | 25 | Vector vecBackupAbsOrigin = player->get_abs_origin(); 26 | QAngle vecBackupAbsAngles = player->get_abs_angles(); 27 | 28 | auto backup_poses = player->get_pose_params(); 29 | auto backup_layers = player->get_anim_layers(); 30 | const auto backup_effects = player->get_effects(); 31 | 32 | // compute transform from raw data. 33 | matrix3x4_t transform; 34 | math::get().angle_matrix(vecAbsAngles, vecAbsOrigin, transform); 35 | 36 | // set non interpolated data. 37 | player->get_effects() |= EF_NOINTERP; 38 | player->set_abs_origin(record.m_origin); 39 | player->set_abs_angles(record.m_abs_ang); 40 | player->set_pose_params(record.m_poses); 41 | player->set_anim_layers(record.m_layers); 42 | 43 | Vector pos[128]; 44 | __declspec(align(16)) QuaternionAligned q[128]; 45 | 46 | // force game to call AccumulateLayers - pvs fix. 47 | g_ishltv_fix = true; 48 | 49 | // set bone array for write. 50 | bone_accessor->set_bone_array_for_write(bone_out); 51 | 52 | // compute and build bones. 53 | player->standard_blending_rules(hdr, pos, q, record.m_sim_time, bone_mask); 54 | 55 | uint8_t computed[0x100]; 56 | std::memset(computed, 0, 0x100); 57 | player->build_transformations(hdr, pos, q, transform, bone_mask, computed); 58 | 59 | // restore old matrix. 60 | bone_accessor->set_bone_array_for_write(backup_matrix); 61 | 62 | // restore original interpolated entity data. 63 | player->get_effects() = backup_effects; 64 | player->set_abs_origin(vecBackupAbsOrigin); 65 | player->set_abs_angles(vecBackupAbsAngles); 66 | player->set_pose_params(backup_poses); 67 | player->set_anim_layers(backup_layers); 68 | 69 | // revert to old game behavior. 70 | g_ishltv_fix = false; 71 | 72 | return true; 73 | } 74 | 75 | bool bone_setup::handle_bone_setup_replace(C_CSPlayer* player, const int max_bones, const int bone_mask, matrix3x4_t* bone_out) 76 | { 77 | const auto hdr = player->get_model_ptr(); 78 | if (!hdr) 79 | return false; 80 | 81 | const auto backup_effects = player->get_effects(); 82 | 83 | //set & calc 84 | const auto origin = player->get_abs_origin(); 85 | const auto angles = player->get_abs_angles(); 86 | 87 | ALIGN16 matrix3x4_t parent_transform; 88 | math::get().angle_matrix(angles, origin, parent_transform); 89 | 90 | Vector pos[128]; 91 | QuaternionAligned q[128]; 92 | ZeroMemory(pos, sizeof(Vector[128])); 93 | ZeroMemory(q, sizeof(QuaternionAligned[128])); 94 | 95 | player->get_effects() |= EF_NOINTERP; 96 | 97 | // force game to call AccumulateLayers - pvs fix. 98 | g_ishltv_fix = true; 99 | 100 | // compute and build bones. 101 | player->standard_blending_rules(hdr, pos, q, player->get_simtime(), bone_mask); 102 | 103 | byte computed[32]; 104 | ZeroMemory(computed, sizeof(byte[0x20])); 105 | player->build_transformations(hdr, pos, q, parent_transform, bone_mask, &computed[0]); 106 | 107 | // restore original interpolated entity data. 108 | player->get_effects() = backup_effects; 109 | 110 | memcpy(bone_out, player->get_bone_accessor()->m_pBones, sizeof(matrix3x4_t) * max_bones); 111 | 112 | // revert to old game behavior. 113 | g_ishltv_fix = false; 114 | 115 | return true; 116 | } 117 | -------------------------------------------------------------------------------- /internal_hvh/features/bone_setup.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CBoneAccessor; 4 | class bone_setup : public singleton 5 | { 6 | public: 7 | static bool handle_bone_setup( lag_record_t& record, const int bone_mask, matrix3x4_t* bone_out ); 8 | static bool handle_bone_setup_replace( C_CSPlayer* player, const int max_bones, const int bone_mask, matrix3x4_t* bone_out ); 9 | }; 10 | 11 | class C_BaseAnimating; 12 | class CBoneAccessor 13 | { 14 | public: 15 | inline matrix3x4_t *get_bone_array_for_write( void ) const 16 | { 17 | return m_pBones; 18 | } 19 | inline void set_bone_array_for_write( matrix3x4_t* bonearray ) 20 | { 21 | m_pBones = bonearray; 22 | } 23 | alignas( 16 ) matrix3x4_t * m_pBones; 24 | 25 | int m_ReadableBones; // Which bones can be read. 26 | int m_WritableBones; // Which bones can be written. 27 | }; -------------------------------------------------------------------------------- /internal_hvh/features/chams.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class chams : public singleton 4 | { 5 | public: 6 | chams(); 7 | ~chams(); 8 | 9 | static void extend_drawing(); 10 | void draw_record( IMatRenderContext* context, const DrawModelState_t& state, const ModelRenderInfo_t& info, matrix3x4_t* custom_bone_to_world ); 11 | void add_material( material_index_t idx, IMaterial* mat ); 12 | bool draw_hst( lag_record_t& record, matrix3x4_t* out ); 13 | bool draw_ch( IMatRenderContext* context, const DrawModelState_t& state, const ModelRenderInfo_t& info, matrix3x4_t* pCustomBoneToWorld ); 14 | void dark_mode() const; 15 | private: 16 | IMaterial* materials[ material_index_t::NUM_MATERIALS ]; 17 | }; 18 | -------------------------------------------------------------------------------- /internal_hvh/features/console_log.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class console_log : public singleton 4 | { 5 | public: 6 | static void buy_event( IGameEvent* game_event ); 7 | static void hurt_event( IGameEvent* game_event ); 8 | void setup(); 9 | void listener( IGameEvent * game_event ); 10 | private: 11 | bool m_setup = false; 12 | }; 13 | -------------------------------------------------------------------------------- /internal_hvh/features/dormant_esp.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | #define range( x, a, b ) ( x >= a && x <= b ) 4 | 5 | void dormancy_manager::position_correction( int stage ) { 6 | if ( stage != FRAME_RENDER_START) 7 | //if ( stage != FRAME_NET_UPDATE_POSTDATAUPDATE_START) 8 | return; 9 | 10 | for ( int i = 1; i <= g_pGlobals->maxClients; i++ ) 11 | { 12 | auto entity = get_entity( i ); 13 | 14 | if ( entity == g_pLocalPlayer ) 15 | continue; 16 | 17 | if ( !viable( entity ) ) 18 | continue; 19 | 20 | if ( !entity->IsDormant( ) && !players[ i ].set ) 21 | players[ i ].oldpos = entity->get_origin( ); 22 | 23 | if ( !entity->IsDormant( ) || players[ i ].set ) 24 | continue; 25 | 26 | entity->set_abs_origin( players[ i ].oldpos ); 27 | } 28 | } 29 | 30 | bool dormancy_manager::set( const int index ) { 31 | if ( !range( index, 1, 64 ) ) 32 | return false; 33 | 34 | return players[ index ].set; 35 | } 36 | 37 | bool dormancy_manager::viable( C_CSPlayer* entity ) { 38 | if ( !entity ) 39 | return false; 40 | 41 | if ( !g_pLocalPlayer ) 42 | return false; 43 | 44 | if ( !entity->get_alive( ) || entity->get_flags( ) & ( 1 << 6 ) ) 45 | return false; 46 | 47 | if ( entity->get_team( ) == g_pLocalPlayer->get_team( ) ) 48 | return false; 49 | 50 | if ( entity->get_immunity( ) ) 51 | return false; 52 | 53 | return true; 54 | } 55 | 56 | void dormancy_manager::sound_dormancy( ) { 57 | soundList.RemoveAll( ); 58 | g_pEngineSound->GetActiveSounds( soundList ); 59 | 60 | if ( !soundList.Count( ) ) 61 | return; 62 | 63 | for ( int i = 0; i < soundList.Count( ); i++ ) { 64 | soundInfo& sound = soundList[ i ]; 65 | if ( !range( sound.sound_source, 1, 64 ) ) 66 | continue; 67 | 68 | if ( sound.sound_source == g_pEngine->GetLocalPlayer( ) ) 69 | continue; 70 | 71 | auto entity = reinterpret_cast< C_CSPlayer* >(get_entity( sound.sound_source ) ); 72 | 73 | if ( !entity || sound.origin->IsZero( ) /*|| !valid_sound( sound )*/ ) 74 | continue; 75 | 76 | auto& player = players[ sound.sound_source ]; 77 | player.entity = entity; 78 | 79 | 80 | Vector src_3d, dst_3d; 81 | CGameTrace tr; 82 | Ray_t ray; 83 | CTraceFilter filter; 84 | 85 | filter.pSkip = entity; 86 | src_3d = ( *sound.origin ) + Vector( 0, 0, 1 ); 87 | dst_3d = src_3d - Vector( 0, 0, 100 ); 88 | ray.Init( src_3d, dst_3d ); 89 | 90 | g_pTrace->TraceRay( ray, MASK_PLAYERSOLID, &filter, &tr ); 91 | 92 | if ( tr.allsolid ) // if stuck 93 | player.sounddata.time = -1; 94 | 95 | *sound.origin = ( ( tr.fraction < 0.97 ) ? tr.endpos : *sound.origin ); 96 | player.flags = entity->get_flags( ); 97 | player.flags |= ( tr.fraction < 0.50f ? ( 1 << 1 ) /*ducking*/ : 0 ) | ( tr.fraction != 1 ? ( 1 << 0 ) /*on ground*/ : 0 ); 98 | player.flags &= ( tr.fraction > 0.50f ? ~( 1 << 1 ) /*ducking*/ : 0 ) | ( tr.fraction == 1 ? ~( 1 << 0 ) /*on ground*/ : 0 ); 99 | 100 | player.oldpos = *sound.origin; 101 | player.sounddata.time = GetTickCount( ); 102 | 103 | if ( !entity->IsDormant( ) ) 104 | continue; 105 | 106 | adjust_player( sound.sound_source ); 107 | } 108 | 109 | soundBuffer = soundList; 110 | } 111 | 112 | void dormancy_manager::adjust_player( const int index ) 113 | { 114 | if ( !vars.visuals.esp.dormant_esp.get() ) 115 | return; 116 | 117 | auto& player = players[ index ]; 118 | 119 | static int duration = 1000; 120 | bool expired = GetTickCount( ) - player.sounddata.time > duration; 121 | 122 | if ( expired ) 123 | player.set = false; 124 | 125 | if ( !expired ) 126 | player.set = true; 127 | 128 | // dormant check 129 | player.entity->get_eflags() = player.flags; 130 | player.entity->get_origin( ) = player.oldpos; 131 | player.entity->set_abs_origin( player.oldpos ); 132 | } 133 | //bool dormancy_manager::valid_sound( soundInfo& sound ) 134 | //{ 135 | // if ( !sound.from_server ) 136 | // return false; 137 | // 138 | // for ( int i = 0; i < soundBuffer.Count( ); i++ ) { 139 | // soundInfo& cached_sound = soundBuffer[ i ]; 140 | // if ( cached_sound.guid == sound.guid ) 141 | // return false; 142 | // } 143 | // 144 | // return true; 145 | //} -------------------------------------------------------------------------------- /internal_hvh/features/dormant_esp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../include_cheat.h" 3 | 4 | struct dormancyData 5 | { 6 | C_CSPlayer* entity; 7 | bool prevstate; 8 | bool set; 9 | int flags; 10 | Vector oldpos = Vector( 0.f, 0.f, 0.f ); 11 | struct { 12 | int time; 13 | } sounddata; 14 | }; 15 | 16 | class dormancy_manager : public singleton 17 | { 18 | public: 19 | void position_correction( int stage ); 20 | bool set( const int index ); 21 | 22 | bool viable( C_CSPlayer* entity ); 23 | 24 | void sound_dormancy( ); 25 | void adjust_player( const int index ); 26 | void restore_sound_dormancy( ); // restoreSoundDormancy 27 | bool valid_sound( soundInfo& sound ); 28 | private: 29 | CUtlVector soundBuffer; 30 | CUtlVector soundList; 31 | 32 | dormancyData players[ 65 ]; 33 | }; -------------------------------------------------------------------------------- /internal_hvh/features/fake_ping.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct sequence_t 4 | { 5 | sequence_t(int in_reliable, int out_reliable, int in_sequence, float realtime) 6 | { 7 | in_reliable_state = in_reliable; 8 | out_reliable_state = out_reliable; 9 | in_sequence_num = in_sequence; 10 | 11 | time = realtime; 12 | } 13 | 14 | int in_reliable_state; 15 | int out_reliable_state; 16 | int in_sequence_num; 17 | 18 | float time; 19 | }; 20 | 21 | class fake_ping : public singleton 22 | { 23 | public: 24 | int last_incoming_sequence = 0; 25 | std::deque sequence_records; 26 | public: 27 | static void ping_spike(CNetChannel* net_channel/*, float latency*/); 28 | static void update_incoming_sequences(); 29 | static void unhook(); 30 | static void update(const ClientFrameStage_t); 31 | static void rehook(); 32 | private: 33 | static void reset(); 34 | }; 35 | -------------------------------------------------------------------------------- /internal_hvh/features/freestanding.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class freestanding : public singleton 4 | { 5 | public: 6 | bool override( float & yaw ) const; 7 | bool get_real( float& yaw ); 8 | void get_targets(); 9 | void update_hotkeys( ClientFrameStage_t stage ); 10 | static float trace_freestanding( C_CSPlayer* player, const Vector point ); 11 | int get_mode() const { return direction; } 12 | float last_fs_time = 0.f; 13 | private: 14 | int direction = -1; 15 | std::vector players; 16 | }; 17 | -------------------------------------------------------------------------------- /internal_hvh/features/glow.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | void glow::draw() 4 | { 5 | if ( !vars.visuals.glow.enabled.get() ) 6 | return; 7 | 8 | g_pGlowObjectManager->RenderGlowEffects(); 9 | } 10 | -------------------------------------------------------------------------------- /internal_hvh/features/glow.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class glow : public singleton 4 | { 5 | public: 6 | static void draw(); 7 | private: 8 | }; -------------------------------------------------------------------------------- /internal_hvh/features/grenade_predict.h: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | class c_nadepoint 4 | { 5 | public: 6 | c_nadepoint() { 7 | m_valid = false; 8 | } 9 | 10 | c_nadepoint(Vector start, Vector end, bool plane, bool valid, Vector normal, bool detonate) { 11 | m_start = start; 12 | m_end = end; 13 | m_plane = plane; 14 | m_valid = valid; 15 | m_normal = normal; 16 | m_detonate = detonate; 17 | } 18 | 19 | Vector m_start, m_end, m_normal; 20 | bool m_valid, m_plane, m_detonate; 21 | }; 22 | 23 | enum nade_throw_act { 24 | ACT_NONE, 25 | ACT_THROW, 26 | ACT_LOB, 27 | ACT_DROP 28 | }; 29 | 30 | class grenade_pred : public singleton 31 | { 32 | std::array< c_nadepoint, 500 > _points{ }; 33 | bool _predicted = false; 34 | 35 | void predict(); 36 | bool detonated(C_BaseCombatWeapon* weapon, float time, trace_t& trace); 37 | public: 38 | void trace(); 39 | void draw(); 40 | }; -------------------------------------------------------------------------------- /internal_hvh/features/hitmarker.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | #include "../misc/hitsounds.h" 3 | 4 | std::vector< std::string > soundfiles = 5 | { 6 | _w( "" ), 7 | _w( "" ), 8 | _w( "" ), 9 | _w( "buttons/arena_switch_press_02.wav" ), 10 | }; 11 | 12 | std::vector< BYTE* > memsoundfiles = 13 | { 14 | bubble, 15 | cod, 16 | fatality, 17 | }; 18 | 19 | void hitmarker::listener( IGameEvent * game_event ) 20 | { 21 | if ( !vars.misc.hitmarker.get() ) 22 | return; 23 | 24 | _( attacker_s, "attacker" ); 25 | _( userid_s, "userid" ); 26 | 27 | const auto attacker = g_pEngine->GetPlayerForUserID( game_event->GetInt( attacker_s ) ); 28 | const auto victim = g_pEngine->GetPlayerForUserID( game_event->GetInt( userid_s ) ); 29 | 30 | if ( attacker != g_pEngine->GetLocalPlayer() ) 31 | return; 32 | 33 | if ( victim == g_pEngine->GetLocalPlayer() ) 34 | return; 35 | 36 | const auto player = get_entity( victim ); 37 | if ( !player || !player->is_enemy() ) 38 | return; 39 | 40 | auto a = vars.misc.hitsound_select.get(); 41 | 42 | if ( vars.misc.hitsound_select.get() < 3 ) 43 | PlaySoundA( reinterpret_cast< char* >( memsoundfiles[ vars.misc.hitsound_select.get< int >() ] ), nullptr, SND_ASYNC | SND_MEMORY ); 44 | else 45 | { 46 | _u( name, soundfiles[ vars.misc.hitsound_select.get() ]); 47 | g_pSurface->PlaySound( name ); 48 | } 49 | } 50 | 51 | void hitmarker::hit_effect(IGameEvent* game_event) 52 | { 53 | if (!vars.misc.hitmarker.get()) 54 | return; 55 | 56 | _(attacker_s, "attacker"); 57 | _(userid_s, "userid"); 58 | 59 | const auto attacker = g_pEngine->GetPlayerForUserID(game_event->GetInt(attacker_s)); 60 | const auto victim = g_pEngine->GetPlayerForUserID(game_event->GetInt(userid_s)); 61 | 62 | if (attacker != g_pEngine->GetLocalPlayer()) 63 | return; 64 | 65 | if (victim == g_pEngine->GetLocalPlayer()) 66 | return; 67 | 68 | const auto player = get_entity(victim); 69 | if (!player || !player->is_enemy()) 70 | return; 71 | 72 | g_pLocalPlayer->get_health_shot_boost_expiration_time() = g_pGlobals->curtime + 1.f; 73 | } 74 | 75 | void hitmarker::draw_hits() 76 | { 77 | for ( auto i = 0; i < hits.size(); i++ ) 78 | { 79 | auto& hit = hits[ i ]; 80 | 81 | if ( hit.time + 1.5f < g_pGlobals->curtime ) 82 | { 83 | hits.erase( hits.begin() + i ); 84 | i--; 85 | } 86 | 87 | Vector screen_pos; 88 | if ( math::get().world_to_screen( hit.pos, screen_pos ) ) 89 | { 90 | render_hitmarker( hit, screen_pos ); 91 | } 92 | } 93 | } 94 | 95 | void hitmarker::add_hit( const hitmarker_t hit ) 96 | { 97 | hits.push_back( hit ); 98 | } 99 | 100 | void hitmarker::render_hitmarker( hitmarker_t& hit, const Vector& screen_pos ) 101 | { 102 | static auto line_size = 6; 103 | 104 | const auto step = 255.f / 1.0f * g_pGlobals->frametime; 105 | const auto step_move = 30.f / 1.5f * g_pGlobals->frametime; 106 | const auto multiplicator = 0.3f; 107 | 108 | hit.moved -= step_move; 109 | 110 | if ( hit.time + 0.5f <= g_pGlobals->curtime ) 111 | hit.alpha -= step; 112 | 113 | const auto int_alpha = static_cast< int >( hit.alpha ); 114 | 115 | if ( int_alpha > 0 ) 116 | { 117 | auto col = Color( 255, 255, 255, int_alpha ); 118 | 119 | render::get().line( Vector2D( screen_pos.x - line_size * multiplicator, screen_pos.y - line_size * multiplicator ), Vector2D( screen_pos.x - line_size, screen_pos.y - line_size ), col ); 120 | render::get().line( Vector2D( screen_pos.x - line_size * multiplicator, screen_pos.y + line_size * multiplicator ), Vector2D( screen_pos.x - line_size, screen_pos.y + line_size ), col ); 121 | render::get().line( Vector2D( screen_pos.x + line_size * multiplicator, screen_pos.y + line_size * multiplicator ), Vector2D( screen_pos.x + line_size, screen_pos.y + line_size ), col ); 122 | render::get().line( Vector2D( screen_pos.x + line_size * multiplicator, screen_pos.y - line_size * multiplicator ), Vector2D( screen_pos.x + line_size, screen_pos.y - line_size ), col ); 123 | 124 | col = Color( 255, 0, 0, int_alpha ); 125 | _( s, "- " ); 126 | render::get().text( Vector2D( screen_pos.x + 8, screen_pos.y - 12 + hit.moved ), s + std::to_string( hit.damage ), col, fonts::esp_small, c_font::drop_shadow ); 127 | } 128 | } -------------------------------------------------------------------------------- /internal_hvh/features/hitmarker.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct hitmarker_t 4 | { 5 | hitmarker_t( const float& time, const int& index, const int& damage, const int& hitgroup, const Vector& pos ) 6 | { 7 | this->time = time; 8 | this->index = index; 9 | this->damage = damage; 10 | this->hitgroup = hitgroup; 11 | this->pos = pos; 12 | moved = 0.f; 13 | alpha = 255.f; 14 | } 15 | float time; 16 | int index; 17 | int damage; 18 | int hitgroup; 19 | float moved; 20 | float alpha; 21 | Vector pos; 22 | }; 23 | 24 | class hitmarker : public singleton 25 | { 26 | public: 27 | void listener( IGameEvent * game_event ); 28 | void hit_effect(IGameEvent* game_event); 29 | void draw_hits(); 30 | void add_hit( hitmarker_t hit ); 31 | static void render_hitmarker( hitmarker_t& hit, const Vector & screen_pos ); 32 | private: 33 | std::deque hits; 34 | std::deque shots; 35 | }; -------------------------------------------------------------------------------- /internal_hvh/features/include_features.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "structs.h" 4 | #include "prediction.h" 5 | #include "aimbot.h" 6 | #include "player_log.h" 7 | #include "chams.h" 8 | #include "lag_compensation.h" 9 | #include "beams.h" 10 | #include "resolver.h" 11 | #include "wall_penetration.h" 12 | #include "antiaim.h" 13 | #include "animations.h" 14 | #include "thirdperson.h" 15 | #include "hitmarker.h" 16 | #include "bone_setup.h" 17 | #include "fake_ping.h" 18 | #include "glow.h" 19 | #include "grenade_predict.h" 20 | #include "dormant_esp.h" 21 | #include "freestanding.h" 22 | #include "misc.h" 23 | #include "visuals.h" 24 | #include "autostrafer.h" 25 | #include "console_log.h" 26 | #include "skinchanger.h" 27 | #include "inventorychanger.h" 28 | #include "tickbase_shift.h" -------------------------------------------------------------------------------- /internal_hvh/features/inventorychanger.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | struct inventory_item_t 5 | { 6 | uint64_t id; 7 | int definition_index; 8 | int paint_kit; 9 | int seed; 10 | float wear = 0.f; 11 | int stat_trak; 12 | std::array equipped_state; 13 | CEconItem* item = nullptr; 14 | bool update = false; 15 | bool fullupdate = false; 16 | }; 17 | 18 | class inventorychanger : public singleton 19 | { 20 | public: 21 | uint64_t get_highest_id() const; 22 | void update(); 23 | void update_selected(); 24 | void add(); 25 | void set( int index ); 26 | void update_items( bool recheck = false ); 27 | void load(); 28 | void save( bool autosave = false ); 29 | void remove(); 30 | void update_equipped( const ClientFrameStage_t stage ); 31 | std::vector &get_items() { return items; } 32 | std::vector &get_list_items() { return list_items; } 33 | CPlayerInventory* get_inventory() const { return inventory; } 34 | private: 35 | std::vector items; 36 | CPlayerInventory* inventory = nullptr; 37 | std::vector list_items; 38 | }; -------------------------------------------------------------------------------- /internal_hvh/features/lag_compensation.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class lagcomp : public singleton 4 | { 5 | public: 6 | static int fix_tickcount( const float& simtime ); 7 | static bool valid_simtime( const float & simtime ); 8 | static bool check_ping( const float & simtime, int * wish_sequence_nr, int * wish_reliable_state ); 9 | static float get_lerp_time(); 10 | static void extrapolate( C_CSPlayer* player, Vector& origin, Vector& velocity, int& flags, bool wasonground ); 11 | }; 12 | -------------------------------------------------------------------------------- /internal_hvh/features/misc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class misc : public singleton 4 | { 5 | public: 6 | static void bhop(); 7 | static void remove_smoke( ClientFrameStage_t stage ); 8 | static void remove_flash( ClientFrameStage_t stage ); 9 | static void radar(); 10 | static void reveal_ranks(); 11 | static void soundesp( int idx, const char* sample, const Vector& origin ); 12 | static void clan_tag(); 13 | //static void automaticpeek(); 14 | virtual void Instance(); 15 | virtual void DrawCircle(); 16 | static void aspectratio(); 17 | //static void grenade_trajectory(); 18 | //static void viewmodel_offset(); 19 | static void play_freezetime_music(); 20 | public: 21 | QAngle g_real_angles; 22 | float_t m_flAnimationTime = 0.0f; 23 | 24 | Vector m_vecStartPosition = Vector(0, 0, 0); 25 | 26 | bool m_bTurnedOn = false; 27 | bool m_bNegativeSide = false; 28 | bool m_bRetreat = false; 29 | bool m_bRetreated = false; 30 | bool m_bForceDisabled = false; 31 | bool m_bWaitAnimationProgress = false; 32 | }; 33 | -------------------------------------------------------------------------------- /internal_hvh/features/player_log.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class player_log : public singleton 4 | { 5 | public: 6 | void log( const ClientFrameStage_t stage ); 7 | player_log_t& get_log( const int index ); 8 | void filter_records( bool cm = false ); 9 | private: 10 | player_log_t logs[ 65 ]; 11 | }; -------------------------------------------------------------------------------- /internal_hvh/features/prediction.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class prediction : public singleton 4 | { 5 | public: 6 | void start(); 7 | void finish() const; 8 | static int get_tickbase(); 9 | static float get_curtime(); 10 | float get_unpred_curtime() const; 11 | Vector get_unpred_vel() const; 12 | Vector get_pred_vel() const; 13 | Vector get_unpred_eyepos() const; 14 | QAngle unpred_viewangles; 15 | private: 16 | int m_tickbase_backup; 17 | int m_flags_backup; 18 | float orig_currtime = 0.f; 19 | float orig_frametime = 0.f; 20 | CMoveData move_data; 21 | 22 | int* m_prediction_random_seed = nullptr; 23 | int* m_prediction_player = nullptr; 24 | Vector unpred_vel; 25 | Vector unpred_eyepos; 26 | Vector pred_vel; 27 | }; 28 | 29 | class net_data : public singleton 30 | { 31 | private: 32 | class StoredData_t 33 | { 34 | public: 35 | int m_tickbase; 36 | QAngle m_punch; 37 | QAngle m_punch_vel; 38 | Vector m_view_offset; 39 | 40 | public: 41 | __forceinline StoredData_t() : m_tickbase{}, m_punch{}, m_punch_vel{}, m_view_offset{} {}; 42 | }; 43 | 44 | std::array< StoredData_t, MULTIPLAYER_BACKUP > m_data; 45 | 46 | public: 47 | void store(); 48 | void apply(const ClientFrameStage_t stage); 49 | void reset(); 50 | }; -------------------------------------------------------------------------------- /internal_hvh/features/resolver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct shot_t 4 | { 5 | shot_t( const Vector& shotpos, const int tick, const int& enemy_index, const lag_record_t* record ) 6 | { 7 | this->shotpos = shotpos; 8 | this->enemy_index = enemy_index; 9 | this->tick = tick; 10 | if ( record ) 11 | this->record = *record; 12 | else 13 | this->record.index = -1; 14 | 15 | this->hit = false; 16 | this->hurt = false; 17 | } 18 | Vector shotpos; 19 | Vector hitpos; 20 | bool hit; 21 | bool hurt; 22 | struct 23 | { 24 | int victim = -1; 25 | int damage = -1; 26 | int hitgroup = -1; 27 | }hitinfo; 28 | int tick; 29 | int enemy_index; 30 | lag_record_t record; 31 | }; 32 | 33 | class resolver : public singleton 34 | { 35 | public: 36 | static bool is_spin( player_log_t* log ); 37 | void collect_wall_detect( const ClientFrameStage_t stage ); 38 | void extrpolate_players( const ClientFrameStage_t stage ) const; 39 | void resolve( C_CSPlayer* player, lag_record_t* record ); 40 | bool wall_detect( player_log_t* log, lag_record_t* record, float& angle ) const; 41 | static void nospread_resolve( C_CSPlayer* player, lag_record_t* record ); 42 | void override( C_CSPlayer* player, lag_record_t* record ); 43 | void update_missed_shots( const ClientFrameStage_t& stage ); 44 | std::deque& get_shots(); 45 | static void resolve_proxy( const C_CSPlayer* player, float* m_float ); 46 | static void on_lby_proxy( C_CSPlayer* entity, float* LowerBodyYaw ); 47 | static void resolve_poses( C_CSPlayer* player, player_log_t* log ); 48 | static bool update_lby_timer( C_CSPlayer* player ); 49 | static void calc_missed_shots( shot_t* shot ); 50 | void add_shot( const Vector& shotpos, lag_record_t* record, const int& enemy_index ); 51 | void hurt_listener( IGameEvent * game_event ); 52 | shot_t* closest_shot( int tickcount ); 53 | void record_shot( IGameEvent* game_event ); 54 | void listener( IGameEvent * game_event ); 55 | void approve_shots( const ClientFrameStage_t & stage ); 56 | static float get_next_update( int index ); 57 | void set_last_eye() { last_eye = g_pLocalPlayer->get_eye_pos(); } 58 | private: 59 | std::deque shots; 60 | std::deque current_shots; 61 | std::deque unapproved_shots; 62 | 63 | Vector last_eye; 64 | 65 | float left_damage[ 64 ]; 66 | float right_damage[ 64 ]; 67 | float back_damage[ 64 ]; 68 | }; -------------------------------------------------------------------------------- /internal_hvh/features/skinchanger.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct Kit_t 4 | { 5 | int id; 6 | std::string name; 7 | 8 | bool operator < ( const Kit_t& other ) const { return ( name < other.name ); } 9 | }; 10 | 11 | class skinchanger : public singleton 12 | { 13 | public: 14 | void spawn_glove(); 15 | void apply_glove( ) const; 16 | void run( const ClientFrameStage_t stage ); 17 | void parse_kits(); 18 | 19 | std::vector k_skins; 20 | std::vector k_pure_skin_names; 21 | std::vector k_skin_name_to_kit; 22 | 23 | uintptr_t glove_handle = 0; 24 | }; -------------------------------------------------------------------------------- /internal_hvh/features/thirdperson.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | void thirdperson::run() const 4 | { 5 | static float progress{}; 6 | static bool prev_state; 7 | const bool state = GetAsyncKeyState(vars.key.thirdperson.get()); 8 | if (prev_state != state) 9 | { 10 | if (state) 11 | vars.misc.thirdperson.set(!vars.misc.thirdperson.get()); 12 | 13 | prev_state = state; 14 | } 15 | 16 | if (!g_pEngine->IsInGame() || !g_pLocalPlayer) 17 | return; 18 | 19 | static QAngle view_angles; 20 | g_pEngine->GetViewAngles(view_angles); 21 | 22 | if (g_pLocalPlayer->get_alive() && vars.misc.thirdperson.get()) 23 | { 24 | //g_pLocalPlayer->get_effects() &= ~EF_NOINTERP; 25 | 26 | auto& animstate = **reinterpret_cast(uintptr_t(static_cast(g_pLocalPlayer)) + 0x3874); 27 | 28 | static auto was_inlandanim = false; 29 | 30 | // start the animation. 31 | progress += g_pGlobals->frametime * 5.f + (progress / 100); 32 | 33 | // clamp. 34 | math::get().clamp(progress, 0.f, 1.f); 35 | 36 | g_pInput->m_fCameraInThirdPerson = true; 37 | g_pInput->m_vecCameraOffset = Vector(view_angles.x, view_angles.y, vars.misc.thirdperson_dist.get() * progress); 38 | 39 | const auto cam_hull_offset = 12.f + (vars.misc.fov.get() / 4.8f - 18.f); 40 | const Vector cam_hull_extents(cam_hull_offset, cam_hull_offset, cam_hull_offset); 41 | Vector cam_forward; 42 | const auto origin = g_pLocalPlayer->get_eye_pos(); 43 | 44 | math::get().angle_vectors(QAngle(g_pInput->m_vecCameraOffset.x, g_pInput->m_vecCameraOffset.y, 0.0f), &cam_forward); 45 | 46 | trace_t trace; 47 | util_trace_hull(origin, origin - (cam_forward * g_pInput->m_vecCameraOffset.z), MASK_SOLID & ~CONTENTS_MONSTER, cam_hull_extents, &trace); 48 | 49 | g_pInput->m_vecCameraOffset.z *= trace.fraction; 50 | 51 | g_pLocalPlayer->get_tp_angle() = tp_angle; 52 | //g_pPrediction->SetLocalViewAngles( tp_angle ); 53 | } 54 | else if (g_pInput->m_fCameraInThirdPerson) 55 | { 56 | // animate backwards. 57 | progress -= g_pGlobals->frametime * 5.f + (progress / 100); 58 | 59 | // clamp. 60 | math::get().clamp(progress, 0.f, 1.f); 61 | g_pInput->m_vecCameraOffset.z = vars.misc.thirdperson_dist.get() * progress; 62 | 63 | // set to first person. 64 | if (!progress) 65 | g_pInput->m_fCameraInThirdPerson = false; 66 | } 67 | 68 | static auto b_once = false; 69 | 70 | if (g_pLocalPlayer->get_alive() || !vars.misc.thirdperson_dead.get()) 71 | { 72 | b_once = false; 73 | return; 74 | } 75 | 76 | if (b_once) 77 | g_pLocalPlayer->get_observer_mode() = 5; 78 | 79 | if (g_pLocalPlayer->get_observer_mode() == 4) 80 | b_once = true; 81 | } 82 | 83 | void thirdperson::set_tp_angle(const QAngle tp_angle) const 84 | { 85 | this->tp_angle = tp_angle; 86 | } 87 | 88 | void thirdperson::set_abs_angles(const QAngle abs_angles) const 89 | { 90 | this->abs_angles = abs_angles; 91 | } 92 | -------------------------------------------------------------------------------- /internal_hvh/features/thirdperson.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class thirdperson : public singleton 4 | { 5 | public: 6 | void run( ) const; 7 | void set_tp_angle( const QAngle tp_angle ) const; 8 | void set_abs_angles( const QAngle abs_angles ) const; 9 | QAngle& get_tp_angle() const { return tp_angle; } 10 | QAngle& get_abs_angle() const { return abs_angles; } 11 | private: 12 | mutable QAngle tp_angle; 13 | mutable QAngle abs_angles; 14 | mutable QAngle networked_angle; 15 | mutable QAngle clientside_angle; 16 | }; 17 | -------------------------------------------------------------------------------- /internal_hvh/features/tickbase_shift.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class TickbaseSystem { 4 | public: 5 | // Stores information about current tickbase shift 6 | struct ShiftData { 7 | int m_next_shift_amount; 8 | int m_ticks_to_shift; 9 | int m_current_shift; 10 | int m_stored_tickbase; 11 | int m_ticks_shifted_last; 12 | 13 | bool m_did_shift_before; 14 | bool m_should_attempt_shift; 15 | int m_needs_recharge; 16 | bool m_prepare_recharge; 17 | bool m_should_be_ready; 18 | bool m_can_shift_tickbase; 19 | bool m_should_disable; 20 | } m_shift_data; 21 | 22 | // Used to fix prediction when shifting tickbase 23 | struct Prediction { 24 | int m_shifted_command; 25 | int m_shifted_ticks; 26 | int m_original_tickbase; 27 | } m_prediction; 28 | 29 | // Prototypes - main functions necessary for tickbase shifting 30 | void WriteUserCmd( bf_write* buf, CUserCmd* incmd, CUserCmd* outcmd ); 31 | 32 | void PreMovement( ); 33 | void PostMovement( ); 34 | }; 35 | 36 | extern TickbaseSystem g_tickbase; -------------------------------------------------------------------------------- /internal_hvh/features/visuals.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "structs.h" 3 | 4 | struct misc_data_t 5 | { 6 | misc_data_t() 7 | { 8 | this->spread = -1.f; 9 | } 10 | misc_data_t( const float spread ) 11 | { 12 | this->spread = spread; 13 | } 14 | float spread = -1.f; 15 | }; 16 | 17 | class visuals : public singleton 18 | { 19 | public: 20 | void run(); 21 | void render(); 22 | std::array& get_players() { return players; } 23 | private: 24 | void players_get(); 25 | static void player_box( const visual_data_t& player ); 26 | void player_info( const visual_data_t& player ); 27 | bool bar_ping( const visual_data_t& player, int elements ) const; 28 | void bar_health( const visual_data_t& player, int elements ) const; 29 | static void bar_armor( const visual_data_t& player, int elements ); 30 | void bar_ammo( const visual_data_t& player, int elements ) const; 31 | bool bar_lby_update( const visual_data_t& player, int elements ) const; 32 | void player_out_of_fov( const Vector& pos ) const; 33 | void queue_world_data(); 34 | void queue_player_data(); 35 | void queue_misc_data(); 36 | void players_esp(); 37 | void defuse_bar( const world_data_t& ent ) const; 38 | void ammo_bar( const world_data_t & ent ) const; 39 | void world_info( const world_data_t& ent ) const; 40 | void world_esp(); 41 | static void draw_scope(); 42 | static void watermark(); 43 | static void aa_indicator(); 44 | static void fatality_indicators(); 45 | static void ping_indicator(); 46 | static void lby_indicator(); 47 | static void antiaim_arrows(); 48 | void spread_circle(); 49 | 50 | std::array players; 51 | msg_queue player_data[ 64 ]; 52 | msg_queue world_data; 53 | msg_queue misc_data; 54 | }; 55 | -------------------------------------------------------------------------------- /internal_hvh/features/wall_penetration.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Akatsyk/BloodNET/aea2205332f6c22ebacb7b1bb9a65654a6c384ef/internal_hvh/features/wall_penetration.cpp -------------------------------------------------------------------------------- /internal_hvh/features/wall_penetration.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | struct fire_bullet_data 5 | { 6 | Vector src; 7 | trace_t enter_trace; 8 | Vector direction; 9 | ITraceFilter filter; 10 | float trace_length; 11 | float trace_length_remaining; 12 | float current_damage; 13 | int penetrate_count; 14 | }; 15 | 16 | class penetration : public singleton 17 | { 18 | public: 19 | bool is_breakable_entity(IClientEntity* entity); 20 | void scale_damage(C_CSPlayer* ent, CGameTrace& enterTrace, CCSWeaponData* weaponData, float& currentDamage); 21 | bool trace_to_exit(CGameTrace& enterTrace, CGameTrace& exitTrace, Vector startPosition, Vector direction); 22 | bool handle_bullet_penetration(CCSWeaponData* weaponData, CGameTrace& enterTrace, Vector& eyePosition, Vector direction, int& possibleHitsRemaining, float& currentDamage, float penetrationPower, bool sv_penetration_type, float ff_damage_reduction_bullets, float ff_damage_bullet_penetration, float dist = 0.f, Vector start = { 0.f,0.f,0.f }); 23 | bool can_hit(Vector& point, float& damage, const Vector pos = g_pLocalPlayer->get_eye_pos()); 24 | bool fire_bullet(C_BaseCombatWeapon* pWeapon, Vector& direction, float& currentDamage, Vector pos = { 0.f,0.f,0.f }); 25 | bool simulate_bullet_fire_ultrahit(C_CSPlayer* shooter, C_CSPlayer* target, C_BaseCombatWeapon* weapon, FireBulletData& data, const Vector& endpos); 26 | bool get_damage(C_CSPlayer* shooter, C_CSPlayer* target, Vector end, float* damage, CCSWeaponData* custom_weapon, Vector* start_pos, matrix3x4_t* matrix = nullptr); 27 | }; 28 | -------------------------------------------------------------------------------- /internal_hvh/globals.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | struct Item_t; 5 | struct WeaponName_t; 6 | class C_CSGameRulesProxy; 7 | struct VMatrix; 8 | class C_locPlayer; 9 | class C_CSPlayer; 10 | class C_BaseEntity; 11 | class CUserCmd; 12 | class C_BaseCombatWeapon; 13 | class Vector; 14 | class ITraceFilter; 15 | class CGameTrace; 16 | class Color; 17 | struct matrix3x4_t; 18 | struct weaponconfig_t; 19 | struct antiaimconfig_t; 20 | typedef CGameTrace trace_t; 21 | using CBaseHandle = unsigned long; 22 | 23 | extern HMODULE g_module; 24 | extern bool g_erase; 25 | 26 | extern C_locPlayer g_pLocalPlayer; 27 | extern C_CSPlayer* get_entity( int index ); 28 | extern C_BaseCombatWeapon* get_weapon( const CBaseHandle* handle ); 29 | extern weaponconfig_t* get_config( C_BaseCombatWeapon* weapon ); 30 | extern antiaimconfig_t* get_antiaim( const int type ); 31 | extern uintptr_t g_GCClientSystem; 32 | extern float* g_asdasd; 33 | 34 | extern bool* g_send_packet; 35 | extern bool g_animate; 36 | extern CUserCmd* g_cmd; 37 | extern float g_inaccuracy; 38 | 39 | extern int m_tickbase_shift; 40 | extern int m_goal_shift; 41 | extern int m_rate; 42 | extern bool shifted; 43 | extern bool can_shift_tickbase; 44 | 45 | extern void util_trace_line( const Vector& vec_start, const Vector& vec_end, unsigned int n_mask, C_BaseEntity* p_cs_ignore, trace_t* p_trace ); 46 | extern void util_trace_hull( const Vector & vec_start, const Vector & vec_end, unsigned int n_mask, const Vector & extents, trace_t * p_trace ); 47 | extern void util_clip_trace_to_players( const Vector & vec_abs_start, const Vector & vec_abs_end, unsigned int mask, ITraceFilter * filter, trace_t * tr ); 48 | 49 | extern bool g_unload; 50 | extern bool g_revolver_fire; 51 | extern bool g_in_hbp; 52 | extern bool g_in_gl; 53 | extern bool g_ishltv_fix; 54 | extern bool g_setup_vel_fix; 55 | extern bool g_in_lp_draw; 56 | 57 | extern int g_reliable_state; 58 | extern int g_sequence_rn; 59 | 60 | extern VMatrix g_vmatrix; 61 | 62 | extern int g_tick_shot; 63 | 64 | extern C_CSGameRulesProxy** g_ppGameRules; 65 | 66 | HRESULT CreateVertexBuffer( 67 | UINT Length, 68 | DWORD Usage, 69 | DWORD FVF, 70 | D3DPOOL Pool, 71 | IDirect3DVertexBuffer9** ppVertexBuffer, 72 | HANDLE* pHandle 73 | ); 74 | 75 | HRESULT Lock( 76 | UINT OffsetToLock, 77 | UINT SizeToLock, 78 | VOID** ppbData, 79 | DWORD Flags 80 | ); 81 | 82 | 83 | extern LPDIRECT3DVERTEXBUFFER9 g_pVB; 84 | 85 | extern bool* g_disable_post_processing; 86 | 87 | extern matrix3x4_t g_trace_hitboxbones[ 128 ]; 88 | extern C_CSPlayer* g_trace_entity; 89 | 90 | extern float( *random_float ) ( float from, float to ); 91 | extern void( *random_seed ) ( unsigned int seed ); 92 | 93 | template 94 | auto get_col( const T val ) 95 | { 96 | Color ret; 97 | ret[ 0 ] = ( ( ( val ) & 0x00ff0000 ) >> 16 ); 98 | ret[ 1 ] = ( ( ( val ) & 0x0000ff00 ) >> 8 ); 99 | ret[ 2 ] = ( ( val ) & 0x000000ff ); 100 | ret[ 3 ] = ( ( ( val ) & 0xff000000 ) >> 24 ); 101 | 102 | return ret; 103 | } 104 | 105 | extern const std::map k_weapon_info; 106 | extern const std::vector k_knife_names; 107 | extern const std::vector k_weapon_names; 108 | extern std::vector k_pure_weapon_names; 109 | extern std::vector k_idx_to_defidex; -------------------------------------------------------------------------------- /internal_hvh/hooks/con_vars.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | #include 3 | 4 | bool __fastcall hooks::sv_cheats_get_bool(void* pConVar, void* edx) 5 | { 6 | if (g_unload) 7 | return orig_sv_cheats_get_bool(pConVar); 8 | 9 | if (reinterpret_cast(_ReturnAddress()) == offsets::cam_think) 10 | return false; 11 | 12 | return orig_sv_cheats_get_bool(pConVar); 13 | } 14 | 15 | int __fastcall hooks::debug_spread_show_get_int(void* pConVar, void* edx) 16 | { 17 | if (g_unload) 18 | return orig_debug_spread_show_get_int(pConVar); 19 | 20 | 21 | static auto draw_crosshair_ret = reinterpret_cast(sig("client.dll", "85 C0 0F 84 ? ? ? ? 8B 07 8B CF 8B 80 04 05 00 00")); 22 | if (_ReturnAddress() == draw_crosshair_ret && !g_pLocalPlayer->get_scoped() && g_pLocalPlayer->get_alive() && vars.misc.force_crosshair.get()) 23 | return 3; 24 | 25 | return orig_debug_spread_show_get_int(pConVar); 26 | } 27 | 28 | bool __fastcall hooks::net_showfragments_get_bool(void* pConVar, void* ebx) 29 | { 30 | static auto read_sub_channel_data_ret = reinterpret_cast(sig("engine.dll", "85 C0 74 12 53 FF 75 0C 68 ? ? ? ? FF 15 ? ? ? ? 83 C4 0C")); 31 | static auto check_receiving_list_ret = reinterpret_cast(sig("engine.dll", "8B 1D ? ? ? ? 85 C0 74 16 FF B6")); 32 | 33 | if (!g_pEngine->IsInGame() || !g_pEngine->IsConnected()) 34 | return orig_net_showfragments_get_bool(pConVar); 35 | 36 | static uint32_t last_fragment = 0; 37 | 38 | if (_ReturnAddress() == reinterpret_cast(read_sub_channel_data_ret) && last_fragment > 0) 39 | { 40 | const auto data = &reinterpret_cast(g_pClientState->m_NetChannel)[0x56]; 41 | const auto bytes_fragments = reinterpret_cast(data)[0x43]; 42 | 43 | if (bytes_fragments == last_fragment) 44 | { 45 | auto& buffer = reinterpret_cast(data)[0x42]; 46 | buffer = 0; 47 | } 48 | } 49 | 50 | if (_ReturnAddress() == check_receiving_list_ret) 51 | { 52 | const auto data = &reinterpret_cast(g_pClientState->m_NetChannel)[0x56]; 53 | const auto bytes_fragments = reinterpret_cast(data)[0x43]; 54 | 55 | last_fragment = bytes_fragments; 56 | } 57 | 58 | return orig_net_showfragments_get_bool(pConVar); 59 | } -------------------------------------------------------------------------------- /internal_hvh/hooks/create_move.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Akatsyk/BloodNET/aea2205332f6c22ebacb7b1bb9a65654a6c384ef/internal_hvh/hooks/create_move.cpp -------------------------------------------------------------------------------- /internal_hvh/hooks/do_extra_bone_processing.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | void _fastcall hooks::do_extra_bone_processing( void* ecx, void* edx, CStudioHdr* hdr, Vector* pos, Quaternion* q, const matrix3x4_t& matrix, byte* boneComputed, CIKContext* context ) 4 | { 5 | if (g_pLocalPlayer->get_effects() & EF_NOINTERP) 6 | return; 7 | 8 | const auto state = uint32_t(g_pLocalPlayer->get_anim_state()); 9 | 10 | if (!state) 11 | return orig_do_extra_bone_processing(ecx, hdr, pos, q, matrix, boneComputed, context); 12 | 13 | const auto backup_tickcount = *reinterpret_cast(state + 8); 14 | *reinterpret_cast(state + 8) = 0; 15 | orig_do_extra_bone_processing(ecx, hdr, pos, q, matrix, boneComputed, context); 16 | *reinterpret_cast(state + 8) = backup_tickcount; 17 | } -------------------------------------------------------------------------------- /internal_hvh/hooks/do_post_screen_space_effects.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | bool _fastcall hooks::do_post_screen_space_effects( void* ecx, void* edx, CViewSetup* setup ) 4 | { 5 | if ( g_unload ) 6 | return orig_do_post_screen_space_effects( ecx, setup ); 7 | 8 | glow::get().draw(); 9 | 10 | if ( g_pLocalPlayer && g_pLocalPlayer->get_alive() && g_pInput->m_fCameraInThirdPerson ) 11 | { 12 | g_in_lp_draw = true; 13 | g_pLocalPlayer->DrawModel( STUDIO_RENDER, 1 ); 14 | g_in_lp_draw = false; 15 | } 16 | 17 | g_in_gl = true; 18 | const auto ret = orig_do_post_screen_space_effects( ecx , setup ); 19 | g_in_gl = false; 20 | 21 | return ret; 22 | } -------------------------------------------------------------------------------- /internal_hvh/hooks/draw_model_execute.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | void __stdcall hooks::draw_model_execute( IMatRenderContext* context, const DrawModelState_t& state, const ModelRenderInfo_t& info, matrix3x4_t* pCustomBoneToWorld ) 4 | { 5 | if ( g_unload || g_in_gl ) 6 | return orig_draw_model_execute( g_pModelRender, context, state, info, pCustomBoneToWorld ); 7 | 8 | chams::get().draw_record( context, state, info, pCustomBoneToWorld ); 9 | 10 | g_pModelRender->ForcedMaterialOverride(); 11 | } -------------------------------------------------------------------------------- /internal_hvh/hooks/emit_sound.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | void __fastcall hooks::emit_sound( void* pThis, int edx, void* filter, int iEntIndex, int iChannel, 4 | const char *pSoundEntry, unsigned int nSoundEntryHash, const char *pSample, 5 | float flVolume, float flAttenuation, int nSeed, int iFlags, int iPitch, 6 | const void *pOrigin, const void *pDirection, void * pUtlVecOrigins, 7 | bool bUpdatePositions, float soundtime, int speakerentity ) 8 | { 9 | /*if ( strstr( pSample, "null" ) ) 10 | { 11 | iFlags = ( 1 << 2 ) | ( 1 << 5 ); 12 | iPitch = -1; 13 | flVolume = -1; 14 | pSample = ""; 15 | }*/ 16 | 17 | orig_emit_sound( pThis, filter, iEntIndex, iChannel, pSoundEntry, nSoundEntryHash, pSample, flVolume, flAttenuation, nSeed, iFlags, iPitch, pOrigin, pDirection, pUtlVecOrigins, bUpdatePositions, soundtime, speakerentity ); 18 | } -------------------------------------------------------------------------------- /internal_hvh/hooks/eye_angles.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | QAngle a = { 0.f,0.f,0.f }; 4 | 5 | QAngle* _fastcall hooks::eye_angles(void* ecx, void* edx) 6 | { 7 | if (g_pLocalPlayer && ecx == g_pLocalPlayer && g_pInput->m_fCameraInThirdPerson) 8 | return &thirdperson::get().get_tp_angle(); 9 | 10 | return orig_eye_angles(ecx); 11 | } 12 | 13 | void __fastcall hooks::maintain_sequence_transitions(void* ecx, void* edx, void* bonesetup, float a3, Vector* pos, Quaternion* q) 14 | { 15 | return; 16 | } 17 | 18 | void __fastcall hooks::standard_blending_rules(void* ecx, void* edx, CStudioHdr* hdr, Vector* pos, Quaternion* q, float curTime, int boneMask) 19 | { 20 | auto player = static_cast(ecx); 21 | player->get_effects() |= EF_NOINTERP; 22 | orig_standard_blending_rules(ecx, hdr, pos, q, curTime, boneMask); 23 | player->get_effects() &= ~EF_NOINTERP; 24 | } 25 | 26 | void __fastcall hooks::fire_event(void* ecx, void* edx) 27 | { 28 | if (!g_pLocalPlayer || !g_pLocalPlayer->get_alive() || !g_pEngine->IsInGame()) 29 | return orig_fire_event(ecx); 30 | 31 | auto cur_event = *reinterpret_cast(reinterpret_cast(g_pClientState) + 0x4DEC); 32 | if (!cur_event) 33 | return orig_fire_event(ecx); 34 | 35 | CEventInfo* next = nullptr; 36 | 37 | do 38 | { 39 | next = *(CEventInfo**)((uintptr_t)cur_event + 0x38); 40 | if (cur_event->classID - 1 == 197) 41 | cur_event->fire_delay = 0.0f; 42 | 43 | cur_event = next; 44 | 45 | } while (next); 46 | 47 | return orig_fire_event(ecx); 48 | } 49 | 50 | enum PlayerAnimEvent_t 51 | { 52 | PLAYERANIMEVENT_FIRE_GUN_PRIMARY = 0, 53 | PLAYERANIMEVENT_FIRE_GUN_SECONDARY, 54 | PLAYERANIMEVENT_THROW_GRENADE, 55 | PLAYERANIMEVENT_JUMP, 56 | PLAYERANIMEVENT_RELOAD, 57 | 58 | PLAYERANIMEVENT_COUNT 59 | }; 60 | 61 | void __fastcall hooks::do_animation_event(void* ecx, void* edx, unsigned int event, int data) 62 | { 63 | if (event == PLAYERANIMEVENT_FIRE_GUN_PRIMARY || event == PLAYERANIMEVENT_FIRE_GUN_SECONDARY) 64 | return; 65 | 66 | orig_do_animation_event(ecx, event, data); 67 | } -------------------------------------------------------------------------------- /internal_hvh/hooks/fire_bullets.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | void __stdcall fire_bullets_postdataupdate( C_TEFireBullets* thisptr, DataUpdateType_t updateType ) 4 | { 5 | if ( g_pLocalPlayer && g_pLocalPlayer->get_alive() && g_pEngine->IsInGame() ) 6 | { 7 | auto player = get_entity( thisptr->m_iPlayer + 1 ); 8 | if ( player && player->is_enemy() && player->GetClientClass()->m_ClassID == 35 ) 9 | { 10 | auto playerRecord = &player_log::get().get_log( thisptr->m_iPlayer + 1 ); 11 | playerRecord->m_flLastShotSimulationTime = player->get_simtime(); 12 | playerRecord->m_vecLastShotEyeAngles = thisptr->m_vecAngles; 13 | } 14 | } 15 | 16 | hooks::orig_fire_bullets_postdataupdate( thisptr, updateType ); 17 | } 18 | 19 | __declspec ( naked ) void __stdcall hooks::naked_fire_bullets_postdataupdate( DataUpdateType_t updateType ) 20 | { 21 | __asm 22 | { 23 | push[ esp + 4 ] 24 | push ecx 25 | call fire_bullets_postdataupdate 26 | retn 4 27 | } 28 | } -------------------------------------------------------------------------------- /internal_hvh/hooks/frame_stage_notify.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | void __stdcall hooks::frame_stage_notify( ClientFrameStage_t stage ) 4 | { 5 | if ( g_erase ) 6 | { 7 | erase_fn( init::on_startup ); 8 | g_erase = false; 9 | } 10 | 11 | chams::get().dark_mode(); 12 | 13 | if ( g_unload ) 14 | return orig_frame_stage_notify( stage ); 15 | 16 | if (stage == FRAME_NET_UPDATE_START) 17 | { 18 | m_rate = (int)std::round(1.f / g_pGlobals->interval_per_tick); 19 | } 20 | 21 | freestanding::get().update_hotkeys( stage ); 22 | 23 | misc::remove_smoke( stage ); 24 | 25 | misc::remove_flash( stage ); 26 | 27 | dormancy_manager::get().position_correction(stage); 28 | 29 | resolver::get().approve_shots( stage ); 30 | 31 | resolver::get().update_missed_shots( stage ); 32 | 33 | fake_ping::get().update( stage ); 34 | 35 | animations::get().stop( stage ); 36 | 37 | animations::get().fix_local_anims( stage ); 38 | 39 | net_data::get().apply( stage ); 40 | 41 | //resolver::get().extrpolate_players(stage); 42 | 43 | orig_frame_stage_notify( stage ); 44 | 45 | resolver::get().collect_wall_detect( stage ); 46 | 47 | player_log::get().log( stage ); 48 | } -------------------------------------------------------------------------------- /internal_hvh/hooks/hooks.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | c_hook* hooks::client = nullptr; 4 | c_hook* hooks::clientmode = nullptr; 5 | c_hook* hooks::engine = nullptr; 6 | c_hook* hooks::predict = nullptr; 7 | c_hook* hooks::modelrender = nullptr; 8 | c_hook* hooks::viewrender = nullptr; 9 | c_hook* hooks::enginetrace = nullptr; 10 | c_hook* hooks::renderview = nullptr; 11 | c_hook* hooks::vpanel = nullptr; 12 | c_hook* hooks::device = nullptr; 13 | c_hook* hooks::fire_bullets = nullptr; 14 | c_hook* hooks::engine_sound = nullptr; 15 | c_hook* hooks::surface = nullptr; 16 | c_hook* hooks::death_notice = nullptr; 17 | c_bphook* hooks::clientstateplus8 = nullptr; 18 | c_bphook* hooks::ccsplayer = nullptr; 19 | c_bphook* hooks::cbasesplayeranimstate = nullptr; 20 | c_bphook* hooks::ccsplayerrenderable = nullptr; 21 | c_hook* hooks::net_channel = nullptr; 22 | c_hook* hooks::debug_spread_show = nullptr; 23 | c_hook* hooks::net_showfragments = nullptr; 24 | c_hook* hooks::sv_cheats = nullptr; 25 | 26 | recv_prop_hook* hooks::smoke_prop = nullptr; 27 | recv_prop_hook* hooks::eye0_prop = nullptr; 28 | recv_prop_hook* hooks::eye1_prop = nullptr; 29 | recv_prop_hook* hooks::lby_prop = nullptr; 30 | recv_prop_hook* hooks::sequence_prop = nullptr; 31 | recv_prop_hook* hooks::rotation_prop = nullptr; 32 | 33 | WNDPROC hooks::orig_wnd_proc; 34 | hooks::create_move_fn hooks::orig_create_move; 35 | hooks::frame_stage_notify_fn hooks::orig_frame_stage_notify; 36 | hooks::draw_model_execute_fn hooks::orig_draw_model_execute; 37 | hooks::render_view_fn hooks::orig_render_view; 38 | hooks::is_box_visible_fn hooks::orig_is_box_visible; 39 | hooks::run_command_fn hooks::orig_run_command; 40 | hooks::WriteUserCmdDeltaToBuffer_t hooks::orig_WriteUserCmdDeltaToBuffer; 41 | hooks::scene_end_fn hooks::orig_scene_end; 42 | hooks::get_int_fn hooks::orig_debug_spread_show_get_int;; 43 | hooks::get_bool_fn hooks::orig_sv_cheats_get_bool; 44 | hooks::get_bool_fn hooks::orig_net_showfragments_get_bool; 45 | hooks::do_post_screen_space_effects_fn hooks::orig_do_post_screen_space_effects; 46 | hooks::present_fn hooks::orig_present; 47 | hooks::reset_fn hooks::orig_reset; 48 | hooks::send_datagram_fn hooks::orig_send_datagram; 49 | hooks::send_net_msg_fn hooks::orig_send_net_msg; 50 | hooks::is_hltv_fn hooks::orig_is_hltv; 51 | hooks::is_paused_fn hooks::orig_is_paused; 52 | hooks::paint_traverse_fn hooks::orig_paint_traverse; 53 | hooks::override_view_fn hooks::orig_override_view; 54 | hooks::emit_sound_fn hooks::orig_emit_sound; 55 | hooks::temp_entities_fn hooks::orig_temp_entities; 56 | hooks::fire_bullets_postdataupdate_fn hooks::orig_fire_bullets_postdataupdate; 57 | hooks::do_extra_bone_processing_fn hooks::orig_do_extra_bone_processing; 58 | hooks::play_sound_fn hooks::orig_play_sound; 59 | hooks::is_connected_fn hooks::orig_is_connected; 60 | hooks::push_notice_call_fn hooks::orig_process_input; 61 | hooks::eye_angles_fn hooks::orig_eye_angles; 62 | hooks::standard_blending_rules_fn hooks::orig_standard_blending_rules; 63 | hooks::do_animation_event_fn hooks::orig_do_animation_event; 64 | hooks::maintain_sequence_transitions_fn hooks::orig_maintain_sequence_transitions; 65 | hooks::fire_event_fn hooks::orig_fire_event; 66 | hooks::trace_ray_fn hooks::orig_trace_ray; 67 | RecvVarProxyFn hooks::orig_smoke_effect; 68 | RecvVarProxyFn hooks::orig_m_angEyeAngles0Proxy; 69 | RecvVarProxyFn hooks::orig_m_angEyeAngles1Proxy; 70 | RecvVarProxyFn hooks::orig_m_flLowerBodyYawTargetProxy; 71 | RecvVarProxyFn hooks::orig_sequence; 72 | RecvVarProxyFn hooks::orig_m_angRotationProxy; 73 | -------------------------------------------------------------------------------- /internal_hvh/hooks/is_box_visible.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | #include 3 | 4 | int __stdcall hooks::is_box_visible( const Vector& mins, const Vector& maxs ) 5 | { 6 | if ( g_unload ) 7 | return orig_is_box_visible( mins, maxs ); 8 | 9 | __( addr, "\x85\xC0\x74\x2D\x83\x7D\x10\x00\x75\x1C" ); 10 | static auto retaddr = addr; 11 | 12 | if ( !memcmp( _ReturnAddress(), retaddr, 10 ) ) 13 | return 1; 14 | 15 | return orig_is_box_visible( mins, maxs ); 16 | } -------------------------------------------------------------------------------- /internal_hvh/hooks/is_connected.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | #include 3 | 4 | bool __fastcall hooks::is_connected( void* ecx, void* edx ) 5 | { 6 | static auto ret = reinterpret_cast< uintptr_t* >( sig( "client.dll", "75 04 B0 01 5F" ) - 2); 7 | 8 | if ( _ReturnAddress() == ret ) // enable inventory 9 | return false; 10 | 11 | return orig_is_connected( ecx ); 12 | } 13 | -------------------------------------------------------------------------------- /internal_hvh/hooks/is_hltv.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | #include 3 | 4 | bool __fastcall hooks::is_hltv( void* ecx, void* edx ) 5 | { 6 | // if wanted, force the game to always call AccumulateLayers. 7 | 8 | if ( g_ishltv_fix ) 9 | return true; 10 | 11 | // if wanted, force game to use abs velocity instead of estimating it. 12 | 13 | static auto setup_velocity = reinterpret_cast< uintptr_t* >( sig( "client.dll", "84 C0 75 38 8B 0D ? ? ? ? 8B 01 8B 80" ) ); 14 | 15 | if ( g_setup_vel_fix && _ReturnAddress() == setup_velocity ) 16 | return true; 17 | 18 | return orig_is_hltv( ecx ); 19 | } 20 | 21 | bool __fastcall hooks::is_paused(void* ecx, void* edx) 22 | { 23 | static auto return_to_extrapolation = reinterpret_cast(sig("client.dll", "FF D0 A1 ? ? ? ? ? ? ? ? B9 ? ? ? ? ? ? ? ? D9 1D ? ? ? ? ? ? ? ? FF 50 34 85 C0 74 22 8B 0D ? ? ? ? ? ? ? ? ") + 0x29); 24 | static auto return_to_interpolation = reinterpret_cast(sig("client.dll", "84 C0 74 07 C6 05 ? ? ? ? ? 8B 0D")); 25 | 26 | if (_ReturnAddress() == (void*)return_to_extrapolation || _ReturnAddress() == (void*)return_to_interpolation) 27 | return true; 28 | 29 | return orig_is_paused(ecx); 30 | } -------------------------------------------------------------------------------- /internal_hvh/hooks/m_angEyeAngles0Proxy.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | void __cdecl hooks::m_angEyeAngles0Proxy( CRecvProxyData *pData, void* entity, void* output ) 4 | { 5 | const auto player = reinterpret_cast< C_CSPlayer* >( entity ); 6 | const auto PlayerRecord = &player_log::get().get_log( player->EntIndex() ); 7 | 8 | PlayerRecord->m_flProxyPitch = pData->m_Value.m_Float; 9 | if ( PlayerRecord->m_bCustomCorrection ) 10 | pData->m_Value.m_Float = PlayerRecord->m_flPitch; 11 | 12 | return orig_m_angEyeAngles0Proxy( pData, entity, output ); 13 | } -------------------------------------------------------------------------------- /internal_hvh/hooks/m_angEyeAngles1Proxy.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | void __cdecl hooks::m_angEyeAngles1Proxy( CRecvProxyData *pData, void* entity, void* output ) 4 | { 5 | const auto player = reinterpret_cast< C_CSPlayer* >( entity ); 6 | 7 | resolver::resolve_proxy( player, &pData->m_Value.m_Float ); 8 | 9 | return orig_m_angEyeAngles1Proxy( pData, entity, output ); 10 | } -------------------------------------------------------------------------------- /internal_hvh/hooks/m_angRotationProxy.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | void __cdecl hooks::m_angRotationProxy( CRecvProxyData *pData, void* entity, void* output ) 4 | { 5 | return orig_m_angRotationProxy( pData, entity, output ); 6 | } -------------------------------------------------------------------------------- /internal_hvh/hooks/m_flLowerBodyYawTargetProxy.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | struct stack_frame 4 | { 5 | stack_frame* next; 6 | DWORD ret; 7 | }; 8 | 9 | __forceinline DWORD get_ret_addr( int depth = 0 ) 10 | { 11 | stack_frame* fp; 12 | 13 | _asm mov fp, ebp; 14 | 15 | for ( int i = 0; i < depth; i++ ) 16 | { 17 | if ( !fp ) 18 | break; 19 | 20 | fp = fp->next; 21 | } 22 | 23 | return fp ? fp->ret : 0; 24 | } 25 | 26 | void __cdecl hooks::m_flLowerBodyYawTargetProxy( CRecvProxyData *pData, void* entity, void* output ) 27 | { 28 | const auto player = reinterpret_cast< C_CSPlayer* >( entity ); 29 | 30 | static DWORD fnCopyNewEntity = sig( "engine.dll", "EB 3F FF 77 10" ); 31 | 32 | // skip "unwanted" lowerbody updates originating from CopyNewEntity. 33 | // happens on entity creation + pvs re-enter. 34 | 35 | if ( fnCopyNewEntity != get_ret_addr( 2 ) ) 36 | resolver::on_lby_proxy( player, &pData->m_Value.m_Float ); 37 | 38 | return orig_m_flLowerBodyYawTargetProxy( pData, entity, output ); 39 | } -------------------------------------------------------------------------------- /internal_hvh/hooks/override_view.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | void __stdcall hooks::override_view( CViewSetup* setup ) 4 | { 5 | if ( g_unload ) 6 | return orig_override_view( setup ); 7 | 8 | thirdperson::get().run(); 9 | 10 | if (GetAsyncKeyState(vars.key.fakeduck.get()) && g_pLocalPlayer && g_pLocalPlayer->get_alive())// && INTERFACES::Input->m_fCameraInThirdPerson) 11 | setup->origin.z = g_pLocalPlayer->get_abs_origin().z + 64.f; 12 | 13 | orig_override_view( setup ); 14 | 15 | if ( g_pEngine->IsInGame() ) 16 | { 17 | *g_disable_post_processing = true; 18 | 19 | if ( !g_pLocalPlayer->get_scoped() ) 20 | { 21 | if ( vars.misc.fov_enabled.get() ) 22 | setup->fov = vars.misc.fov.get(); 23 | } 24 | else 25 | { 26 | if ( vars.misc.fov_enabled.get() && vars.misc.fov_scope.get() ) 27 | setup->fov = vars.misc.fov.get(); 28 | } 29 | 30 | } 31 | } -------------------------------------------------------------------------------- /internal_hvh/hooks/paint_traverse.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | void __fastcall hooks::paint_traverse( void* pPanels, int edx, unsigned int panel, bool forceRepaint, bool allowForce ) 4 | { 5 | if ( g_unload ) 6 | return orig_paint_traverse( pPanels, panel, forceRepaint, allowForce ); 7 | 8 | static unsigned int scope_panel; 9 | if ( !scope_panel ) 10 | { 11 | const auto panelname = g_pPanel->GetName( panel ); 12 | 13 | _( HudZoom, "HudZoom" ); 14 | if ( !strcmp( panelname, HudZoom ) ) 15 | scope_panel = panel; 16 | } 17 | 18 | if ( panel == scope_panel && vars.misc.remove_scope.get() ) 19 | return; 20 | 21 | g_vmatrix = g_pEngine->WorldToScreenMatrix(); 22 | 23 | orig_paint_traverse( pPanels, panel, forceRepaint, allowForce ); 24 | 25 | static unsigned int draw_panel; 26 | if ( !draw_panel ) 27 | { 28 | const auto panelname = g_pPanel->GetName( panel ); 29 | 30 | _( MatSystemTopPanel, "MatSystemTopPanel" ); 31 | if ( !strcmp( panelname, MatSystemTopPanel ) ) 32 | draw_panel = panel; 33 | } 34 | 35 | if ( panel != draw_panel ) 36 | return; 37 | 38 | visuals::get().run(); 39 | } -------------------------------------------------------------------------------- /internal_hvh/hooks/play_sound.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | void __stdcall hooks::play_sound( const char *folderIme ) 4 | { 5 | _( competitive_accept_beep, "!UI/competitive_accept_beep.wav" ); 6 | 7 | if ( strcmp( folderIme, competitive_accept_beep ) ) 8 | return orig_play_sound( g_pSurface, folderIme ); 9 | 10 | if ( !vars.misc.autoaccept.get() || g_pEngine->IsInGame() ) 11 | return orig_play_sound( g_pSurface, folderIme ); 12 | 13 | static auto is_ready = reinterpret_cast< void( *)( ) >( sig( "client.dll", "55 8B EC 83 E4 F8 83 EC 08 56 8B 35 ? ? ? ? 57 83 BE" ) ); 14 | is_ready(); 15 | 16 | _( light_power_on_switch_01, "buttons/light_power_on_switch_01.wav" ); 17 | g_pSurface->PlaySound( light_power_on_switch_01 ); 18 | 19 | FLASHWINFO flash; 20 | flash.cbSize = sizeof( FLASHWINFO ); 21 | flash.hwnd = init::window; 22 | flash.dwFlags = FLASHW_ALL | FLASHW_TIMERNOFG; 23 | flash.uCount = 0; 24 | flash.dwTimeout = 0; 25 | FlashWindowEx( &flash ); 26 | } -------------------------------------------------------------------------------- /internal_hvh/hooks/present.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | long __stdcall hooks::present( IDirect3DDevice9* device, RECT* pSourceRect, RECT* pDestRect, HWND hDestWindowOverride, RGNDATA* pDirtyRegion ) 4 | { 5 | if ( g_unload ) 6 | return orig_present( device, pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion ); 7 | 8 | IDirect3DStateBlock9* state; 9 | if ( device->CreateStateBlock( D3DSBT_ALL, &state ) ) 10 | return orig_present( device, pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion ); 11 | 12 | render::get().init( device ); 13 | render::get().setup_render_state(); 14 | 15 | visuals::get().render(); 16 | c_menu::get().toggle(); 17 | c_menu::get().render(); 18 | 19 | bool old_tickbase = g_tickbase.m_shift_data.m_should_attempt_shift; 20 | 21 | // note - alpha; 22 | // the maximum amount of ticks we can shift is sv_maxusrcmdprocessticks 23 | // which is defaulted to 16 - but since we want to be fakelagging atleast 2 ticks 24 | // for our fake angle to work, we need to reserve 2 ticks for the fakelag. 25 | // we want our doubletap to be as fast as possible, and our fake to be as wide as possible 26 | // therefore let's just fakelag 2 ticks - resulting in our max shift ticks being 14 27 | // cos sv_maxusrcmdprocessticks Take Away Two Is Fourteen 28 | // (assuming that the convar wasn't changed to a higher/lower value). 29 | m_goal_shift = 13; 30 | 31 | // (!) Temporary - replace with checkbox & hotkey later. 32 | if (old_tickbase != g_tickbase.m_shift_data.m_should_attempt_shift) 33 | { 34 | //g_notify.add( tfm::format( XOR( "Tried shifting tickbase" )) ); 35 | 36 | if (g_tickbase.m_shift_data.m_should_attempt_shift) 37 | g_tickbase.m_shift_data.m_needs_recharge = m_goal_shift; 38 | else 39 | g_tickbase.m_shift_data.m_needs_recharge = 0; 40 | 41 | g_tickbase.m_shift_data.m_did_shift_before = false; 42 | } 43 | 44 | state->Apply(); 45 | state->Release(); 46 | 47 | return orig_present( device, pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion ); 48 | } 49 | 50 | -------------------------------------------------------------------------------- /internal_hvh/hooks/process_input.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | std::wstring UTF8toUnicode( const std::string& s ) 4 | { 5 | std::wstring ws; 6 | wchar_t wc; 7 | for ( int i = 0; i < s.length(); ) 8 | { 9 | char c = s[ i ]; 10 | if ( ( c & 0x80 ) == 0 ) 11 | { 12 | wc = c; 13 | ++i; 14 | } 15 | else if ( ( c & 0xE0 ) == 0xC0 ) 16 | { 17 | wc = ( s[ i ] & 0x1F ) << 6; 18 | wc |= ( s[ i + 1 ] & 0x3F ); 19 | i += 2; 20 | } 21 | else if ( ( c & 0xF0 ) == 0xE0 ) 22 | { 23 | wc = ( s[ i ] & 0xF ) << 12; 24 | wc |= ( s[ i + 1 ] & 0x3F ) << 6; 25 | wc |= ( s[ i + 2 ] & 0x3F ); 26 | i += 3; 27 | } 28 | else if ( ( c & 0xF8 ) == 0xF0 ) 29 | { 30 | wc = ( s[ i ] & 0x7 ) << 18; 31 | wc |= ( s[ i + 1 ] & 0x3F ) << 12; 32 | wc |= ( s[ i + 2 ] & 0x3F ) << 6; 33 | wc |= ( s[ i + 3 ] & 0x3F ); 34 | i += 4; 35 | } 36 | else if ( ( c & 0xFC ) == 0xF8 ) 37 | { 38 | wc = ( s[ i ] & 0x3 ) << 24; 39 | wc |= ( s[ i ] & 0x3F ) << 18; 40 | wc |= ( s[ i ] & 0x3F ) << 12; 41 | wc |= ( s[ i ] & 0x3F ) << 6; 42 | wc |= ( s[ i ] & 0x3F ); 43 | i += 5; 44 | } 45 | else if ( ( c & 0xFE ) == 0xFC ) 46 | { 47 | wc = ( s[ i ] & 0x1 ) << 30; 48 | wc |= ( s[ i ] & 0x3F ) << 24; 49 | wc |= ( s[ i ] & 0x3F ) << 18; 50 | wc |= ( s[ i ] & 0x3F ) << 12; 51 | wc |= ( s[ i ] & 0x3F ) << 6; 52 | wc |= ( s[ i ] & 0x3F ); 53 | i += 6; 54 | } 55 | ws += wc; 56 | } 57 | return ws; 58 | } 59 | 60 | char* __fastcall hooks::process_input( void* ecx, void* edx ) 61 | { 62 | static auto spawntime = 0.f; 63 | static auto status = false; 64 | 65 | auto set = false; 66 | if ( spawntime != g_pLocalPlayer->get_spawn_time() || status != vars.misc.preservedn.get() ) 67 | { 68 | set = true; 69 | status = vars.misc.preservedn.get(); 70 | spawntime = g_pLocalPlayer->get_spawn_time(); 71 | } 72 | 73 | for ( auto& current : g_pDeathNotice->m_nDeathNotices ) 74 | { 75 | if ( !g_pLocalPlayer->get_alive() || set ) 76 | { 77 | if ( current.set != 1.f && !set ) 78 | continue; 79 | 80 | current.m_flStartTime = g_pGlobals->curtime; 81 | current.m_flStartTime -= !g_pLocalPlayer->get_alive() ? 2.f : 7.5f; 82 | current.set = 2.f; 83 | 84 | continue; 85 | } 86 | 87 | if ( current.set == 2.f ) 88 | continue; 89 | 90 | if ( !status ) 91 | { 92 | current.set = 1.f; 93 | return orig_process_input( ecx ); 94 | } 95 | 96 | if ( current.set == 1.f ) 97 | continue; 98 | 99 | if ( current.m_flLifeTimeModifier == 1.5f ) 100 | { 101 | current.m_flStartTime = 9999999.f; 102 | } 103 | 104 | 105 | current.set = 1.f; 106 | } 107 | 108 | return orig_process_input( ecx ); 109 | } -------------------------------------------------------------------------------- /internal_hvh/hooks/render_view.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | void __fastcall hooks::render_view( void* thisptr, void*, CViewSetup& setup, CViewSetup& hudViewSetup, unsigned int nClearFlags, int whatToDraw ) 4 | { 5 | if ( g_unload ) 6 | return orig_render_view( thisptr, setup, hudViewSetup, nClearFlags, whatToDraw ); 7 | 8 | aimbot::get().no_visual_recoil( setup ); 9 | 10 | beams::get().draw_impacts(); 11 | 12 | if ( vars.misc.vm_fov_enabled.get() ) 13 | setup.fovViewmodel = vars.misc.vm_fov.get(); 14 | 15 | 16 | orig_render_view( thisptr, setup, hudViewSetup, nClearFlags, whatToDraw ); 17 | } -------------------------------------------------------------------------------- /internal_hvh/hooks/reset.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | long __stdcall hooks::reset( IDirect3DDevice9* device, D3DPRESENT_PARAMETERS* pp ) 4 | { 5 | render::get().invalidate_device_objects(); 6 | c_menu::get().release_images(); 7 | 8 | if ( g_unload ) 9 | { 10 | return orig_reset( device, pp ); 11 | } 12 | 13 | c_menu::get().get_opened() = false; 14 | 15 | const auto hr = orig_reset( device, pp ); 16 | 17 | render::get().init_device_objects( device ); 18 | 19 | return hr; 20 | } 21 | -------------------------------------------------------------------------------- /internal_hvh/hooks/runcmd.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | void __fastcall hooks::run_command(void* ecx_, void* edx_, C_BasePlayer* entity, CUserCmd* ucmd, IMoveHelper* move_helper) { 4 | if (g_unload) 5 | return orig_run_command(ecx_, edx_, entity, ucmd, move_helper); 6 | 7 | // airstuck jitter / overpred fix. 8 | if (ucmd->tick_count >= std::numeric_limits< int >::max()) 9 | return; 10 | 11 | orig_run_command(ecx_, edx_, entity, ucmd, move_helper); 12 | 13 | // store non compressed netvars. 14 | net_data::get().store(); 15 | } -------------------------------------------------------------------------------- /internal_hvh/hooks/scene_end.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | void __fastcall hooks::scene_end( void * ecx, void * edx ) 4 | { 5 | if ( g_unload ) 6 | return orig_scene_end( ecx ); 7 | 8 | orig_scene_end( ecx ); 9 | 10 | chams::get().extend_drawing(); 11 | } -------------------------------------------------------------------------------- /internal_hvh/hooks/send_datagram.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | //int __fastcall hooks::send_datagram(void* netchan, void*, void* datagram) 4 | //{ 5 | // if (!g_pEngine->IsInGame() || g_unload) 6 | // return orig_send_datagram(netchan, datagram); 7 | // 8 | // const auto net_channel = reinterpret_cast (netchan); 9 | // 10 | // int backup_state = net_channel->m_nInReliableState; 11 | // int backup_sequence = net_channel->m_nInSequenceNr; 12 | // 13 | // fake_ping::get().ping_spike(net_channel); 14 | // 15 | // int ret = orig_send_datagram(netchan, datagram); 16 | // 17 | // net_channel->m_nInReliableState = backup_state; 18 | // net_channel->m_nInSequenceNr = backup_sequence; 19 | // 20 | // return ret; 21 | //} 22 | 23 | int __fastcall hooks::send_datagram(void* netchan, void*, void* datagram) 24 | { 25 | if (!g_pEngine->IsInGame() || g_unload) 26 | return orig_send_datagram(netchan, datagram); 27 | 28 | 29 | const auto net_channel = reinterpret_cast (netchan); 30 | 31 | const auto backup_seqnr = net_channel->m_nInSequenceNr; 32 | 33 | fake_ping::get().ping_spike(net_channel); 34 | 35 | const auto ret = orig_send_datagram(net_channel, datagram); 36 | 37 | net_channel->m_nInSequenceNr = backup_seqnr; 38 | 39 | return ret; 40 | } 41 | 42 | bool __fastcall hooks::send_net_msg(void* netchan, void* edx, INetMessage& msg, bool reliable, bool voice) 43 | { 44 | if (msg.GetGroup() == 9) 45 | voice = true; 46 | 47 | return orig_send_net_msg(netchan, msg, reliable, voice); 48 | } -------------------------------------------------------------------------------- /internal_hvh/hooks/sequence.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | enum e_sequence 4 | { 5 | SEQUENCE_DEFAULT_DRAW = 0, 6 | SEQUENCE_DEFAULT_IDLE1 = 1, 7 | SEQUENCE_DEFAULT_IDLE2 = 2, 8 | SEQUENCE_DEFAULT_LIGHT_MISS1 = 3, 9 | SEQUENCE_DEFAULT_LIGHT_MISS2 = 4, 10 | SEQUENCE_DEFAULT_HEAVY_MISS1 = 9, 11 | SEQUENCE_DEFAULT_HEAVY_HIT1 = 10, 12 | SEQUENCE_DEFAULT_HEAVY_BACKSTAB = 11, 13 | SEQUENCE_DEFAULT_LOOKAT01 = 12, 14 | 15 | SEQUENCE_BUTTERFLY_DRAW = 0, 16 | SEQUENCE_BUTTERFLY_DRAW2 = 1, 17 | SEQUENCE_BUTTERFLY_LOOKAT01 = 13, 18 | SEQUENCE_BUTTERFLY_LOOKAT03 = 15, 19 | 20 | SEQUENCE_FALCHION_IDLE1 = 1, 21 | SEQUENCE_FALCHION_HEAVY_MISS1 = 8, 22 | SEQUENCE_FALCHION_HEAVY_MISS1_NOFLIP = 9, 23 | SEQUENCE_FALCHION_LOOKAT01 = 12, 24 | SEQUENCE_FALCHION_LOOKAT02 = 13, 25 | 26 | SEQUENCE_DAGGERS_IDLE1 = 1, 27 | SEQUENCE_DAGGERS_LIGHT_MISS1 = 2, 28 | SEQUENCE_DAGGERS_LIGHT_MISS5 = 6, 29 | SEQUENCE_DAGGERS_HEAVY_MISS2 = 11, 30 | SEQUENCE_DAGGERS_HEAVY_MISS1 = 12, 31 | 32 | SEQUENCE_BOWIE_IDLE1 = 1, 33 | }; 34 | 35 | inline int random_sequence( const int low, const int high ) 36 | { 37 | return rand() % ( high - low + 1 ) + low; 38 | } 39 | 40 | const static std::unordered_map animation_fix_map 41 | { 42 | { FnvHash( "models/weapons/v_knife_butterfly.mdl" ), []( int sequence ) -> int 43 | { 44 | switch ( sequence ) 45 | { 46 | case SEQUENCE_DEFAULT_DRAW: 47 | return random_sequence( SEQUENCE_BUTTERFLY_DRAW, SEQUENCE_BUTTERFLY_DRAW2 ); 48 | case SEQUENCE_DEFAULT_LOOKAT01: 49 | return random_sequence( SEQUENCE_BUTTERFLY_LOOKAT01, SEQUENCE_BUTTERFLY_LOOKAT03 ); 50 | default: 51 | return sequence + 1; 52 | } 53 | } }, 54 | { FnvHash( "models/weapons/v_knife_falchion_advanced.mdl" ), []( int sequence ) -> int 55 | { 56 | switch ( sequence ) 57 | { 58 | case SEQUENCE_DEFAULT_IDLE2: 59 | return SEQUENCE_FALCHION_IDLE1; 60 | case SEQUENCE_DEFAULT_HEAVY_MISS1: 61 | return random_sequence( SEQUENCE_FALCHION_HEAVY_MISS1, SEQUENCE_FALCHION_HEAVY_MISS1_NOFLIP ); 62 | case SEQUENCE_DEFAULT_LOOKAT01: 63 | return random_sequence( SEQUENCE_FALCHION_LOOKAT01, SEQUENCE_FALCHION_LOOKAT02 ); 64 | case SEQUENCE_DEFAULT_DRAW: 65 | case SEQUENCE_DEFAULT_IDLE1: 66 | return sequence; 67 | default: 68 | return sequence - 1; 69 | } 70 | } }, 71 | { FnvHash( "models/weapons/v_knife_push.mdl" ), []( int sequence ) -> int 72 | { 73 | switch ( sequence ) 74 | { 75 | case SEQUENCE_DEFAULT_IDLE2: 76 | return SEQUENCE_DAGGERS_IDLE1; 77 | case SEQUENCE_DEFAULT_LIGHT_MISS1: 78 | case SEQUENCE_DEFAULT_LIGHT_MISS2: 79 | return random_sequence( SEQUENCE_DAGGERS_LIGHT_MISS1, SEQUENCE_DAGGERS_LIGHT_MISS5 ); 80 | case SEQUENCE_DEFAULT_HEAVY_MISS1: 81 | return random_sequence( SEQUENCE_DAGGERS_HEAVY_MISS2, SEQUENCE_DAGGERS_HEAVY_MISS1 ); 82 | case SEQUENCE_DEFAULT_HEAVY_HIT1: 83 | case SEQUENCE_DEFAULT_HEAVY_BACKSTAB: 84 | case SEQUENCE_DEFAULT_LOOKAT01: 85 | return sequence + 3; 86 | case SEQUENCE_DEFAULT_DRAW: 87 | case SEQUENCE_DEFAULT_IDLE1: 88 | return sequence; 89 | default: 90 | return sequence + 2; 91 | } 92 | } }, 93 | { FnvHash( "models/weapons/v_knife_survival_bowie.mdl" ), []( int sequence ) -> int 94 | { 95 | switch ( sequence ) 96 | { 97 | case SEQUENCE_DEFAULT_DRAW: 98 | case SEQUENCE_DEFAULT_IDLE1: 99 | return sequence; 100 | case SEQUENCE_DEFAULT_IDLE2: 101 | return SEQUENCE_BOWIE_IDLE1; 102 | default: 103 | return sequence - 1; 104 | } 105 | } } 106 | }; 107 | 108 | void __cdecl hooks::sequence( CRecvProxyData* proxy_data, void* entity, void* output ) 109 | { 110 | if ( !g_pLocalPlayer || !g_pLocalPlayer->get_alive() ) 111 | return orig_sequence( proxy_data, entity, output ); 112 | 113 | auto view_model = static_cast< C_BaseViewModel* >( entity ); 114 | if ( view_model && view_model->get_owner() && view_model->get_owner() != INVALID_EHANDLE_INDEX ) 115 | { 116 | const auto owner = reinterpret_cast< C_CSPlayer* >( g_pEntitiyList->GetClientEntityFromHandle( view_model->get_owner() ) ); 117 | if ( owner == g_pLocalPlayer ) 118 | { 119 | // Get the filename of the current view model. 120 | const auto knife_model = g_pModelInfo->GetModel( view_model->get_model_idx() ); 121 | const auto model_name = g_pModelInfo->GetModelName( knife_model ); 122 | 123 | const auto name = FnvHash( model_name ); 124 | 125 | if ( animation_fix_map.count( name ) ) 126 | proxy_data->m_Value.m_Int = animation_fix_map.at( name )( proxy_data->m_Value.m_Int ); 127 | } 128 | } 129 | 130 | orig_sequence( proxy_data, entity, output ); 131 | } -------------------------------------------------------------------------------- /internal_hvh/hooks/smoke_effect.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | void __cdecl hooks::smoke_effect( CRecvProxyData* proxy_data_const, void* entity, void* output ) 4 | { 5 | if ( g_unload ) 6 | orig_smoke_effect( proxy_data_const, entity, output ); 7 | 8 | if ( vars.misc.remove_smoke.get() ) 9 | *reinterpret_cast< bool* >( reinterpret_cast< uintptr_t >( output ) + 0x1 ) = true; 10 | } -------------------------------------------------------------------------------- /internal_hvh/hooks/temp_entities.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | bool __fastcall hooks::temp_entities( void* ECX, void* EDX, void* msg ) 4 | { 5 | if (!g_pLocalPlayer || !g_pEngine->IsInGame()) 6 | { 7 | return orig_temp_entities(ECX, msg); 8 | } 9 | 10 | const bool ret = orig_temp_entities(ECX, msg); 11 | 12 | CEventInfo* ei = g_pClientState->m_Events; 13 | CEventInfo* next = nullptr; 14 | 15 | if (!ei) { 16 | return ret; 17 | } 18 | 19 | do { 20 | next = *reinterpret_cast(reinterpret_cast(ei) + 0x38); 21 | 22 | uint16_t classID = ei->classID - 1; 23 | 24 | auto m_pCreateEventFn = ei->pClientClass->m_pCreateEventFn; 25 | if (!m_pCreateEventFn) { 26 | continue; 27 | } 28 | 29 | void* pCE = m_pCreateEventFn(); 30 | if (!pCE) { 31 | continue; 32 | } 33 | 34 | if (classID == 170) { 35 | ei->fire_delay = 0.0f; 36 | } 37 | ei = next; 38 | } while (next != nullptr); 39 | 40 | return ret; 41 | } -------------------------------------------------------------------------------- /internal_hvh/hooks/trace_ray.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | void __fastcall hooks::trace_ray( void *thisptr, void*, const Ray_t& ray, unsigned int fMask, ITraceFilter* pTraceFilter, trace_t* pTrace ) 4 | { 5 | if ( !g_in_hbp || g_unload ) 6 | return orig_trace_ray( thisptr, ray, fMask, pTraceFilter, pTrace ); 7 | 8 | orig_trace_ray( thisptr, ray, fMask, pTraceFilter, pTrace ); 9 | 10 | pTrace->surface.flags |= SURF_SKY; 11 | } 12 | -------------------------------------------------------------------------------- /internal_hvh/hooks/wnd_proc.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | LRESULT __stdcall hooks::wnd_proc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ) 4 | { 5 | if ( g_unload ) 6 | return CallWindowProc( orig_wnd_proc, hWnd, uMsg, wParam, lParam ); 7 | 8 | if ( render::get().get_init() && c_menu::get().get_opened() ) 9 | { 10 | return true; 11 | } 12 | 13 | return CallWindowProc( orig_wnd_proc, hWnd, uMsg, wParam, lParam ); 14 | } -------------------------------------------------------------------------------- /internal_hvh/hooks/writeusercmddeltatobuffer.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | #include 3 | 4 | void write_user_cmd(bf_write* buf, CUserCmd* in, CUserCmd* out) 5 | { 6 | static DWORD write_user_cmd_f = (DWORD)sig("client_panorama.dll", "55 8B EC 83 E4 F8 51 53 56 8B D9 8B 0D"); 7 | 8 | __asm 9 | { 10 | mov ecx, buf 11 | mov edx, in 12 | push out 13 | call write_user_cmd_f 14 | add esp, 4 15 | } 16 | }; 17 | 18 | bool __fastcall hooks::WriteUserCmdDeltaToBuffer(void* ecx_, void* edx_, int nslot, bf_write* buf, int from, int to, bool isnewcmd) 19 | { 20 | static auto sendmovecall = (void*)sig("engine.dll", "84 C0 74 04 B0 01 EB 02 32 C0 8B FE 46 3B F3 7E C9 84 C0 0F 84"); 21 | 22 | if (_ReturnAddress() != sendmovecall || m_tickbase_shift <= 0) { 23 | m_tickbase_shift = 0; 24 | return orig_WriteUserCmdDeltaToBuffer(ecx_, edx_, nslot, buf, from, to, isnewcmd); 25 | } 26 | 27 | if (from != -1) 28 | return true; 29 | 30 | int* number_of_backup_commands = (int*)((uintptr_t)buf - 0x30); 31 | int* number_of_new_commands = (int*)((uintptr_t)buf - 0x2C); 32 | int32_t new_commands = *number_of_new_commands; 33 | 34 | auto nextcmdnumber = g_pClientState->m_nLastOutgoingCommand + g_pClientState->m_nChokedCommands + 1; 35 | auto totalnewcommands = std::min(m_tickbase_shift, 62); 36 | m_tickbase_shift -= totalnewcommands; 37 | 38 | from = -1; 39 | *number_of_new_commands = totalnewcommands; 40 | *number_of_backup_commands = 0; 41 | 42 | for (to = nextcmdnumber - new_commands + 1; to <= nextcmdnumber; to++) { 43 | if (!orig_WriteUserCmdDeltaToBuffer(ecx_, edx_, nslot, buf, from, to, true)) 44 | return false; 45 | 46 | from = to; 47 | } 48 | 49 | auto lastrealcmd = g_pInput->GetUserCmd(nslot, from); 50 | CUserCmd fromcmd; 51 | 52 | if (lastrealcmd) 53 | fromcmd = *lastrealcmd; 54 | 55 | CUserCmd tocmd = fromcmd; 56 | tocmd.command_number = nextcmdnumber++; 57 | tocmd.tick_count += 100; 58 | 59 | for (int i = new_commands; i <= totalnewcommands; i++) { 60 | write_user_cmd(buf, &tocmd, &fromcmd); 61 | fromcmd = tocmd; 62 | tocmd.command_number++; 63 | tocmd.tick_count++; 64 | } 65 | 66 | return true; 67 | } -------------------------------------------------------------------------------- /internal_hvh/include_cheat.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "includes.h" 4 | 5 | #include "cthash.h" 6 | 7 | #include "misc/tinyformat.h" 8 | #include "misc/hybrid_hook.h" 9 | #include "singleton.h" 10 | #include "globals.h" 11 | 12 | #include "misc/util.h" 13 | #include "misc/offsets.h" 14 | #include "misc/init.h" 15 | #include "misc/math.h" 16 | 17 | #include "sdk/include_sdk.h" 18 | #include "misc/recv_prop_hook.h" 19 | #include "hooks/hooks.h" 20 | #include "features/include_features.h" 21 | #include "misc/listeners.h" 22 | #include "misc/d3dfont.h" 23 | #include "misc/render.h" 24 | #include "misc/dlight.h" 25 | 26 | #include "..//fatality_gui/menu/include_menu.h" -------------------------------------------------------------------------------- /internal_hvh/includes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #undef max 12 | template inline const T& max( const T& a, const T& b ) 13 | { 14 | return b < a ? a : b; 15 | } 16 | 17 | #undef min 18 | template inline const T& min( const T& a, const T& b ) 19 | { 20 | return b > a ? a : b; 21 | } 22 | 23 | #include 24 | #include 25 | #include "threadsafe_deque.h" 26 | 27 | #pragma comment(lib, "d3d9.lib") 28 | #pragma comment(lib, "d3dx9.lib") 29 | #pragma comment(lib, "winmm.lib") 30 | #pragma warning( disable : 4244 ) 31 | #pragma warning( disable : 4838 ) 32 | #pragma warning( disable : 4018 ) -------------------------------------------------------------------------------- /internal_hvh/internal_hvh.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | false 5 | 6 | -------------------------------------------------------------------------------- /internal_hvh/misc/d3dfont.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../includes.h" 4 | #include "../sdk/datatypes/Vector2D.h" 5 | 6 | #define SAFE_RELEASE(p) { if(p) { (p)->Release(); (p) = NULL; } } 7 | #define SAFE_DELETE(x) { if(x) delete x; x = NULL; } 8 | 9 | #define D3DFONT_ITALIC (1 << 0) 10 | #define D3DFONT_ZENABLE (1 << 1) 11 | #define D3DFVF_FONT2DVERTEX (D3DFVF_XYZRHW|D3DFVF_DIFFUSE|D3DFVF_TEX1) 12 | 13 | class c_font 14 | { 15 | struct font2dvertex 16 | { 17 | D3DXVECTOR4 p; 18 | uint32_t color; 19 | float tu, tv; 20 | }; 21 | 22 | static constexpr auto max_vertices = 50 * 6; 23 | static constexpr auto points = 64; 24 | 25 | std::vector lookup_table; 26 | void build_lookup_table(); 27 | 28 | std::string font; 29 | uint32_t height; 30 | uint32_t flags; 31 | uint32_t weight; 32 | uint32_t heighest_char; 33 | 34 | IDirect3DDevice9* dev; 35 | IDirect3DTexture9* texture; 36 | IDirect3DVertexBuffer9* vertex_buffer; 37 | uint32_t text_width; 38 | uint32_t text_height; 39 | float text_scale; 40 | std::vector> text_coords; 41 | uint32_t spacing; 42 | 43 | IDirect3DStateBlock9* saved; 44 | IDirect3DStateBlock9* draw; 45 | 46 | public: 47 | enum font_flags 48 | { 49 | centered_x = 1 << 0, 50 | centered_y = 1 << 1, 51 | twosided = 1 << 2, 52 | filtered = 1 << 3, 53 | drop_shadow = 1 << 4, 54 | left_aligned = 1 << 5, 55 | right_aligned = 1 << 6 56 | }; 57 | 58 | HRESULT draw_string( float x, float y, uint32_t color, const wchar_t* text, uint8_t flags = 0L ); 59 | HRESULT draw_radial( float x, float y, uint32_t color1, uint32_t color2, const wchar_t* text, uint8_t flags = 0L ); 60 | HRESULT get_text_extent( const wchar_t* text, SIZE* size ); 61 | 62 | HRESULT init_device_objects( IDirect3DDevice9* dev ); 63 | HRESULT restore_device_objects(); 64 | HRESULT invalidate_device_objects(); 65 | HRESULT delete_device_objects(); 66 | 67 | c_font(); 68 | c_font( std::string font, uint32_t height, uint32_t weight, uint32_t heighest_char = 0x80, uint32_t flags = 0 ); 69 | ~c_font(); 70 | 71 | float line_height; 72 | }; -------------------------------------------------------------------------------- /internal_hvh/misc/dlight.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../include_cheat.h" 3 | struct dlight_t 4 | { 5 | int flags; 6 | Vector origin; 7 | float radius; 8 | Color color; 9 | float die; 10 | float decay; 11 | float minlight; 12 | int key; 13 | int style; 14 | Vector m_Direction; 15 | float m_InnerAngle; 16 | float m_OuterAngle; 17 | float GetRadius() const 18 | { 19 | return radius; 20 | } 21 | float GetRadiusSquared() const 22 | { 23 | return radius * radius; 24 | } 25 | float IsRadiusGreaterThanZero() const 26 | { 27 | return radius > 0.0f; 28 | } 29 | }; 30 | 31 | class IVEffects 32 | { 33 | public: 34 | dlight_t* CL_AllocDlight(int key) 35 | { 36 | typedef dlight_t*(__thiscall* OriginalFn)(PVOID, int); 37 | return util::get_vfunc(this, 4)(this, key); 38 | } 39 | dlight_t* CL_AllocElight(int key) 40 | { 41 | typedef dlight_t*(__thiscall* OriginalFn)(PVOID, int); 42 | return util::get_vfunc(this, 5)(this, key); 43 | } 44 | dlight_t* GetElightByKey(int key) 45 | { 46 | typedef dlight_t*(__thiscall* OriginalFn)(PVOID, int); 47 | return util::get_vfunc(this, 8)(this, key); 48 | } 49 | }; 50 | 51 | extern IVEffects* g_pEffects; 52 | -------------------------------------------------------------------------------- /internal_hvh/misc/hybrid_hook.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | 6 | static std::unordered_map originals = {}; 7 | static std::once_flag initialzed = {}, destructed = {}; 8 | 9 | class c_vehhook 10 | { 11 | public: 12 | explicit c_vehhook( void* ent ) 13 | { 14 | vtable.reset( *reinterpret_cast< uint32_t** >( ent ) ); 15 | std::call_once( initialzed, []() -> void 16 | { 17 | AddVectoredExceptionHandler( 1, handler ); 18 | } ); 19 | } 20 | 21 | ~c_vehhook() 22 | { 23 | for ( const auto& org : vtable_overrides ) 24 | { 25 | for ( auto i = 0; vtable[ i ]; i++ ) 26 | { 27 | if ( vtable[ i ] == org ) 28 | { 29 | ++vtable[ i ]; 30 | break; 31 | } 32 | } 33 | 34 | originals.erase( org ); 35 | } 36 | 37 | vtable.release(); 38 | 39 | std::call_once( destructed, []() -> void 40 | { 41 | RemoveVectoredExceptionHandler( handler ); 42 | } ); 43 | } 44 | 45 | template 46 | orig apply( uint32_t index, hook func ) 47 | { 48 | const auto original = vtable[ index ]; 49 | const auto breakpoint = original - 1; 50 | 51 | vtable_overrides.push_back( breakpoint ); 52 | originals.insert_or_assign( breakpoint, reinterpret_cast< uint32_t >( func ) ); 53 | 54 | patch_pointer( &vtable[ index ], breakpoint ); 55 | return reinterpret_cast< orig >( original ); 56 | } 57 | private: 58 | static LONG WINAPI handler( EXCEPTION_POINTERS* info ) 59 | { 60 | switch ( info->ExceptionRecord->ExceptionCode ) 61 | { 62 | case EXCEPTION_BREAKPOINT: 63 | { 64 | const auto mapping = originals.find( info->ContextRecord->Eip ); 65 | if ( mapping != originals.end() ) 66 | { 67 | info->ContextRecord->Eip = mapping->second; 68 | return EXCEPTION_CONTINUE_EXECUTION; 69 | } 70 | } 71 | default: 72 | return EXCEPTION_CONTINUE_SEARCH; 73 | } 74 | } 75 | 76 | static void patch_pointer( uint32_t* original, uint32_t hook ) 77 | { 78 | DWORD old; 79 | VirtualProtect( original, sizeof uint32_t, PAGE_READWRITE, &old ); 80 | *original = hook; 81 | VirtualProtect( original, sizeof uint32_t, old, &old ); 82 | } 83 | 84 | std::unique_ptr vtable; 85 | std::vector vtable_overrides; 86 | }; 87 | 88 | class c_hook 89 | { 90 | public: 91 | explicit c_hook( void* ent ) 92 | { 93 | base = reinterpret_cast< uintptr_t** >( ent ); 94 | original = *base; 95 | 96 | const auto l = length(); 97 | current = std::make_unique( l + 1 ); 98 | std::memcpy( ¤t.get()[ 1 ], original, l * sizeof uint32_t ); 99 | current.get()[ 0 ] = static_cast< uintptr_t >( original[ -1 ] ); 100 | 101 | patch_pointer( current.get() ); 102 | } 103 | 104 | ~c_hook() 105 | { 106 | patch_pointer( original ); 107 | } 108 | 109 | template 110 | function apply( uint32_t index, original_function func ) 111 | { 112 | auto old = original[ index ]; 113 | current.get()[ index + 1 ] = reinterpret_cast< uintptr_t >( func ); 114 | return reinterpret_cast< function >( old ); 115 | } 116 | private: 117 | uint32_t length() const 118 | { 119 | uint32_t index = 0; 120 | const auto vmt = original; 121 | 122 | for ( index = 0; vmt[ index ]; index++ ) 123 | if ( IS_INTRESOURCE( vmt[ index ] ) ) 124 | break; 125 | 126 | return index; 127 | } 128 | 129 | void patch_pointer( uintptr_t* replacement ) const 130 | { 131 | if ( !base ) 132 | return; 133 | 134 | DWORD old; 135 | VirtualProtect( base, sizeof uintptr_t, PAGE_READWRITE, &old ); 136 | replacement == original ? *base = replacement : *base = &replacement[ 1 ]; 137 | VirtualProtect( base, sizeof uintptr_t, old, &old ); 138 | } 139 | 140 | std::uintptr_t** base; 141 | std::uintptr_t* original; 142 | std::unique_ptr current; 143 | }; 144 | 145 | class c_bphook 146 | { 147 | public: 148 | explicit c_bphook( void* ent ) 149 | { 150 | base = reinterpret_cast< uintptr_t** >( ent ); 151 | } 152 | 153 | template 154 | function apply( uint32_t index, original_function func ) 155 | { 156 | auto old_func = base[ index ]; 157 | DWORD old; 158 | VirtualProtect( &base[ index ], sizeof uintptr_t, PAGE_EXECUTE_READWRITE, &old ); 159 | base[ index ] = reinterpret_cast< uintptr_t* >( func ); 160 | VirtualProtect( &base[ index ], sizeof uintptr_t, old, &old ); 161 | return reinterpret_cast< function >( old_func ); 162 | } 163 | private: 164 | 165 | std::uintptr_t** base; 166 | }; -------------------------------------------------------------------------------- /internal_hvh/misc/init.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace init 4 | { 5 | void on_startup(); 6 | void get_offsets(); 7 | void get_interfaces(); 8 | void get_materials(); 9 | void hooks(); 10 | void reset_hooks(); 11 | 12 | extern HWND window; 13 | } -------------------------------------------------------------------------------- /internal_hvh/misc/listeners.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | void listeners::event_listeners::FireGameEvent( IGameEvent * game_event ) 4 | { 5 | console_log::get().listener( game_event ); 6 | 7 | _( player_hurt, "player_hurt" ); 8 | _( bullet_impact, "bullet_impact" ); 9 | _( weapon_fire, "weapon_fire" ); 10 | if ( !strcmp( game_event->GetName(), player_hurt ) ) 11 | { 12 | hitmarker::get().listener( game_event ); 13 | //hitmarker::get().hit_effect( game_event ); 14 | resolver::get().hurt_listener( game_event ); 15 | } 16 | else if ( !strcmp( game_event->GetName(), bullet_impact ) ) 17 | { 18 | resolver::get().listener( game_event ); 19 | beams::get().listener( game_event ); 20 | } 21 | else if ( !strcmp( game_event->GetName(), weapon_fire ) ) 22 | { 23 | resolver::get().listener( game_event ); 24 | } 25 | }; 26 | -------------------------------------------------------------------------------- /internal_hvh/misc/listeners.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class IGameEvent; 4 | class listeners : public singleton 5 | { 6 | public: 7 | void setup_listeners() { if ( !event_listener ) { event_listener = new event_listeners(); } } 8 | void remove_listeners() const { delete event_listener; } 9 | private: 10 | class event_listeners : public IGameEventListener2 11 | { 12 | public: 13 | event_listeners() 14 | { 15 | _( player_hurt, "player_hurt" ); 16 | g_pGameEventManager->AddListener( this, player_hurt, false ); 17 | _( bullet_impact, "bullet_impact" ); 18 | g_pGameEventManager->AddListener( this, bullet_impact, false ); 19 | _( item_purchase, "item_purchase" ); 20 | g_pGameEventManager->AddListener( this, item_purchase, false ); 21 | _( weapon_fire, "weapon_fire" ); 22 | g_pGameEventManager->AddListener( this, weapon_fire, false ); 23 | }; 24 | ~event_listeners() { g_pGameEventManager->RemoveListener( this ); }; 25 | virtual void FireGameEvent( IGameEvent* p_event ); 26 | int GetEventDebugID() override { return 0x2A; }; 27 | private: 28 | }; 29 | public: 30 | event_listeners * event_listener = nullptr; 31 | }; 32 | 33 | -------------------------------------------------------------------------------- /internal_hvh/misc/netvars.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | CNetVars::CNetVars() 4 | { 5 | for ( auto clazz = g_pClient->GetAllClasses(); clazz; clazz = clazz->m_pNext ) 6 | if ( clazz->m_pRecvTable ) 7 | dump_recursive( clazz->m_pNetworkName, clazz->m_pRecvTable, 0 ); 8 | } 9 | //=============================================== 10 | void CNetVars::dump_recursive( const char* base_class, RecvTable* table, uint16_t offset ) 11 | { 12 | for ( auto i = 0; i < table->m_nProps; ++i ) 13 | { 14 | auto prop_ptr = &table->m_pProps[ i ]; 15 | 16 | //Skip trash array items 17 | if ( !prop_ptr || isdigit( prop_ptr->m_pVarName[ 0 ] ) ) 18 | continue; 19 | 20 | //We dont care about the base class, we already know that 21 | _( baseclass, "baseclass" ); 22 | if ( strcmp( prop_ptr->m_pVarName, baseclass ) == 0 ) 23 | continue; 24 | 25 | if ( prop_ptr->m_RecvType == DPT_DataTable && 26 | prop_ptr->m_pDataTable != nullptr && 27 | prop_ptr->m_pDataTable->m_pNetTableName[ 0 ] == 'D' ) // Skip shitty tables 28 | { 29 | dump_recursive( base_class, prop_ptr->m_pDataTable, offset + prop_ptr->m_Offset ); 30 | } 31 | 32 | char hash_name[ 256 ]; 33 | 34 | _( arr, "->" ); 35 | strcpy_s( hash_name, base_class ); 36 | strcat_s( hash_name, arr ); 37 | strcat_s( hash_name, prop_ptr->m_pVarName ); 38 | 39 | // Need to cast it to prevent FnvHash using the recursive hasher 40 | // which would hash all 256 bytes 41 | auto hash = FnvHash( static_cast( hash_name ) ); 42 | 43 | m_props[ hash ] = { prop_ptr, uint16_t( offset + prop_ptr->m_Offset ) }; 44 | } 45 | } -------------------------------------------------------------------------------- /internal_hvh/misc/offsets.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | uintptr_t offsets::local_player = 0; 4 | uintptr_t offsets::move_helper = 0; 5 | uintptr_t offsets::pred_random_seed = 0; 6 | uintptr_t offsets::pred_player = 0; 7 | uintptr_t offsets::set_abs_angles = 0; 8 | uintptr_t offsets::view_render = 0; 9 | uintptr_t offsets::view_render_bms = 0; 10 | uintptr_t offsets::hbp = 0; 11 | uintptr_t offsets::clip_trace_to_players = 0; 12 | uintptr_t offsets::create_anim_state = 0; 13 | uintptr_t offsets::update_anim_state = 0; 14 | uintptr_t offsets::cam_think = 0; 15 | uintptr_t offsets::set_abs_origin = 0; 16 | uintptr_t offsets::standard_blending_rules = 0; 17 | uintptr_t offsets::build_transformations = 0; 18 | uintptr_t offsets::device = 0; 19 | uintptr_t offsets::glow_obj_manager = 0; 20 | uintptr_t offsets::smoke_count = 0; 21 | uintptr_t offsets::get_weapon_name = 0; 22 | uintptr_t offsets::get_sequence_act = 0; 23 | uintptr_t offsets::current_command = 0; 24 | uintptr_t offsets::enable_invalidate_bone_cache = 0; 25 | uintptr_t offsets::invalidate_physics_recursive = 0; 26 | uintptr_t offsets::is_breakable_entity = 0; 27 | uintptr_t offsets::fire_bullets = 0; 28 | uintptr_t offsets::ccsplayer_vtable = 0; 29 | uintptr_t offsets::cbaseplayeranimstate_vtable = 0; 30 | uintptr_t offsets::netchan_vtable = 0; 31 | uintptr_t offsets::print_dev_console = 0; 32 | uintptr_t offsets::find_element = 0; -------------------------------------------------------------------------------- /internal_hvh/misc/offsets.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace offsets 4 | { 5 | extern uintptr_t local_player; 6 | extern uintptr_t move_helper; 7 | extern uintptr_t pred_random_seed; 8 | extern uintptr_t pred_player; 9 | extern uintptr_t set_abs_angles; 10 | extern uintptr_t view_render; 11 | extern uintptr_t view_render_bms; 12 | extern uintptr_t hbp; 13 | extern uintptr_t clip_trace_to_players; 14 | extern uintptr_t create_anim_state; 15 | extern uintptr_t update_anim_state; 16 | extern uintptr_t cam_think; 17 | extern uintptr_t set_abs_origin; 18 | extern uintptr_t standard_blending_rules; 19 | extern uintptr_t build_transformations; 20 | extern uintptr_t do_extra_bone_processing; 21 | extern uintptr_t device; 22 | extern uintptr_t glow_obj_manager; 23 | extern uintptr_t smoke_count; 24 | extern uintptr_t get_weapon_name; 25 | extern uintptr_t get_sequence_act; 26 | extern uintptr_t current_command; 27 | extern uintptr_t enable_invalidate_bone_cache; 28 | extern uintptr_t invalidate_physics_recursive; 29 | extern uintptr_t is_breakable_entity; 30 | extern uintptr_t fire_bullets; 31 | extern uintptr_t ccsplayer_vtable; 32 | extern uintptr_t cbaseplayeranimstate_vtable; 33 | extern uintptr_t netchan_vtable; 34 | extern uintptr_t print_dev_console; 35 | extern uintptr_t find_element; 36 | } -------------------------------------------------------------------------------- /internal_hvh/misc/recv_prop_hook.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class recv_prop_hook 4 | { 5 | public: 6 | recv_prop_hook( RecvProp* prop ) 7 | { 8 | ZeroMemory( this, sizeof( recv_prop_hook ) ); 9 | m_property = prop; 10 | } 11 | ~recv_prop_hook() 12 | { 13 | m_property->m_ProxyFn = m_original_proxy_fn; 14 | } 15 | 16 | RecvVarProxyFn hook_prop( const RecvVarProxyFn proxy_fn ) 17 | { 18 | m_original_proxy_fn = m_property->m_ProxyFn; 19 | set_proxy_func( proxy_fn ); 20 | return m_original_proxy_fn; 21 | } 22 | 23 | RecvVarProxyFn get_orig() const 24 | { 25 | return m_original_proxy_fn; 26 | } 27 | 28 | void set_proxy_func( const RecvVarProxyFn proxy_fn ) const 29 | { 30 | m_property->m_ProxyFn = proxy_fn; 31 | } 32 | 33 | private: 34 | RecvProp * m_property = nullptr; 35 | RecvVarProxyFn m_original_proxy_fn = nullptr; 36 | }; 37 | -------------------------------------------------------------------------------- /internal_hvh/misc/util.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CEconItem; 4 | namespace util 5 | { 6 | uintptr_t get_sig( std::string module_name, std::string pattern ); 7 | HMODULE get_module( const std::string& szmodule ); 8 | float get_hue( D3DCOLOR col ); 9 | float get_saturation( D3DCOLOR col ); 10 | float get_brightness( D3DCOLOR col ); 11 | float get_fraction( float val, float min, float max ); 12 | D3DCOLOR hsb_to_rgb( float hue, float saturation, float brightness, int alpha = 255 ); 13 | Color hsb_to_rgbcol( float _h, float s, float b, int alpha = 255 ); 14 | void print_dev_console( bool printincon, const Color & color, const char * format, ... ); 15 | template T get_vfunc( void *v_table, const int i_index ) { return ( *static_cast< T** >( v_table ) )[ i_index ]; } 16 | template T* get_interface( const HMODULE module, std::string szinterface ) 17 | { 18 | using create_interface_fn = T * ( *)( const char* szname, int ret ); 19 | _( CreateInterface, "CreateInterface" ); 20 | const create_interface_fn create_interface = reinterpret_cast< create_interface_fn >( GetProcAddress( module, CreateInterface ) ); 21 | 22 | return create_interface( szinterface.c_str(), 0 ); 23 | } 24 | inline uint8_t* find_sig_ext( uint32_t offset, const char* signature, uint32_t range = 0u ) 25 | { 26 | static auto pattern_to_bytes = []( const char* pattern ) -> std::vector 27 | { 28 | auto bytes = std::vector{}; 29 | auto start = const_cast< char* >( pattern ); 30 | auto end = const_cast< char* >( pattern ) + strlen( pattern ); 31 | 32 | for ( auto current = start; current < end; ++current ) 33 | { 34 | if ( *current == '?' ) 35 | { 36 | current++; 37 | 38 | if ( *current == '?' ) 39 | current++; 40 | 41 | bytes.push_back( -1 ); 42 | } 43 | else 44 | bytes.push_back( static_cast< int32_t >( strtoul( current, ¤t, 0x10 ) ) ); 45 | } 46 | 47 | return bytes; 48 | }; 49 | 50 | const auto scan_bytes = reinterpret_cast< std::uint8_t* >( offset ); 51 | auto pattern_bytes = pattern_to_bytes( signature ); 52 | const auto s = pattern_bytes.size(); 53 | const auto d = pattern_bytes.data(); 54 | 55 | for ( auto i = 0ul; i < range - s; ++i ) 56 | { 57 | auto found = true; 58 | 59 | for ( auto j = 0ul; j < s; ++j ) 60 | if ( scan_bytes[ i + j ] != d[ j ] && d[ j ] != -1 ) 61 | { 62 | found = false; 63 | break; 64 | } 65 | 66 | if ( found ) 67 | return &scan_bytes[ i ]; 68 | } 69 | 70 | return nullptr; 71 | } 72 | 73 | CEconItem* CreateEconItem(); 74 | uintptr_t GetItemSchema(); 75 | void DestroyEconItem( CEconItem* item ); 76 | } 77 | 78 | #define MEMEBR_FUNC_ARGS(...) ( this, __VA_ARGS__ ); } 79 | #define FUNCARGS(...) ( __VA_ARGS__ ); } 80 | #define VFUNC( index, func, sig ) auto func { return util::get_vfunc< sig >( this, index ) MEMEBR_FUNC_ARGS 81 | #define MFUNC(func, sig, offset) auto func { return reinterpret_cast< sig >( offset ) MEMEBR_FUNC_ARGS 82 | #define FUNC(func, sig, offset) auto func { return reinterpret_cast< sig >( offset ) FUNCARGS 83 | 84 | __forceinline void erase_function( uint8_t* function ) 85 | { 86 | if ( *function == 0xE9 ) 87 | { 88 | auto pdFollow = ( PDWORD )( function + 1 ); 89 | function = ( ( PBYTE )( *pdFollow + ( DWORD )function + 5 ) ); 90 | } 91 | else if ( *function == 0xEB ) 92 | { 93 | auto pbFollow = ( PDWORD )( function + 1 ); 94 | function = ( ( PBYTE )( ( DWORD )*pbFollow + ( DWORD )function + 2 ) ); 95 | } 96 | 97 | 98 | static const auto current_process = reinterpret_cast< HANDLE >( -1 ); 99 | 100 | _( fn_end, "90 90 90 90 90" ); 101 | const auto end = util::find_sig_ext( reinterpret_cast< uint32_t >( function ), fn_end, 0x2000 ); 102 | size_t bytes = reinterpret_cast< DWORD >( end ) - reinterpret_cast< DWORD >( function ) + 6; 103 | 104 | void* fn = function; 105 | size_t size = bytes; 106 | DWORD old; 107 | VirtualProtect( fn, size, PAGE_EXECUTE_READWRITE, &old ); 108 | fn = function; 109 | size = bytes; 110 | memset( fn, 0, size ); 111 | VirtualProtect( fn, size, old, &old ); 112 | } 113 | 114 | // NOLINTNEXTLINE 115 | #define erase_fn(a) constexpr auto concat(w, __LINE__) = &a;\ 116 | erase_function(reinterpret_cast((void*&)concat(w, __LINE__))) 117 | #define erase_end __asm _emit 0x90 __asm _emit 0x90 __asm _emit 0x90 __asm _emit 0x90 __asm _emit 0x90 -------------------------------------------------------------------------------- /internal_hvh/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by internal_hvh.rc 4 | // 5 | #define IDR_BINARY1 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /internal_hvh/sdk/CBoneChache.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CBoneCache 4 | { 5 | public: 6 | matrix3x4_t* m_pCachedBones; 7 | char pad[ 8 ]; 8 | unsigned int m_CachedBoneCount; 9 | }; -------------------------------------------------------------------------------- /internal_hvh/sdk/CCSGOPlayerAnimState.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CCSGOPlayerAnimState 4 | { 5 | public: 6 | MFUNC( update( QAngle ang ), void( __vectorcall* )( void*, void*, float, float, float, void* ), offsets::update_anim_state )( nullptr, 0, ang.y, ang.x, nullptr ); 7 | char pad[ 3 ]; 8 | char bUnknown; //0x4 9 | char pad2[ 91 ]; 10 | C_BasePlayer* pBasePlayer; //0x60 11 | C_BaseCombatWeapon* pActiveWeapon; //0x64 12 | C_BaseCombatWeapon* pLastActiveWeapon; //0x68 13 | float m_flLastClientSideAnimationUpdateTime; //0x6C 14 | int m_iLastClientSideAnimationUpdateFramecount; //0x70 15 | float m_flEyePitch; //0x74 16 | float m_flEyeYaw; //0x78 17 | float m_flPitch; //0x7C 18 | float m_flGoalFeetYaw; //0x80 19 | float m_flCurrentFeetYaw; //0x84 20 | float m_flCurrentTorsoYaw; //0x88 21 | float m_flUnknownVelocityLean; //0x8C //changes when moving/jumping/hitting ground 22 | float m_flLeanAmount; //0x90 23 | char pad4[ 4 ]; //NaN 24 | float m_flFeetCycle; //0x98 0 to 1 25 | float m_flFeetYawRate; //0x9C 0 to 1 26 | float m_fUnknown2; 27 | float m_fDuckAmount; //0xA4 28 | float m_fLandingDuckAdditiveSomething; //0xA8 29 | float m_fUnknown3; //0xAC 30 | Vector m_in; //0xB0, 0xB4, 0xB8 31 | Vector m_vLastOrigin; //0xBC, 0xC0, 0xC4 32 | float m_vVelocityX; //0xC8 33 | float m_vVelocityY; //0xCC 34 | char pad5[ 4 ]; 35 | float m_flUnknownFloat1; //0xD4 Affected by movement and direction 36 | char pad6[ 8 ]; 37 | float m_flUnknownFloat2; //0xE0 //from -1 to 1 when moving and affected by direction 38 | float m_flUnknownFloat3; //0xE4 //from -1 to 1 when moving and affected by direction 39 | float m_unknown; //0xE8 40 | float m_velocity; //0xEC 41 | float flUpVelocity; //0xF0 42 | float m_flSpeedNormalized; //0xF4 //from 0 to 1 43 | float m_flFeetSpeedForwardsOrSideWays; //0xF8 //from 0 to 2. something is 1 when walking, 2.something when running, 0.653 when crouch walking 44 | float m_flFeetSpeedUnknownForwardOrSideways; //0xFC //from 0 to 3. something 45 | float m_flTimeSinceStartedMoving; //0x100 46 | float m_flTimeSinceStoppedMoving; //0x104 47 | bool m_bOnGround; //0x108 48 | //unsigned char m_bOnGround; //0x108 49 | unsigned char m_bInHitGroundAnimation; //0x109 50 | char pad7[ 6 ]; 51 | int m_nLastAnimTick; 52 | float m_flLastOriginZ; //0x114 53 | float m_flHeadHeightOrOffsetFromHittingGroundAnimation; //0x118 from 0 to 1, is 1 when standing 54 | float m_flStopToFullRunningFraction; //0x11C from 0 to 1, doesnt change when walking or crouching, only running 55 | char pad8[ 4 ]; //NaN 56 | float m_flUnknownFraction; //0x124 affected while jumping and running, or when just jumping, 0 to 1 57 | char pad9[ 4 ]; //NaN 58 | float m_flUnknown3; 59 | char pad10[ 532 ]; 60 | }; -------------------------------------------------------------------------------- /internal_hvh/sdk/CCSGameRulesProxy.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class C_CSGameRulesProxy 4 | { 5 | public: 6 | OFFSET( m_bFreezePeriod, bool, 0x20 ) 7 | OFFSET( m_bIsValveDS, bool, 0x75 ) 8 | OFFSET( m_bBombPlanted, bool, 0x99D ) 9 | OFFSET( m_bBombDropped, bool, 0x8D0 ) //0x99D 10 | }; -------------------------------------------------------------------------------- /internal_hvh/sdk/CEconItem.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | #include 3 | #include 4 | 5 | uint32_t* CEconItem::GetAccountID() 6 | { 7 | return reinterpret_cast< uint32_t* >( this + 0x1C ); 8 | } 9 | uint64_t* CEconItem::GetItemID() 10 | { 11 | return reinterpret_cast< uint64_t* >( this + 0x8 ); 12 | } 13 | 14 | uint64_t* CEconItem::GetOriginalID() 15 | { 16 | return reinterpret_cast< uint64_t* >( this + 0x10 ); 17 | } 18 | 19 | uint16_t* CEconItem::GetDefIndex() 20 | { 21 | return reinterpret_cast< uint16_t* >( this + 0x24 ); 22 | } 23 | 24 | uint32_t* CEconItem::GetInventory() 25 | { 26 | return reinterpret_cast< uint32_t* >( this + 0x20 ); 27 | } 28 | 29 | unsigned char* CEconItem::GetFlags() 30 | { 31 | return reinterpret_cast< unsigned char* >( this + 0x30 ); 32 | } 33 | 34 | unsigned short* CEconItem::GetEconItemData() 35 | { 36 | return reinterpret_cast< unsigned short* >( this + 0x26 ); 37 | } 38 | 39 | void CEconItem::UpdateEquippedState( unsigned int state ) 40 | { 41 | static auto fnUpdateEquippedState = reinterpret_cast< int( __thiscall* )( CEconItem*, unsigned int ) >( sig( "client.dll", "55 8B EC 8B 45 08 8B D0 C1 EA 10" ) ); 42 | 43 | fnUpdateEquippedState( this, state ); 44 | } 45 | 46 | std::array CEconItem::GetEquippedState() 47 | { 48 | auto eq_st = *reinterpret_cast< uintptr_t* >( ( uintptr_t )this + 0x18 ); 49 | std::array EquippedState{ 0,0 }; 50 | 51 | if ( eq_st ) 52 | { 53 | if ( ( **( BYTE** )( ( uintptr_t )this + 0x18 ) & 0x3F ) != 63 ) 54 | { 55 | auto v31 = **( WORD** )( ( uintptr_t )this + 0x18 ); 56 | unsigned short v32 = ( v31 >> 6 ) & 7; //2 57 | unsigned short v33 = v31 & 0x3F; //3 58 | 59 | unsigned int final = ( ( v33 << 16 ) | ( v32 ) ); 60 | 61 | EquippedState[ 0 ] = final; 62 | 63 | if ( **( WORD ** )( ( uintptr_t )this + 24 ) & 0x200 && ( **( WORD ** )( ( uintptr_t )this + 24 ) & 0x1C0 ) == 128 ) 64 | { 65 | unsigned short v1 = 3; 66 | unsigned short v2 = v31 & 0x3F; //3 67 | 68 | unsigned int final2 = ( ( v2 << 16 ) | ( v1 ) ); 69 | 70 | EquippedState[ 1 ] = final2; 71 | } 72 | } 73 | } 74 | 75 | return EquippedState; 76 | } 77 | 78 | void CEconItem::AddSticker( int index, int kit, float wear, float scale, float rotation ) 79 | { 80 | SetAttributeValue( 113 + 4 * index, kit ); 81 | SetAttributeValue( 114 + 4 * index, wear ); 82 | SetAttributeValue( 115 + 4 * index, scale ); 83 | SetAttributeValue( 116 + 4 * index, rotation ); 84 | } 85 | 86 | void CEconItem::SetStatTrak( int val ) 87 | { 88 | SetAttributeValue( 80, val ); 89 | SetAttributeValue( 81, 0 ); 90 | SetQuality( ITEM_QUALITY_STRANGE ); 91 | } 92 | 93 | void CEconItem::SetPaintKit( float kit ) 94 | { 95 | SetAttributeValue( 6, kit ); 96 | } 97 | 98 | void CEconItem::SetPaintSeed( float seed ) 99 | { 100 | SetAttributeValue( 7, seed ); 101 | } 102 | 103 | void CEconItem::SetPaintWear( float wear ) 104 | { 105 | SetAttributeValue( 8, wear ); 106 | } 107 | 108 | void CEconItem::SetQuality( ItemQuality quality ) 109 | { 110 | auto data = *GetEconItemData(); 111 | *GetEconItemData() = data ^ ( data ^ 32 * quality ) & 0x1E0; 112 | } 113 | 114 | void CEconItem::SetRarity( ItemRarity rarity ) 115 | { 116 | auto data = *GetEconItemData(); 117 | *GetEconItemData() = ( data ^ ( rarity << 11 ) ) & 0x7800 ^ data; 118 | } 119 | 120 | void CEconItem::SetOrigin( int origin ) 121 | { 122 | auto data = *GetEconItemData(); 123 | *GetEconItemData() = data ^ ( ( unsigned __int8 )data ^ ( unsigned __int8 )origin ) & 0x1F; 124 | } 125 | 126 | void CEconItem::SetLevel( int level ) 127 | { 128 | auto data = *GetEconItemData(); 129 | *GetEconItemData() = data ^ ( data ^ ( level << 9 ) ) & 0x600; 130 | } 131 | 132 | void CEconItem::SetInUse( bool in_use ) 133 | { 134 | auto data = *GetEconItemData(); 135 | *GetEconItemData() = data & 0x7FFF | ( in_use << 15 ); 136 | } 137 | 138 | void CEconItem::SetCustomName( const char* name ) 139 | { 140 | static auto Address = sig( "client.dll", "E8 ? ? ? ? 8B 46 78 C1 E8 0A A8 01 74 13 8B 46 34" ); 141 | static auto fnSetCustomName = reinterpret_cast< CEconItem*( __thiscall* )( void*, const char* ) >( *reinterpret_cast< uintptr_t* >( Address + 1 ) + Address + 5 ); 142 | 143 | fnSetCustomName( this, name ); 144 | } 145 | 146 | void CEconItem::SetCustomDesc( const char* name ) 147 | { 148 | static auto Address = sig("client.dll", "E8 ? ? ? ? 33 DB 39 5E 3C 7E 5E" ); 149 | static auto fnSetCustomDesc = reinterpret_cast< CEconItem*( __thiscall* )( void*, const char* ) >( *reinterpret_cast< uintptr_t* >( Address + 1 ) + Address + 5 ); 150 | 151 | fnSetCustomDesc( this, name ); 152 | } 153 | -------------------------------------------------------------------------------- /internal_hvh/sdk/CEconItem.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum ItemQuality 4 | { 5 | ITEM_QUALITY_DEFAULT, 6 | ITEM_QUALITY_GENUINE, 7 | ITEM_QUALITY_VINTAGE, 8 | ITEM_QUALITY_UNUSUAL, 9 | ITEM_QUALITY_SKIN, 10 | ITEM_QUALITY_COMMUNITY, 11 | ITEM_QUALITY_DEVELOPER, 12 | ITEM_QUALITY_SELFMADE, 13 | ITEM_QUALITY_CUSTOMIZED, 14 | ITEM_QUALITY_STRANGE, 15 | ITEM_QUALITY_COMPLETED, 16 | ITEM_QUALITY_UNK2, 17 | ITEM_QUALITY_TOURNAMENT 18 | }; 19 | 20 | enum ItemRarity 21 | { 22 | ITEM_RARITY_DEFAULT, 23 | ITEM_RARITY_COMMON, 24 | ITEM_RARITY_UNCOMMON, 25 | ITEM_RARITY_RARE, 26 | ITEM_RARITY_MYTHICAL, 27 | ITEM_RARITY_LEGENDARY, 28 | ITEM_RARITY_ANCIENT, 29 | ITEM_RARITY_IMMORTAL 30 | }; 31 | 32 | class CEconItem 33 | { 34 | unsigned short* GetEconItemData(); 35 | public: 36 | uint32_t * GetInventory(); 37 | uint32_t * GetAccountID(); 38 | uint16_t* GetDefIndex(); 39 | uint64_t* GetItemID(); 40 | uint64_t* GetOriginalID(); 41 | unsigned char* GetFlags(); 42 | void SetQuality( ItemQuality quality ); 43 | void SetRarity( ItemRarity rarity ); 44 | void SetOrigin( int origin ); 45 | void SetLevel( int level ); 46 | void SetInUse( bool in_use ); 47 | void SetCustomName( const char* name ); 48 | void SetCustomDesc( const char* name ); 49 | void SetPaintSeed( float seed ); 50 | void SetPaintKit( float kit ); 51 | void SetPaintWear( float wear ); 52 | void SetStatTrak( int val ); 53 | void AddSticker( int index, int kit, float wear, float scale, float rotation ); 54 | void UpdateEquippedState( unsigned int state ); 55 | std::array GetEquippedState(); 56 | 57 | template 58 | void SetAttributeValue( int index, TYPE val ) 59 | { 60 | auto v15 = reinterpret_cast< DWORD* >( util::GetItemSchema() ); 61 | auto v16 = *reinterpret_cast< DWORD * >( v15[ 72 ] + 4 * index ); 62 | 63 | static auto fnSetDynamicAttributeValue = reinterpret_cast< int( __thiscall* )( CEconItem*, DWORD, void* ) >( sig( "client.dll", "55 8B EC 83 E4 F8 83 EC 3C 53 8B 5D 08 56 57 6A 00" ) ); 64 | 65 | fnSetDynamicAttributeValue( this, v16, &val ); 66 | } 67 | }; -------------------------------------------------------------------------------- /internal_hvh/sdk/CNetChannel.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | typedef enum 4 | { 5 | NA_NULL = 0, 6 | NA_LOOPBACK, 7 | NA_BROADCAST, 8 | NA_IP, 9 | } netadrtype_t; 10 | 11 | struct netadr_t 12 | { 13 | netadrtype_t type; 14 | unsigned char ip[ 4 ]; 15 | unsigned short port; 16 | }; 17 | 18 | class bf_read 19 | { 20 | public: 21 | uintptr_t base_address; 22 | uintptr_t cur_offset; 23 | 24 | bf_read( uintptr_t addr ) 25 | { 26 | base_address = addr; 27 | cur_offset = 0; 28 | } 29 | 30 | void SetOffset( uintptr_t offset ) 31 | { 32 | cur_offset = offset; 33 | } 34 | 35 | void Skip( uintptr_t length ) 36 | { 37 | cur_offset += length; 38 | } 39 | 40 | int ReadByte() 41 | { 42 | auto val = *reinterpret_cast( base_address + cur_offset ); 43 | ++cur_offset; 44 | return val; 45 | } 46 | 47 | long ReadLong() 48 | { 49 | auto val = *reinterpret_cast( base_address + cur_offset ); 50 | ++cur_offset; 51 | return val; 52 | } 53 | 54 | bool ReadBool() 55 | { 56 | auto val = *reinterpret_cast( base_address + cur_offset ); 57 | ++cur_offset; 58 | return val; 59 | } 60 | 61 | std::string ReadString() 62 | { 63 | char buffer[ 256 ]; 64 | auto str_length = *reinterpret_cast( base_address + cur_offset ); 65 | ++cur_offset; 66 | memcpy( buffer, reinterpret_cast( base_address + cur_offset ), str_length > 255 ? 255 : str_length ); 67 | buffer[ str_length > 255 ? 255 : str_length ] = '\0'; 68 | cur_offset += str_length + 1; 69 | return std::string( buffer ); 70 | } 71 | }; 72 | 73 | typedef struct netpacket_s netpacket_t; 74 | 75 | typedef struct netpacket_s 76 | { 77 | netadr_t from; // sender IP 78 | int source; // received source 79 | double received; // received time 80 | unsigned char *data; // pointer to raw packet data 81 | bf_read message; // easy bitbuf data access 82 | int size; // size in bytes 83 | int wiresize; // size in bytes before decompression 84 | bool stream; // was send as stream 85 | struct netpacket_s *pNext; // for internal use, should be NULL in public 86 | } netpacket_t; 87 | 88 | class CNetChannel 89 | { 90 | public: 91 | char pad_0x0000[ 0x18 ]; //0x0000 92 | __int32 m_nOutSequenceNr; //0x0018 93 | __int32 m_nInSequenceNr; //0x001C 94 | __int32 m_nOutSequenceNrAck; //0x0020 95 | __int32 m_nOutReliableState; //0x0024 96 | __int32 m_nInReliableState; //0x0028 97 | __int32 m_nChokedPackets; //0x002C 98 | 99 | VFUNC( 40, SendNetMsg( void* msg, bool bForceReliable = false, bool bVoice = false ), bool( __thiscall* )( void*, void*, bool, bool ) )( msg, bForceReliable, bVoice ) 100 | VFUNC( 49, Transmit( bool onlyreliable = false ), bool( __thiscall* )( void*, bool ) )( onlyreliable ) 101 | };//Size=0x4294 -------------------------------------------------------------------------------- /internal_hvh/sdk/CPlayerInventory.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | void CPlayerInventory::RemoveItem( uint64_t ID ) 4 | { 5 | static auto fnRemoveItem = reinterpret_cast< int( __thiscall* )( void*, int64_t ) >( sig( "client.dll", "55 8B EC 83 E4 F8 56 57 FF 75 0C 8B F1" ) ); 6 | 7 | fnRemoveItem( this, ID ); 8 | } 9 | 10 | void CPlayerInventory::RemoveItem( CEconItem* item ) 11 | { 12 | RemoveItem( *item->GetItemID() ); 13 | GetBaseTypeCache()->RemoveObject( item ); 14 | util::DestroyEconItem( item ); 15 | } 16 | 17 | void CPlayerInventory::ClearInventory() 18 | { 19 | auto BaseTypeCache = this->GetBaseTypeCache(); 20 | auto items = BaseTypeCache->GetEconItems(); 21 | for ( auto item : items ) 22 | { 23 | RemoveItem( *item->GetItemID() ); 24 | BaseTypeCache->RemoveObject( item ); 25 | } 26 | } 27 | 28 | CSharedObjectTypeCache* CPlayerInventory::GetBaseTypeCache() 29 | { 30 | static auto fnGCSDK_CGCClient_FindSOCache = reinterpret_cast< uintptr_t( __thiscall* )( uintptr_t, uint64_t, uint64_t, bool ) >( sig( "client.dll", "55 8B EC 83 E4 F8 83 EC 1C 0F 10 45 08" ) ); 31 | static auto fnGCSDK_CSharedObjectCache_CreateBaseTypeCache = reinterpret_cast< CSharedObjectTypeCache*( __thiscall* )( uintptr_t, int ) >( sig( "client.dll", "55 8B EC 51 53 56 8B D9 8D 45 08" ) ); 32 | 33 | auto SOCahce = fnGCSDK_CGCClient_FindSOCache( g_GCClientSystem + 0x60, *reinterpret_cast< uint64_t* >( this + 0x8 ), *reinterpret_cast< uint64_t* >( this + 0x10 ), 0 ); 34 | 35 | return fnGCSDK_CSharedObjectCache_CreateBaseTypeCache( SOCahce, 1 ); 36 | } 37 | 38 | uint32_t CPlayerInventory::GetSteamID() 39 | { 40 | return *reinterpret_cast< uint32_t* >( this + 0x8 ); 41 | } 42 | 43 | CUtlVector< C_EconItemView* >* CPlayerInventory::GetInventoryItems() 44 | { 45 | return reinterpret_cast< CUtlVector* >( this + 0x2C ); 46 | } 47 | 48 | C_EconItemView* CPlayerInventory::GetInventoryItemByItemID( int64_t id ) 49 | { 50 | static auto fnGetInventoryItemByItemID = reinterpret_cast< C_EconItemView*( __thiscall* )( void*, int64_t ) >( sig( "client.dll", "55 8B EC 8B 55 08 83 EC 10 8B C2" ) ); 51 | 52 | auto econ = fnGetInventoryItemByItemID( this, id ); 53 | 54 | if ( !econ || !*( BYTE* )( ( uintptr_t )econ + 0x204 ) ) 55 | return g_pCSInventoryManager->FindOrCreateReferenceEconItem( id ); 56 | else 57 | return econ; 58 | } 59 | 60 | bool CPlayerInventory::AddEconItem( CEconItem* item, int a3, int a4, char a5 ) 61 | { 62 | static auto fnAddEconItem = reinterpret_cast< C_EconItemView*( __thiscall* )( void*, CEconItem*, int, int, char ) >( sig( "client.dll", "55 8B EC 83 E4 F8 A1 ? ? ? ? 83 EC 14 53 56 57 8B F9 8B 08" ) ); 63 | 64 | GetBaseTypeCache()->AddObject( item ); 65 | 66 | 67 | auto ret = fnAddEconItem( this, item, a3, a4, a5 ); 68 | 69 | if ( ret ) 70 | { 71 | auto i = GetInventoryItemByItemID( *item->GetItemID() ); 72 | if ( i ) 73 | *reinterpret_cast< bool* >( ( uintptr_t )i + 0xA1 ) = 1; 74 | } 75 | 76 | return ret; 77 | } 78 | 79 | C_EconItemView* CPlayerInventory::GetItemInLoadout( int team, int slot ) 80 | { 81 | typedef C_EconItemView*( __thiscall* tOriginal )( void*, unsigned int, signed int ); 82 | return util::get_vfunc( this, 8 )( this, team, slot ); 83 | } 84 | 85 | C_EconItemView* CSInventoryManager::FindOrCreateReferenceEconItem( int64_t ID ) 86 | { 87 | static auto fnFindOrCreateReferenceEconItem = reinterpret_cast< C_EconItemView*( __thiscall* )( void*, int64_t ) >( sig( "client.dll", "55 8B EC 51 8B 55 0C 53 56" ) ); 88 | return fnFindOrCreateReferenceEconItem( this, ID ); 89 | } 90 | 91 | char CSInventoryManager::FilloutItemFromEconItem( C_EconItemView * view, CEconItem * item ) 92 | { 93 | static auto fnFilloutItemFromEconItem = reinterpret_cast< char( __thiscall* )( void*, void*, void* ) >( sig( "client.dll", "55 8B EC 83 E4 F8 83 EC 0C 53 56 8B F1 8B 86" ) ); 94 | return fnFilloutItemFromEconItem( this, view, item ); 95 | } 96 | 97 | bool CSInventoryManager::EquipItemInLoadout( int team, int slot, uint64_t item_id ) 98 | { 99 | static auto fnEquipItemInLoadout = reinterpret_cast< bool( __thiscall* )( void*, int, int, uint64_t, bool ) >( sig( "client.dll", "55 8B EC 83 E4 F8 83 EC 2C 83 3D" ) ); 100 | return fnEquipItemInLoadout( this, team, slot, item_id, true ); 101 | } 102 | -------------------------------------------------------------------------------- /internal_hvh/sdk/CPlayerInventory.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CSharedObjectTypeCache 4 | { 5 | public: 6 | void AddObject( void* obj ) 7 | { 8 | typedef void( __thiscall* tOriginal )( void*, void* ); 9 | util::get_vfunc( this, 1 )( this, obj ); 10 | } 11 | 12 | void RemoveObject( void* obj ) 13 | { 14 | typedef void( __thiscall* tOriginal )( void*, void* ); 15 | util::get_vfunc( this, 3 )( this, obj ); 16 | } 17 | 18 | std::vector GetEconItems() 19 | { 20 | std::vector ret; 21 | 22 | auto size = *reinterpret_cast< size_t* >( this + 0x18 ); 23 | 24 | auto data = *reinterpret_cast< uintptr_t** >( this + 0x4 ); 25 | 26 | for ( size_t i = 0; i < size; i++ ) 27 | ret.push_back( reinterpret_cast< CEconItem* >( data[ i ] ) ); 28 | 29 | return ret; 30 | } 31 | }; 32 | 33 | 34 | class CPlayerInventory 35 | { 36 | public: 37 | void RemoveItem( uint64_t ID ); 38 | void RemoveItem( CEconItem* item ); 39 | void ClearInventory(); 40 | CSharedObjectTypeCache* GetBaseTypeCache(); 41 | uint32_t GetSteamID(); 42 | CUtlVector< C_EconItemView* >* GetInventoryItems(); 43 | C_EconItemView* GetInventoryItemByItemID( int64_t id ); 44 | bool AddEconItem( CEconItem* item, int a3, int a4, char a5 ); 45 | C_EconItemView* GetItemInLoadout( int team, int slot ); 46 | }; 47 | 48 | 49 | class CSInventoryManager 50 | { 51 | public: 52 | C_EconItemView * FindOrCreateReferenceEconItem( int64_t ID ); 53 | char FilloutItemFromEconItem(C_EconItemView* view, CEconItem* item ); 54 | bool EquipItemInLoadout( int team, int slot, uint64_t item_id ); 55 | }; 56 | 57 | extern CSInventoryManager* g_pCSInventoryManager; -------------------------------------------------------------------------------- /internal_hvh/sdk/ClientClass.h: -------------------------------------------------------------------------------- 1 | class IClientNetworkable; 2 | class ClientClass; 3 | class RecvTable; 4 | 5 | using CreateClientClassFn = IClientNetworkable * ( *)( int, int ); 6 | using CreateEventFn = IClientNetworkable * ( *)( ); 7 | 8 | class ClientClass 9 | { 10 | public: 11 | CreateClientClassFn m_pCreateFn; 12 | CreateEventFn m_pCreateEventFn; 13 | const char* m_pNetworkName; 14 | RecvTable* m_pRecvTable; 15 | ClientClass* m_pNext; 16 | int m_ClassID; 17 | }; 18 | -------------------------------------------------------------------------------- /internal_hvh/sdk/ConVar.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class ConVar 4 | { 5 | public: 6 | VFUNC( 36, get_name(), char*( __thiscall* )( void* ) )( ) 7 | VFUNC( 14, set_value( const char* value ), void( __thiscall* )( void*, const char* ) )( value ) 8 | VFUNC( 15, set_value( float value ), void( __thiscall* )( void*, float ) )( value ) 9 | VFUNC( 16, set_value( int value ), void( __thiscall* )( void*, int ) )( value ) 10 | VFUNC( 17, set_value( Color value ), void( __thiscall* )( void*, Color ) )( value ) 11 | 12 | bool get_bool() { return !!get_int(); } 13 | char* get_default() { return pszDefaultValue; } 14 | float get_float() 15 | { 16 | const auto temp = *reinterpret_cast< int* >( &fValue ); 17 | auto temp_result = static_cast< int >( temp ^ reinterpret_cast< uintptr_t >( this ) ); 18 | 19 | return *reinterpret_cast< float* >( &temp_result ); 20 | } 21 | int get_int() 22 | { 23 | const auto temp = *reinterpret_cast< int* >( &fValue ); 24 | auto temp_result = static_cast< int >( temp ^ reinterpret_cast< uintptr_t >( this ) ); 25 | 26 | return *static_cast< int* >( &temp_result ); 27 | } 28 | 29 | char pad_0x0000[ 0x4 ]; //0x0000 30 | ConVar* pNext; //0x0004 31 | __int32 bRegistered; //0x0008 32 | char* pszName; //0x000C 33 | char* pszHelpString; //0x0010 34 | __int32 nFlags; //0x0014 35 | char pad_0x0018[ 0x4 ]; //0x0018 36 | ConVar* pParent; //0x001C 37 | char* pszDefaultValue; //0x0020 38 | char* strString; //0x0024 39 | __int32 StringLength; //0x0028 40 | float fValue; //0x002C 41 | __int32 nValue; //0x0030 42 | __int32 bHasMin; //0x0034 43 | float fMinVal; //0x0038 44 | __int32 bHasMax; //0x003C 45 | float fMaxVal; //0x0040 46 | void* fnChangeCallbacks; 47 | };//Size=0x0048 48 | -------------------------------------------------------------------------------- /internal_hvh/sdk/IMaterialVar.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class IMaterialVar 4 | { 5 | public: 6 | VFUNC( 1, get_tex_value(), ITexture*( __thiscall* )( void* ) )( ) 7 | VFUNC( 4, set_float_vaue( float val ), void( __thiscall* )( void*, float ) )( val ) 8 | VFUNC( 5, set_int_value( int val ), void( __thiscall* )( void*, int ) )( val ) 9 | VFUNC( 6, set_string_value( char const *val ), void( __thiscall* )( void*, char const * ) )( val ) 10 | VFUNC( 11, set_vec_val( float x, float y, float z ), void( __thiscall* )( void*, float, float, float ) )( x, y, z ) 11 | VFUNC( 15, set_tex_val( ITexture* tex ), void( __thiscall* )( void*, ITexture* ) )( tex ) 12 | }; 13 | -------------------------------------------------------------------------------- /internal_hvh/sdk/INetChannelInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define FLOW_OUTGOING 0 4 | #define FLOW_INCOMING 1 5 | #define MAX_FLOWS 2 // in & out 6 | 7 | class INetChannelInfo 8 | { 9 | public: 10 | 11 | enum 12 | { 13 | GENERIC = 0, // must be first and is default group 14 | LOCALPLAYER, // bytes for local player entity update 15 | OTHERPLAYERS, // bytes for other players update 16 | ENTITIES, // all other entity bytes 17 | SOUNDS, // game sounds 18 | EVENTS, // event messages 19 | USERMESSAGES, // user messages 20 | ENTMESSAGES, // entity messages 21 | VOICE, // voice data 22 | STRINGTABLE, // a stringtable update 23 | MOVE, // client move cmds 24 | STRINGCMD, // string command 25 | SIGNON, // various signondata 26 | TOTAL, // must be last and is not a real group 27 | }; 28 | 29 | virtual const char *GetName( void ) const = 0; // get channel name 30 | virtual const char *GetAddress( void ) const = 0; // get channel IP address as string 31 | virtual float GetTime( void ) const = 0; // current net time 32 | virtual float GetTimeConnected( void ) const = 0; // get connection time in seconds 33 | virtual int GetBufferSize( void ) const = 0; // netchannel packet history size 34 | virtual int GetDataRate( void ) const = 0; // send data rate in byte/sec 35 | 36 | virtual bool IsLoopback( void ) const = 0; // true if loopback channel 37 | virtual bool IsTimingOut( void ) const = 0; // true if timing out 38 | virtual bool IsPlayback( void ) const = 0; // true if demo playback 39 | 40 | virtual float GetLatency( int flow ) const = 0; // current latency (RTT), more accurate but jittering 41 | virtual float GetAvgLatency( int flow ) const = 0; // average packet latency in seconds 42 | virtual float GetAvgLoss( int flow ) const = 0; // avg packet loss[0..1] 43 | virtual float GetAvgChoke( int flow ) const = 0; // avg packet choke[0..1] 44 | virtual float GetAvgData( int flow ) const = 0; // data flow in bytes/sec 45 | virtual float GetAvgPackets( int flow ) const = 0; // avg packets/sec 46 | virtual int GetTotalData( int flow ) const = 0; // total flow in/out in bytes 47 | virtual int GetSequenceNr( int flow ) const = 0; // last send seq number 48 | virtual bool IsValidPacket( int flow, int frame_number ) const = 0; // true if packet was not lost/dropped/chocked/flushed 49 | virtual float GetPacketTime( int flow, int frame_number ) const = 0; // time when packet was send 50 | virtual int GetPacketBytes( int flow, int frame_number, int group ) const = 0; // group size of this packet 51 | virtual bool GetStreamProgress( int flow, int *received, int *total ) const = 0; // TCP progress if transmitting 52 | virtual float GetTimeSinceLastReceived( void ) const = 0; // get time since last recieved packet in seconds 53 | virtual float GetCommandInterpolationAmount( int flow, int frame_number ) const = 0; 54 | virtual void GetPacketResponseLatency( int flow, int frame_number, int *pnLatencyMsecs, int *pnChoke ) const = 0; 55 | virtual void GetRemoteFramerate( float *pflFrameTime, float *pflFrameTimeStdDeviation ) const = 0; 56 | 57 | virtual float GetTimeoutSeconds() const = 0; 58 | }; -------------------------------------------------------------------------------- /internal_hvh/sdk/IRefCounted.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class IRefCounted 4 | { 5 | private: 6 | volatile long refCount; 7 | 8 | public: 9 | virtual void destructor( char bDelete ) = 0; 10 | virtual bool OnFinalRelease() = 0; 11 | 12 | void unreference() 13 | { 14 | if ( InterlockedDecrement( &refCount ) == 0 && OnFinalRelease() ) 15 | destructor( 1 ); 16 | } 17 | }; 18 | -------------------------------------------------------------------------------- /internal_hvh/sdk/checksum_md5.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define MD5_DIGEST_LENGTH 16 4 | 5 | // MD5 Hash 6 | typedef struct 7 | { 8 | unsigned int buf[ 4 ]; 9 | unsigned int bits[ 2 ]; 10 | unsigned char in[ 64 ]; 11 | } MD5Context_t; 12 | 13 | void MD5Init( MD5Context_t *context ); 14 | void MD5Update( MD5Context_t *context, unsigned char const *buf, unsigned int len ); 15 | void MD5Final( unsigned char digest[ MD5_DIGEST_LENGTH ], MD5Context_t *context ); 16 | 17 | char *MD5_Print( unsigned char *digest, int hashlen ); 18 | 19 | unsigned int MD5_PseudoRandom( unsigned int nSeed ); -------------------------------------------------------------------------------- /internal_hvh/sdk/datatypes/VMatrix.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct VMatrix 4 | { 5 | float m[ 4 ][ 4 ]; 6 | 7 | inline float* operator[]( int i ) 8 | { 9 | return m[ i ]; 10 | } 11 | 12 | inline const float* operator[]( int i ) const 13 | { 14 | return m[ i ]; 15 | } 16 | }; -------------------------------------------------------------------------------- /internal_hvh/sdk/datatypes/Vector2D.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct Vector2D 4 | { 5 | public: 6 | float x, y; 7 | 8 | Vector2D() {} 9 | Vector2D( float x_, float y_ ) { x = x_; y = y_; } 10 | Vector2D( float x_, float y_, float z_ ) { x = x_; y = y_; } 11 | __forceinline Vector2D& operator+=( const Vector2D &v ); 12 | __forceinline Vector2D& operator-=( const Vector2D &v ); 13 | __forceinline Vector2D& operator*=( const Vector2D &v ); 14 | __forceinline Vector2D& operator*=( float s ); 15 | __forceinline Vector2D& operator/=( const Vector2D &v ); 16 | __forceinline Vector2D& operator/=( float s ); 17 | __forceinline Vector2D& operator+=( float fl ); 18 | __forceinline Vector2D& operator-=( float fl ); 19 | __forceinline Vector2D operator+( float fl ) const; 20 | __forceinline Vector2D operator+( Vector2D v ) const; 21 | __forceinline Vector2D operator-( float fl ) const; 22 | __forceinline Vector2D operator-( Vector2D v ) const; 23 | __forceinline Vector2D operator/( float fl ) const; 24 | inline float Length() const; 25 | }; 26 | 27 | //=============================================== 28 | __forceinline Vector2D& Vector2D::operator+=( const Vector2D& v ) 29 | { 30 | x += v.x; y += v.y; 31 | return *this; 32 | } 33 | //=============================================== 34 | __forceinline Vector2D& Vector2D::operator-=( const Vector2D& v ) 35 | { 36 | x -= v.x; y -= v.y; 37 | return *this; 38 | } 39 | //=============================================== 40 | __forceinline Vector2D& Vector2D::operator*=( float fl ) 41 | { 42 | x *= fl; 43 | y *= fl; 44 | return *this; 45 | } 46 | //=============================================== 47 | __forceinline Vector2D& Vector2D::operator*=( const Vector2D& v ) 48 | { 49 | x *= v.x; 50 | y *= v.y; 51 | return *this; 52 | } 53 | //=============================================== 54 | __forceinline Vector2D& Vector2D::operator+=( float fl ) 55 | { 56 | x += fl; 57 | y += fl; 58 | return *this; 59 | } 60 | //=============================================== 61 | __forceinline Vector2D& Vector2D::operator-=( float fl ) 62 | { 63 | x -= fl; 64 | y -= fl; 65 | return *this; 66 | } 67 | 68 | //=============================================== 69 | __forceinline Vector2D Vector2D::operator+( float fl ) const 70 | { 71 | return Vector2D( x + fl, y + fl ); 72 | } 73 | 74 | //=============================================== 75 | __forceinline Vector2D Vector2D::operator+( Vector2D v ) const 76 | { 77 | return Vector2D( x + v.x, y + v.y ); 78 | } 79 | 80 | //=============================================== 81 | __forceinline Vector2D Vector2D::operator-( float fl ) const 82 | { 83 | return Vector2D( x - fl, y - fl ); 84 | } 85 | //=============================================== 86 | __forceinline Vector2D Vector2D::operator-( Vector2D v ) const 87 | { 88 | return Vector2D( x - v.x, y - v.y ); 89 | } 90 | //=============================================== 91 | __forceinline Vector2D Vector2D::operator/( float fl ) const 92 | { 93 | return Vector2D( x / fl, y / fl ); 94 | } 95 | //=============================================== 96 | __forceinline Vector2D& Vector2D::operator/=( float fl ) 97 | { 98 | float oofl = 1.0f / fl; 99 | x *= oofl; 100 | y *= oofl; 101 | return *this; 102 | } 103 | //=============================================== 104 | __forceinline Vector2D& Vector2D::operator/=( const Vector2D& v ) 105 | { 106 | x /= v.x; 107 | y /= v.y; 108 | return *this; 109 | } 110 | //=============================================== 111 | inline float Vector2D::Length( void ) const 112 | { 113 | float root = 0.0f; 114 | 115 | float sqsr = x * x + y * y; 116 | 117 | __asm sqrtss xmm0, sqsr 118 | __asm movss root, xmm0 119 | 120 | return root; 121 | } -------------------------------------------------------------------------------- /internal_hvh/sdk/datatypes/Vector4D.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class Vector4D 4 | { 5 | public: 6 | // Members 7 | float x, y, z, w; 8 | 9 | inline float* Base(); 10 | inline float const* Base() const; 11 | 12 | float operator[](int i) const; 13 | float& operator[](int i); 14 | }; 15 | 16 | inline float* Vector4D::Base() 17 | { 18 | return (float*)this; 19 | } 20 | 21 | inline float const* Vector4D::Base() const 22 | { 23 | return (float const*)this; 24 | } 25 | 26 | inline float& Vector4D::operator[](int i) 27 | { 28 | Assert( (i >= 0) && (i < 4) ); 29 | return ((float*)this)[i]; 30 | } 31 | 32 | inline float Vector4D::operator[](int i) const 33 | { 34 | Assert( (i >= 0) && (i < 4) ); 35 | return ((float*)this)[i]; 36 | } -------------------------------------------------------------------------------- /internal_hvh/sdk/datatypes/matrix3x4_t.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | struct matrix3x4_t 5 | { 6 | matrix3x4_t() {} 7 | matrix3x4_t( 8 | float m00, float m01, float m02, float m03, 9 | float m10, float m11, float m12, float m13, 10 | float m20, float m21, float m22, float m23 ) 11 | { 12 | m_flMatVal[ 0 ][ 0 ] = m00; m_flMatVal[ 0 ][ 1 ] = m01; m_flMatVal[ 0 ][ 2 ] = m02; m_flMatVal[ 0 ][ 3 ] = m03; 13 | m_flMatVal[ 1 ][ 0 ] = m10; m_flMatVal[ 1 ][ 1 ] = m11; m_flMatVal[ 1 ][ 2 ] = m12; m_flMatVal[ 1 ][ 3 ] = m13; 14 | m_flMatVal[ 2 ][ 0 ] = m20; m_flMatVal[ 2 ][ 1 ] = m21; m_flMatVal[ 2 ][ 2 ] = m22; m_flMatVal[ 2 ][ 3 ] = m23; 15 | } 16 | 17 | matrix3x4_t( const float arr[ 12 ] ) 18 | { 19 | m_flMatVal[ 0 ][ 0 ] = arr[ 0 ]; m_flMatVal[ 0 ][ 1 ] = arr[ 1 ]; m_flMatVal[ 0 ][ 2 ] = arr[ 2 ]; m_flMatVal[ 0 ][ 3 ] = arr[ 3 ]; 20 | m_flMatVal[ 1 ][ 0 ] = arr[ 4 ]; m_flMatVal[ 1 ][ 1 ] = arr[ 5 ]; m_flMatVal[ 1 ][ 2 ] = arr[ 6 ]; m_flMatVal[ 1 ][ 3 ] = arr[ 7 ]; 21 | m_flMatVal[ 2 ][ 0 ] = arr[ 8 ]; m_flMatVal[ 2 ][ 1 ] = arr[ 9 ]; m_flMatVal[ 2 ][ 2 ] = arr[ 10 ]; m_flMatVal[ 2 ][ 3 ] = arr[ 11 ]; 22 | } 23 | 24 | //----------------------------------------------------------------------------- 25 | // Creates a matrix where the X axis = forward 26 | // the Y axis = left, and the Z axis = up 27 | //----------------------------------------------------------------------------- 28 | void Init( const Vector& xAxis, const Vector& yAxis, const Vector& zAxis, const Vector &vecOrigin ) 29 | { 30 | m_flMatVal[ 0 ][ 0 ] = xAxis.x; m_flMatVal[ 0 ][ 1 ] = yAxis.x; m_flMatVal[ 0 ][ 2 ] = zAxis.x; m_flMatVal[ 0 ][ 3 ] = vecOrigin.x; 31 | m_flMatVal[ 1 ][ 0 ] = xAxis.y; m_flMatVal[ 1 ][ 1 ] = yAxis.y; m_flMatVal[ 1 ][ 2 ] = zAxis.y; m_flMatVal[ 1 ][ 3 ] = vecOrigin.y; 32 | m_flMatVal[ 2 ][ 0 ] = xAxis.z; m_flMatVal[ 2 ][ 1 ] = yAxis.z; m_flMatVal[ 2 ][ 2 ] = zAxis.z; m_flMatVal[ 2 ][ 3 ] = vecOrigin.z; 33 | } 34 | 35 | //----------------------------------------------------------------------------- 36 | // Creates a matrix where the X axis = forward 37 | // the Y axis = left, and the Z axis = up 38 | //----------------------------------------------------------------------------- 39 | matrix3x4_t( const Vector& xAxis, const Vector& yAxis, const Vector& zAxis, const Vector &vecOrigin ) 40 | { 41 | Init( xAxis, yAxis, zAxis, vecOrigin ); 42 | } 43 | 44 | inline void SetOrigin( Vector const & p ) 45 | { 46 | m_flMatVal[ 0 ][ 3 ] = p.x; 47 | m_flMatVal[ 1 ][ 3 ] = p.y; 48 | m_flMatVal[ 2 ][ 3 ] = p.z; 49 | } 50 | 51 | inline Vector GetOrigin() { 52 | return { m_flMatVal[0][3], m_flMatVal[1][3], m_flMatVal[2][3] }; 53 | } 54 | 55 | inline void Invalidate( void ) 56 | { 57 | for ( int i = 0; i < 3; i++ ) 58 | { 59 | for ( int j = 0; j < 4; j++ ) 60 | { 61 | m_flMatVal[ i ][ j ] = VEC_T_NAN; 62 | } 63 | } 64 | } 65 | 66 | float *operator[]( int i ) { Assert( ( i >= 0 ) && ( i < 3 ) ); return m_flMatVal[ i ]; } 67 | const float *operator[]( int i ) const { Assert( ( i >= 0 ) && ( i < 3 ) ); return m_flMatVal[ i ]; } 68 | float *Base() { return &m_flMatVal[ 0 ][ 0 ]; } 69 | const float *Base() const { return &m_flMatVal[ 0 ][ 0 ]; } 70 | 71 | float m_flMatVal[ 3 ][ 4 ]; 72 | }; -------------------------------------------------------------------------------- /internal_hvh/sdk/include_sdk.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "defines.h" 4 | #include "datatypes/Vector.h" 5 | #include "datatypes/QAngle.h" 6 | #include "datatypes/matrix3x4_t.h" 7 | #include "datatypes/VMatrix.h" 8 | #include "datatypes/Color.h" 9 | #include "datatypes/CUtlVector.h" 10 | #include "datatypes/Vector2D.h" 11 | #include "datatypes/Vector4D.h" 12 | 13 | #include "misc.h" 14 | #include "structs.h" 15 | #include "ClientClass.h" 16 | #include "IClientEntity.h" 17 | #include "entity_classes.h" 18 | #include "IRefCounted.h" 19 | #include "IMaterial.h" 20 | #include "IMaterialVar.h" 21 | #include "ConVar.h" 22 | #include "trace_ray.h" 23 | #include "CCSGOPlayerAnimState.h" 24 | #include "INetChannelInfo.h" 25 | #include "CBoneChache.h" 26 | #include "CNetChannel.h" 27 | #include "CCSGameRulesProxy.h" 28 | #include "CPlayerInventory.h" 29 | #include "CEconItem.h" 30 | 31 | #include "interfaces/interfaces.h" 32 | 33 | -------------------------------------------------------------------------------- /internal_hvh/sdk/interfaces/CGlowObjectManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CGlowObjectManager 4 | { 5 | public: 6 | class GlowObjectDefinition_t 7 | { 8 | public: 9 | bool ShouldDraw() const { return m_pEntity && ( m_bRenderWhenOccluded || m_bRenderWhenUnoccluded ); } 10 | bool IsUnused() const { return m_nNextFreeSlot != GlowObjectDefinition_t::ENTRY_IN_USE; } 11 | 12 | C_BaseEntity* m_pEntity; 13 | Vector m_vGlowColor; 14 | float m_flGlowAlpha; 15 | 16 | char unknown[ 4 ]; 17 | float flUnk; 18 | float m_flBloomAmount; 19 | float localplayeriszeropoint3; 20 | bool m_bRenderWhenOccluded; 21 | bool m_bRenderWhenUnoccluded; 22 | bool m_bFullBloomRender; 23 | char unknown1[ 1 ]; 24 | int m_nFullBloomStencilTestValue; // 0x28 only render full bloom objects if stencil is equal to this value (value of -1 implies no stencil test) 25 | int iUnk; //appears like it needs to be zero 26 | int m_nSplitScreenSlot; //Should be -1 27 | // Linked list of free slots 28 | int m_nNextFreeSlot; 29 | // Special values for GlowObjectDefinition_t::m_nNextFreeSlot 30 | static const int END_OF_FREE_LIST = -1; 31 | static const int ENTRY_IN_USE = -2; 32 | }; 33 | 34 | void RenderGlowEffects(); 35 | 36 | CUtlVector< GlowObjectDefinition_t > m_glObjectDefinitions; 37 | int m_nFirstFreeSlot; 38 | }; 39 | 40 | struct ShaderStencilState_t 41 | { 42 | bool m_bEnable; 43 | StencilOperation_t m_FailOp; 44 | StencilOperation_t m_ZFailOp; 45 | StencilOperation_t m_PassOp; 46 | StencilComparisonFunction_t m_CompareFunc; 47 | int m_nReferenceValue; 48 | uint32 m_nTestMask; 49 | uint32 m_nWriteMask; 50 | 51 | ShaderStencilState_t() 52 | { 53 | m_bEnable = false; 54 | m_PassOp = m_FailOp = m_ZFailOp = STENCILOPERATION_KEEP; 55 | m_CompareFunc = STENCILCOMPARISONFUNCTION_ALWAYS; 56 | m_nReferenceValue = 0; 57 | m_nTestMask = m_nWriteMask = 0xFFFFFFFF; 58 | } 59 | }; 60 | 61 | extern CGlowObjectManager* g_pGlowObjectManager; -------------------------------------------------------------------------------- /internal_hvh/sdk/interfaces/CHud.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CHud 4 | { 5 | public: 6 | MFUNC( FindElement( const char* name ), void*( __thiscall * )( void*, const char* ), offsets::find_element )( name ) 7 | }; 8 | 9 | extern CHud* g_pHud; -------------------------------------------------------------------------------- /internal_hvh/sdk/interfaces/CSPlayerResource.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class Color; 4 | class C_CSPlayerResource 5 | { 6 | public: 7 | OFFSETRS( get_ping, int, 0x0AE4 ) 8 | OFFSET( get_c4_player, int, 0x161C ) 9 | }; 10 | 11 | extern C_CSPlayerResource** g_ppPlayerResource; -------------------------------------------------------------------------------- /internal_hvh/sdk/interfaces/IBaseClientDll.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class ClientClass; 4 | class IBaseClientDll 5 | { 6 | public: 7 | VFUNC( 8, GetAllClasses(), ClientClass*( __thiscall* )( void* ) )( ) 8 | VFUNC( 20, IN_KeyEvent( int eventcode, int keynum, const char *pszCurrentBinding ), void( __thiscall* )( void*, int, int, const char* ) )( eventcode, keynum, pszCurrentBinding ) 9 | VFUNC( 21, CreateMove( int sequence_number, float frametime, bool active ), void( __thiscall* )( void*, int, float, bool ) )( sequence_number, frametime, active ) 10 | }; 11 | 12 | extern IBaseClientDll* g_pClient; -------------------------------------------------------------------------------- /internal_hvh/sdk/interfaces/ICVar.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class IAppSystem2 4 | { 5 | public: 6 | virtual void func0() = 0; 7 | virtual void func1() = 0; 8 | virtual void func2() = 0; 9 | virtual void func3() = 0; 10 | virtual void func4() = 0; 11 | virtual void func5() = 0; 12 | virtual void func6() = 0; 13 | virtual void func7() = 0; 14 | virtual void func8() = 0; 15 | virtual void func9() = 0; 16 | }; 17 | 18 | struct CVarDLLIdentifier_t; 19 | 20 | class ICVar : public IAppSystem2 21 | { 22 | public: 23 | virtual void func10() = 0; 24 | virtual void RegisterConCommand( ConVar *pCommandBase ) = 0; 25 | virtual void UnregisterConCommand( ConVar *pCommandBase ) = 0; 26 | virtual void func13() = 0; 27 | virtual ConVar *FindVar( const char *var_name ) = 0; 28 | 29 | template 30 | void ConsoleColorPrintf( const Color& MsgColor, const char* szMsgFormat, Values... Parameters ) 31 | { 32 | typedef void( *oConsoleColorPrintf )( void*, const Color&, const char*, ... ); 33 | return util::get_vfunc( this, 25 )( this, MsgColor, szMsgFormat, Parameters... ); 34 | } 35 | }; 36 | 37 | extern ICVar* g_pCVar; -------------------------------------------------------------------------------- /internal_hvh/sdk/interfaces/IClientEntityList.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class IClientEntity; 4 | class IClientUnknown; 5 | class IClientNetworkable; 6 | using CBaseHandle = unsigned long; 7 | class IClientEntityList 8 | { 9 | public: 10 | virtual IClientNetworkable* GetClientNetworkable( int iEnt ) = 0; 11 | virtual IClientNetworkable* GetClientNetworkableFromHandle( CBaseHandle hEnt ) = 0; 12 | virtual IClientUnknown* GetClientUnknownFromHandle( CBaseHandle hEnt ) = 0; 13 | virtual IClientEntity* GetClientEntity( int iEnt ) = 0; 14 | virtual IClientEntity* GetClientEntityFromHandle( CBaseHandle hEnt ) = 0; 15 | virtual int NumberOfEntities( bool bIncludeNonNetworkable ) = 0; 16 | virtual int GetHighestEntityIndex() = 0; 17 | virtual void SetMaxEntities( int iMax ) = 0; 18 | virtual int GetMaxEntities() = 0; 19 | }; 20 | 21 | extern IClientEntityList* g_pEntitiyList; -------------------------------------------------------------------------------- /internal_hvh/sdk/interfaces/IClientModeShared.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CBaseHudChat 4 | { 5 | public: 6 | VFUNC( 26, ChatPrintf( int idx, int filter, const char* fmt, ... ), void( __cdecl* )( void*, int, int, const char*, ... ) )( idx, filter, fmt ) 7 | }; 8 | 9 | class IClientModeShared 10 | { 11 | public: 12 | char pad[ 28 ]; 13 | CBaseHudChat *m_pChatElement; 14 | }; 15 | 16 | extern IClientModeShared* g_pClientMode; -------------------------------------------------------------------------------- /internal_hvh/sdk/interfaces/IClientState.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class INetChannel; 4 | class INetMessage 5 | { 6 | public: 7 | virtual ~INetMessage() {}; 8 | 9 | // Use these to setup who can hear whose voice. 10 | // Pass in client indices (which are their ent indices - 1). 11 | 12 | virtual void SetNetChannel( INetChannel * netchan ) = 0; // netchannel this message is from/for 13 | virtual void SetReliable( bool state ) = 0; // set to true if it's a reliable message 14 | 15 | virtual bool Process( void ) = 0; // calles the recently set handler to process this message 16 | 17 | virtual bool ReadFromBuffer( bf_read &buffer ) = 0; // returns true if parsing was OK 18 | virtual bool WriteToBuffer( void* buffer ) = 0; // returns true if writing was OK 19 | 20 | virtual bool IsReliable( void ) const = 0; // true, if message needs reliable handling 21 | 22 | virtual int GetType( void ) const = 0; // returns module specific header tag eg svc_serverinfo 23 | virtual int GetGroup( void ) const = 0; // returns net message group of this message 24 | virtual const char *GetName( void ) const = 0; // returns network message name, eg "svc_serverinfo" 25 | virtual INetChannel *GetNetChannel( void ) const = 0; 26 | virtual const char *ToString( void ) const = 0; // returns a human readable string about message content 27 | }; 28 | 29 | 30 | 31 | class CClockDriftMgr 32 | { 33 | public: 34 | float m_ClockOffsets[ 17 ]; //0x0000 35 | uint32_t m_iCurClockOffset; //0x0044 36 | uint32_t m_nServerTick; //0x0048 37 | uint32_t m_nClientTick; //0x004C 38 | }; //Size: 0x0050 39 | 40 | class IClientState 41 | { 42 | public: 43 | void ForceFullUpdate() 44 | { 45 | *reinterpret_cast< int* >( uintptr_t( this ) + 0x174 ) = -1; 46 | }; 47 | 48 | char pad_0000[ 156 ]; //0x0000 49 | CNetChannel* m_NetChannel; //0x009C 50 | uint32_t m_nChallengeNr; //0x00A0 51 | char pad_00A4[ 100 ]; //0x00A4 52 | uint32_t m_nSignonState; //0x0108 53 | char pad_010C[ 8 ]; //0x010C 54 | float m_flNextCmdTime; //0x0114 55 | uint32_t m_nServerCount; //0x0118 56 | uint32_t m_nCurrentSequence; //0x011C 57 | char pad_0120[ 8 ]; //0x0120 58 | CClockDriftMgr m_ClockDriftMgr; //0x0128 59 | uint32_t m_nDeltaTick; //0x0178 60 | bool m_bPaused; //0x017C 61 | char pad_017D[ 3 ]; //0x017D 62 | uint32_t m_nViewEntity; //0x0180 63 | uint32_t m_nPlayerSlot; //0x0184 64 | char m_szLevelName[ 260 ]; //0x0188 65 | char m_szLevelNameShort[ 40 ]; //0x028C 66 | char m_szGroupName[ 40 ]; //0x02B4 67 | char pad_02DC[ 52 ]; //0x02DC 68 | uint32_t m_nMaxClients; //0x0310 69 | char pad_0314[ 18820 ]; //0x0314 70 | float m_flLastServerTickTime; //0x4C98 71 | bool insimulation; //0x4C9C 72 | char pad_4C9D[ 3 ]; //0x4C9D 73 | uint32_t oldtickcount; //0x4CA0 74 | float m_tickRemainder; //0x4CA4 75 | float m_frameTime; //0x4CA8 76 | uint32_t m_nLastOutgoingCommand; //0x4CAC 77 | uint32_t m_nChokedCommands; //0x4CB0 78 | uint32_t m_nLastCommandAck; //0x4CB4 79 | uint32_t m_nCommandAck; //0x4CB8 80 | uint32_t m_nSoundSequence; //0x4CBC 81 | char pad_4CC0[ 80 ]; //0x4CC0 82 | Vector viewangles; //0x4D10 83 | char pad_4D14[0xD0]; //0x4D1C 84 | CEventInfo* m_Events; //0x4DEC 85 | }; 86 | 87 | extern IClientState* g_pClientState; -------------------------------------------------------------------------------- /internal_hvh/sdk/interfaces/IGameEventManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | class IGameEvent 5 | { 6 | public: 7 | virtual ~IGameEvent() = 0; 8 | virtual const char *GetName() const = 0; 9 | 10 | virtual bool IsReliable() const = 0; 11 | virtual bool IsLocal() const = 0; 12 | virtual bool IsEmpty( const char *keyName = NULL ) = 0; 13 | 14 | virtual bool GetBool( const char *keyName = NULL, bool defaultValue = false ) = 0; 15 | virtual int GetInt( const char *keyName = NULL, int defaultValue = 0 ) = 0; 16 | virtual unsigned long GetUint64( const char *keyName = NULL, unsigned long defaultValue = 0 ) = 0; 17 | virtual float GetFloat( const char *keyName = NULL, float defaultValue = 0.0f ) = 0; 18 | virtual const char *GetString( const char *keyName = NULL, const char *defaultValue = "" ) = 0; 19 | virtual const wchar_t *GetWString( const char *keyName, const wchar_t *defaultValue = L"" ) = 0; 20 | 21 | virtual void SetBool( const char *keyName, bool value ) = 0; 22 | virtual void SetInt( const char *keyName, int value ) = 0; 23 | virtual void SetUint64( const char *keyName, unsigned long value ) = 0; 24 | virtual void SetFloat( const char *keyName, float value ) = 0; 25 | virtual void SetString( const char *keyName, const char *value ) = 0; 26 | virtual void SetWString( const char *keyName, const wchar_t *value ) = 0; 27 | }; 28 | 29 | 30 | class IGameEventListener2 31 | { 32 | public: 33 | virtual ~IGameEventListener2( void ) {}; 34 | 35 | virtual void FireGameEvent( IGameEvent *event ) = 0; 36 | virtual int GetEventDebugID( void ) = 0; 37 | }; 38 | 39 | #undef CreateEvent 40 | class IGameEventManager2 41 | { 42 | public: 43 | virtual ~IGameEventManager2( void ) {}; 44 | virtual int LoadEventsFromFile( const char* filename ) = 0; 45 | virtual void Reset() = 0; 46 | virtual bool AddListener( IGameEventListener2* listener, const char* name, bool bServerSide ) = 0; 47 | virtual bool FindListener( IGameEventListener2* listener, const char* name ) = 0; 48 | virtual void RemoveListener( IGameEventListener2* listener ) = 0; 49 | virtual void AddListenerGlobal( IGameEventListener2* listener, bool bIsServerSide ) = 0; 50 | virtual IGameEvent* CreateEvent( const char* name, bool bForce = false, int* pCookie = NULL ) = 0; 51 | virtual bool FireEvent( IGameEvent* event, bool bDontBroadcast = false ) = 0; 52 | virtual bool FireEventClientSide( IGameEvent* event ) = 0; 53 | virtual IGameEvent* DuplicateEvent( IGameEvent* event ) = 0; 54 | virtual void FreeEvent( IGameEvent* event ) = 0; 55 | virtual bool SerializeEvent( IGameEvent* event, int* buf ) = 0; 56 | virtual IGameEvent* UnserializeEvent( int* buf ) = 0; 57 | virtual void *GetEventDataTypes( IGameEvent* event ) = 0; 58 | }; 59 | 60 | extern IGameEventManager2* g_pGameEventManager; -------------------------------------------------------------------------------- /internal_hvh/sdk/interfaces/IGlobalVarsBase.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class IGlobalVarsBase 4 | { 5 | public: 6 | float realtime; 7 | int framecount; 8 | float absoluteframetime; 9 | float absoluteframestarttimestddev; 10 | float curtime; 11 | float frametime; 12 | int maxClients; 13 | int tickcount; 14 | float interval_per_tick; 15 | float interpolation_at; 16 | int simTicksThisFrame; 17 | int network_protocol; 18 | void* pSaveData; 19 | private: 20 | bool m_bClient; 21 | public: 22 | bool m_bRemoteClient; 23 | private: 24 | int nTimestampNetworkingBase; 25 | int nTimestampRandomizeWindow; 26 | }; 27 | 28 | extern IGlobalVarsBase* g_pGlobals; -------------------------------------------------------------------------------- /internal_hvh/sdk/interfaces/IInput.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class bf_write; 4 | class bf_read; 5 | 6 | typedef unsigned int CRC32_t; 7 | class IInput 8 | { 9 | public: 10 | class CVerifiedUserCmd 11 | { 12 | public: 13 | CUserCmd m_cmd; 14 | CRC32_t m_crc; 15 | }; 16 | public: 17 | void* pvftable; //0x00 18 | bool m_fTrackIRAvailable; //0x04 19 | bool m_fMouseInitialized; //0x05 20 | bool m_fMouseActive; //0x06 21 | bool m_fJoystickAdvancedInit; //0x07 22 | char pad_0x08[ 0x2C ]; //0x08 23 | void* m_pKeys; //0x34 24 | char pad_0x38[ 0x64 ]; //0x38 25 | int pad_0x41; 26 | int pad_0x42; 27 | bool m_fCameraInterceptingMouse; //0x9C 28 | bool m_fCameraInThirdPerson; //0x9D 29 | bool m_fCameraMovingWithMouse; //0x9E 30 | Vector m_vecCameraOffset; //0xA0 31 | bool m_fCameraDistanceMove; //0xAC 32 | int m_nCameraOldX; //0xB0 33 | int m_nCameraOldY; //0xB4 34 | int m_nCameraX; //0xB8 35 | int m_nCameraY; //0xBC 36 | bool m_CameraIsOrthographic; //0xC0 37 | Vector m_angPreviousViewAngles; //0xC4 38 | Vector m_angPreviousViewAnglesTilt; //0xD0 39 | float m_flLastForwardMove; //0xDC 40 | int m_nClearInputState; //0xE0 41 | char pad_0xE4[ 0x8 ]; //0xE4 42 | CUserCmd* m_pCommands; //0xEC 43 | CVerifiedUserCmd* m_pVerifiedCommands; //0xF0 44 | VFUNC( 8, GetUserCmd( int slot, int seq ), CUserCmd*( __thiscall* )( void*, int, int ) )( slot, seq ) 45 | }; 46 | 47 | extern IInput* g_pInput; 48 | -------------------------------------------------------------------------------- /internal_hvh/sdk/interfaces/ILocalize.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum InitReturnVal_t 4 | { 5 | INIT_FAILED = 0, 6 | INIT_OK, 7 | 8 | INIT_LAST_VAL, 9 | }; 10 | 11 | enum AppSystemTier_t 12 | { 13 | APP_SYSTEM_TIER0 = 0, 14 | APP_SYSTEM_TIER1, 15 | APP_SYSTEM_TIER2, 16 | APP_SYSTEM_TIER3, 17 | 18 | APP_SYSTEM_TIER_OTHER, 19 | }; 20 | 21 | struct AppSystemInfo_t; 22 | 23 | using CreateInterfaceFn = void* ( *)( const char*, int* ); 24 | 25 | class IAppSystem 26 | { 27 | public: 28 | virtual bool Connect( CreateInterfaceFn factory ) = 0; 29 | virtual void Disconnect() = 0; 30 | virtual void* QueryInterface( const char* pInterfaceName ) = 0; 31 | virtual InitReturnVal_t Init() = 0; 32 | virtual void Shutdown() = 0; 33 | virtual const AppSystemInfo_t* GetDependencies() = 0; 34 | virtual AppSystemTier_t GetTier() = 0; 35 | virtual void Reconnect( CreateInterfaceFn factory, const char* pInterfaceName ) = 0; 36 | virtual bool IsSingleton() = 0; 37 | }; 38 | 39 | 40 | using LocalizeStringIndex_t = unsigned; 41 | 42 | class ILocalizeTextQuery 43 | { 44 | public: 45 | virtual int ComputeTextWidth( const wchar_t* pString ) = 0; 46 | }; 47 | 48 | class ILocalizationChangeCallback 49 | { 50 | public: 51 | virtual void OnLocalizationChanged() = 0; 52 | }; 53 | 54 | class ILocalize : public IAppSystem 55 | { 56 | public: 57 | virtual bool AddFile( const char* fileName, const char* pPathID = nullptr, bool bIncludeFallbackSearchPaths = false ) = 0; 58 | virtual void RemoveAll() = 0; 59 | virtual wchar_t* Find( const char* tokenName ) = 0; 60 | virtual const wchar_t* FindSafe( const char* tokenName ) = 0; 61 | virtual int ConvertANSIToUnicode( const char* ansi, wchar_t* unicode, int unicodeBufferSizeInBytes ) = 0; 62 | virtual int ConvertUnicodeToANSI( const wchar_t* unicode, char* ansi, int ansiBufferSize ) = 0; 63 | virtual LocalizeStringIndex_t FindIndex( const char* tokenName ) = 0; 64 | virtual void ConstructString( wchar_t* unicodeOuput, int unicodeBufferSizeInBytes, const wchar_t* formatString, int numFormatParameters, ... ) = 0; 65 | virtual const char* GetNameByIndex( LocalizeStringIndex_t index ) = 0; 66 | virtual wchar_t* GetValueByIndex( LocalizeStringIndex_t index ) = 0; 67 | }; 68 | 69 | extern ILocalize* g_pLocalize; 70 | -------------------------------------------------------------------------------- /internal_hvh/sdk/interfaces/IMaterialSystem.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | typedef unsigned short MaterialHandle_t; 4 | 5 | struct MaterialVideoMode_t 6 | { 7 | int m_Width; 8 | int m_Height; 9 | int m_Format; 10 | int m_RefreshRate; 11 | }; 12 | 13 | struct MaterialSystem_Config_t 14 | { 15 | MaterialVideoMode_t m_VideoMode; 16 | float m_fMonitorGamma; 17 | float m_fGammaTVRangeMin; 18 | float m_fGammaTVRangeMax; 19 | float m_fGammaTVExponent; 20 | bool m_bGammaTVEnabled; 21 | bool m_bTripleBuffered; 22 | int m_nAASamples; 23 | int m_nForceAnisotropicLevel; 24 | int m_nSkipMipLevels; 25 | int m_nDxSupportLevel; 26 | int m_nFlags; 27 | bool m_bEditMode; 28 | char m_nProxiesTestMode; 29 | bool m_bCompressedTextures; 30 | bool m_bFilterLightmaps; 31 | bool m_bFilterTextures; 32 | bool m_bReverseDepth; 33 | bool m_bBufferPrimitives; 34 | bool m_bDrawFlat; 35 | bool m_bMeasureFillRate; 36 | bool m_bVisualizeFillRate; 37 | bool m_bNoTransparency; 38 | bool m_bSoftwareLighting; 39 | bool m_bAllowCheats; 40 | char m_nShowMipLevels; 41 | bool m_bShowLowResImage; 42 | bool m_bShowNormalMap; 43 | bool m_bMipMapTextures; 44 | char m_nFullbright; 45 | bool m_bFastNoBump; 46 | bool m_bSuppressRendering; 47 | bool m_bDrawGray; 48 | bool m_bShowSpecular; 49 | bool m_bShowDiffuse; 50 | int m_nWindowedSizeLimitWidth; 51 | int m_nWindowedSizeLimitHeight; 52 | int m_nAAQuality; 53 | bool m_bShadowDepthTexture; 54 | bool m_bMotionBlur; 55 | bool m_bSupportFlashlight; 56 | bool m_bPaintEnabled; 57 | char pad[ 0xC ]; 58 | }; 59 | 60 | class IMatRenderContext; 61 | class ITexture; 62 | class IMaterialSystem 63 | { 64 | public: 65 | VFUNC( 21, OverrideConfig( const MaterialSystem_Config_t& cfg, bool b ), bool( __thiscall* )( void*, const MaterialSystem_Config_t&, bool ) )( cfg, b ) 66 | VFUNC( 36, GetBackBufferFormat(), ImageFormat( __thiscall* )( void* ) )( ) 67 | VFUNC( 84, FindMaterial( const char* name, const char *texgroup, bool complain = true, const char *complainprefix = nullptr ), IMaterial*( __thiscall* )( void*, const char*, const char*, bool, const char* ) )( name, texgroup, complain, complainprefix ) 68 | VFUNC( 86, FirstMaterial(), MaterialHandle_t( __thiscall* )( void* ) )( ) 69 | VFUNC( 87, NextMaterial( MaterialHandle_t h ), MaterialHandle_t( __thiscall* )( void*, MaterialHandle_t ) )( h ) 70 | VFUNC( 88, InvalidMaterial(), MaterialHandle_t( __thiscall* )( void* ) )( ) 71 | VFUNC( 89, GetMaterial( MaterialHandle_t h ), IMaterial* ( __thiscall* )( void*, MaterialHandle_t ) )( h ) 72 | VFUNC( 90, GetNumMaterials(), int( __thiscall* )( void* ) )( ) 73 | VFUNC( 91, FindTexture( const char* name, const char *groupname, bool complain ), ITexture*( __thiscall* )( void*, const char*, const char*, bool ) )( name, groupname, complain ) 74 | VFUNC( 94, BeginRenderTargetAllocation(), void( __thiscall* )( void* ) )( ) 75 | VFUNC( 95, EndRenderTargetAllocation(), void( __thiscall* )( void* ) )( ) 76 | VFUNC( 115, GetRenderContext(), IMatRenderContext*( __thiscall* )( void* ) )( ) 77 | }; 78 | 79 | extern IMaterialSystem* g_pMaterialSystem; 80 | -------------------------------------------------------------------------------- /internal_hvh/sdk/interfaces/IMemAlloc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class IMemAlloc 4 | { 5 | public: 6 | VFUNC( 1, Alloc( size_t size ), void*( __thiscall* )( void*, size_t ) )( size ) 7 | VFUNC( 3, Realloc( void *mem, size_t size ), void*( __thiscall* )( void*, void*, size_t ) )( mem, size ) 8 | VFUNC( 5, Free( void *mem ), void( __thiscall* )( void*, void* ) )( mem ) 9 | }; 10 | 11 | extern IMemAlloc* g_pMemAlloc; -------------------------------------------------------------------------------- /internal_hvh/sdk/interfaces/IMoveHelper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class IMoveHelper 4 | { 5 | public: 6 | virtual void _vpad() = 0; 7 | virtual void SetHost( IClientEntity* host ) = 0; 8 | 9 | bool m_bFirstRunOfFunctions : 1; 10 | bool m_bGameCodeMovedPlayer : 1; 11 | int m_nPlayerHandle; // edict index on server, client entity handle on client= 12 | int m_nImpulseCommand; // Impulse command issued. 13 | QAngle m_vecViewAngles; // Command view angles (local space) 14 | QAngle m_vecAbsViewAngles; // Command view angles (world space) 15 | int m_nButtons; // Attack buttons. 16 | int m_nOldButtons; // From host_client->oldbuttons; 17 | float m_flForwardMove; 18 | float m_flSideMove; 19 | float m_flUpMove; 20 | float m_flMaxSpeed; 21 | float m_flClientMaxSpeed; 22 | Vector m_vecVelocity; // edict::velocity // Current movement direction. 23 | QAngle m_vecAngles; // edict::angles 24 | QAngle m_vecOldAngles; 25 | float m_outStepHeight; // how much you climbed this move 26 | Vector m_outWishVel; // This is where you tried 27 | Vector m_outJumpVel; // This is your jump velocity 28 | Vector m_vecConstraintCenter; 29 | float m_flConstraintRadius; 30 | float m_flConstraintWidth; 31 | float m_flConstraintSpeedFactor; 32 | float m_flUnknown[ 5 ]; 33 | Vector m_vecAbsOrigin; 34 | }; 35 | 36 | extern IMoveHelper* g_pMoveHelper; -------------------------------------------------------------------------------- /internal_hvh/sdk/interfaces/IPhysicsSurfaceProps.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | struct surfacephysicsparams_t 5 | { 6 | float friction; 7 | float elasticity; 8 | float density; 9 | float thickness; 10 | float dampening; 11 | }; 12 | 13 | struct surfaceaudioparams_t 14 | { 15 | float reflectivity; // like elasticity, but how much sound should be reflected by this surface 16 | float hardnessFactor; // like elasticity, but only affects impact sound choices 17 | float roughnessFactor; // like friction, but only affects scrape sound choices 18 | float roughThreshold; // surface roughness > this causes "rough" scrapes, < this causes "smooth" scrapes 19 | float hardThreshold; // surface hardness > this causes "hard" impacts, < this causes "soft" impacts 20 | float hardVelocityThreshold; // collision velocity > this causes "hard" impacts, < this causes "soft" impacts 21 | float highPitchOcclusion; //a value betweeen 0 and 100 where 0 is not occluded at all and 100 is silent (except for any additional reflected sound) 22 | float midPitchOcclusion; 23 | float lowPitchOcclusion; 24 | }; 25 | 26 | struct surfacesoundnames_t 27 | { 28 | unsigned short walkStepLeft; 29 | unsigned short walkStepRight; 30 | unsigned short runStepLeft; 31 | unsigned short runStepRight; 32 | unsigned short impactSoft; 33 | unsigned short impactHard; 34 | unsigned short scrapeSmooth; 35 | unsigned short scrapeRough; 36 | unsigned short bulletImpact; 37 | unsigned short rolling; 38 | unsigned short breakSound; 39 | unsigned short strainSound; 40 | }; 41 | 42 | struct surfacegameprops_t 43 | { 44 | public: 45 | float maxspeedfactor; 46 | float jumpfactor; 47 | float penetrationmodifier; 48 | float damagemodifier; 49 | uint16_t material; 50 | uint8_t climbable; 51 | }; 52 | 53 | struct surfacedata_t 54 | { 55 | surfacephysicsparams_t physics; 56 | surfaceaudioparams_t audio; 57 | surfacesoundnames_t sounds; 58 | surfacegameprops_t game; 59 | char pad[48]; 60 | }; 61 | 62 | class IPhysicsSurfaceProps 63 | { 64 | public: 65 | virtual ~IPhysicsSurfaceProps(void) {} 66 | 67 | 68 | virtual int ParseSurfaceData(const char* pFilename, const char* pTextfile) = 0; 69 | 70 | virtual int SurfacePropCount(void) const = 0; 71 | 72 | virtual int GetSurfaceIndex(const char* pSurfacePropName) const = 0; 73 | virtual void GetPhysicsProperties(int surfaceDataIndex, float* density, float* thickness, float* friction, float* elasticity) const = 0; 74 | 75 | virtual surfacedata_t* GetSurfaceData(int surfaceDataIndex) = 0; 76 | virtual const char* GetString(unsigned short stringTableIndex) const = 0; 77 | 78 | 79 | virtual const char* GetPropName(int surfaceDataIndex) const = 0; 80 | 81 | 82 | virtual void SetWorldMaterialIndexTable(int* pMapArray, int mapSize) = 0; 83 | 84 | virtual void GetPhysicsParameters(int surfaceDataIndex, surfacephysicsparams_t* pParamsOut) const = 0; 85 | }; 86 | 87 | extern IPhysicsSurfaceProps* g_pSurfaceProps; -------------------------------------------------------------------------------- /internal_hvh/sdk/interfaces/IPrediction.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CMoveData 4 | { 5 | public: 6 | bool m_bFirstRunOfFunctions : 1; 7 | bool m_bGameCodeMovedPlayer : 1; 8 | int m_nPlayerHandle; // edict index on server, client entity handle on client= 9 | int m_nImpulseCommand; // Impulse command issued. 10 | QAngle m_vecViewAngles; // Command view angles (local space) 11 | Vector m_vecAbsViewAngles; // Command view angles (world space) 12 | int m_nButtons; // Attack buttons. 13 | int m_nOldButtons; // From host_client->oldbuttons; 14 | float m_flForwardMove; 15 | float m_flSideMove; 16 | float m_flUpMove; 17 | float m_flMaxSpeed; 18 | float m_flClientMaxSpeed; 19 | Vector m_vecVelocity; // edict::velocity // Current movement direction. 20 | QAngle m_vecAngles; // edict::angles 21 | Vector m_vecOldAngles; 22 | float m_outStepHeight; // how much you climbed this move 23 | Vector m_outWishVel; // This is where you tried 24 | Vector m_outJumpVel; // This is your jump velocity 25 | Vector m_vecConstraintCenter; 26 | float m_flConstraintRadius; 27 | float m_flConstraintWidth; 28 | float m_flConstraintSpeedFactor; 29 | float m_flUnknown[ 5 ]; 30 | Vector m_vecAbsOrigin; 31 | }; 32 | 33 | class IGameMovement 34 | { 35 | public: 36 | virtual ~IGameMovement( void ) {} 37 | 38 | virtual void ProcessMovement( C_BasePlayer *pPlayer, CMoveData *pMove ) = 0; 39 | virtual void Reset( void ) = 0; 40 | virtual void StartTrackPredictionErrors( C_BasePlayer *pPlayer ) = 0; 41 | virtual void FinishTrackPredictionErrors( C_BasePlayer *pPlayer ) = 0; 42 | virtual void DiffPrint( char const *fmt, ... ) = 0; 43 | virtual Vector const& GetPlayerMins( bool ducked ) const = 0; 44 | virtual Vector const& GetPlayerMaxs( bool ducked ) const = 0; 45 | virtual Vector const& GetPlayerViewOffset( bool ducked ) const = 0; 46 | virtual bool IsMovingPlayerStuck( void ) const = 0; 47 | virtual C_BasePlayer* GetMovingPlayer( void ) const = 0; 48 | virtual void UnblockPusher( C_BasePlayer *pPlayer, C_BasePlayer *pPusher ) = 0; 49 | virtual void SetupMovementBounds( CMoveData *pMove ) = 0; 50 | }; 51 | 52 | extern IGameMovement* g_pGameMovement; 53 | 54 | class CGameMovement 55 | : public IGameMovement 56 | { 57 | public: 58 | virtual ~CGameMovement( void ) {} 59 | }; 60 | 61 | class IPrediction 62 | { 63 | public: 64 | VFUNC( 18, GetLocalViewAngles( QAngle& ang ), void( __thiscall* )( void*, QAngle& ) )( ang ) 65 | VFUNC( 19, SetLocalViewAngles( QAngle& ang ), void( __thiscall* )( void*, QAngle& ) )( ang ) 66 | VFUNC( 14, InPrediction(), bool( __thiscall* )( void* ) )( ) 67 | VFUNC( 19, RunCommand( C_BasePlayer *player, CUserCmd *cmd, IMoveHelper *movehelper ), void( __thiscall* )( void*, C_BasePlayer*, CUserCmd *, IMoveHelper * ) )( player, cmd, movehelper ) 68 | VFUNC( 20, SetupMove( C_BasePlayer *player, CUserCmd *cmd, IMoveHelper *movehelper, void* movedata ), void( __thiscall* )( void*, C_BasePlayer *, CUserCmd *, IMoveHelper *, void* ) )( player, cmd, movehelper, movedata ) 69 | VFUNC( 21, FinishMove( C_BasePlayer *player, CUserCmd *cmd, void* movedata ), void( __thiscall* )( void*, C_BasePlayer *, CUserCmd *, void* ) )( player, cmd, movedata ) 70 | 71 | public: 72 | float GetIdealPitch( int nSlot ) const 73 | { 74 | if ( nSlot == -1 ) { Assert( 0 ); return 0.0f; } 75 | return m_Split[ nSlot ].m_flIdealPitch; 76 | } 77 | 78 | CBaseHandle m_hLastGround; 79 | 80 | bool m_bInPrediction; 81 | bool m_bOldCLPredictValue; 82 | bool m_bEnginePaused; 83 | 84 | int m_nPreviousStartFrame; 85 | int m_nIncomingPacketNumber; 86 | 87 | float m_flLastServerWorldTimeStamp; 88 | 89 | // Last network origin for local player 90 | struct Split_t 91 | { 92 | Split_t() 93 | { 94 | m_bFirstTimePredicted = false; 95 | m_nCommandsPredicted = 0; 96 | m_nServerCommandsAcknowledged = 0; 97 | m_bPreviousAckHadErrors = false; 98 | m_flIdealPitch = 0.0f; 99 | 100 | } 101 | 102 | bool m_bFirstTimePredicted; 103 | int m_nCommandsPredicted; 104 | int m_nServerCommandsAcknowledged; 105 | int m_bPreviousAckHadErrors; 106 | float m_flIdealPitch; 107 | }; 108 | 109 | Split_t m_Split[ 2 ]; 110 | }; 111 | 112 | extern IPrediction* g_pPrediction; -------------------------------------------------------------------------------- /internal_hvh/sdk/interfaces/IVDebugOverlay.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class OverlayText_t; 4 | 5 | class IVDebugOverlay 6 | { 7 | public: 8 | virtual void AddEntityTextOverlay( int ent_index, int line_offset, float duration, int r, int g, int b, int a, const char *format, ... ) = 0; 9 | virtual void AddBoxOverlay( const Vector& origin, const Vector& mins, const Vector& max, QAngle const& orientation, int r, int g, int b, int a, float duration ) = 0; 10 | virtual void AddSphereOverlay( const Vector& vOrigin, float flRadius, int nTheta, int nPhi, int r, int g, int b, int a, float flDuration ) = 0; 11 | virtual void AddTriangleOverlay( const Vector& p1, const Vector& p2, const Vector& p3, int r, int g, int b, int a, bool noDepthTest, float duration ) = 0; 12 | virtual void AddLineOverlay( const Vector& origin, const Vector& dest, int r, int g, int b, bool noDepthTest, float duration ) = 0; 13 | virtual void AddTextOverlay( const Vector& origin, float duration, const char *format, ... ) = 0; 14 | virtual void AddTextOverlay( const Vector& origin, int line_offset, float duration, const char *format, ... ) = 0; 15 | virtual void AddScreenTextOverlay( float flXPos, float flYPos, float flDuration, int r, int g, int b, int a, const char *text ) = 0; 16 | virtual void AddSweptBoxOverlay( const Vector& start, const Vector& end, const Vector& mins, const Vector& max, const QAngle & angles, int r, int g, int b, int a, float flDuration ) = 0; 17 | virtual void AddGridOverlay( const Vector& origin ) = 0; 18 | virtual void AddCoordFrameOverlay( const matrix3x4_t& frame, float flScale, int vColorTable[ 3 ][ 3 ] = NULL ) = 0; 19 | virtual int ScreenPosition( const Vector& point, Vector& screen ) = 0; 20 | virtual int ScreenPosition( float flXPos, float flYPos, Vector& screen ) = 0; 21 | virtual OverlayText_t* GetFirst( void ) = 0; 22 | virtual OverlayText_t* GetNext( OverlayText_t *current ) = 0; 23 | virtual void ClearDeadOverlays( void ) = 0; 24 | virtual void ClearAllOverlays( void ) = 0; 25 | virtual void AddTextOverlayRGB( const Vector& origin, int line_offset, float duration, float r, float g, float b, float alpha, const char *format, ... ) = 0; 26 | virtual void AddTextOverlayRGB( const Vector& origin, int line_offset, float duration, int r, int g, int b, int a, const char *format, ... ) = 0; 27 | virtual void AddLineOverlayAlpha( const Vector& origin, const Vector& dest, int r, int g, int b, int a, bool noDepthTest, float duration ) = 0; 28 | virtual void AddBoxOverlay2( const Vector& origin, const Vector& mins, const Vector& max, QAngle const& orientation, const uint8_t* faceColor, const uint8_t* edgeColor, float duration ) = 0; 29 | virtual void AddLineOverlay( const Vector& origin, const Vector& dest, int r, int g, int b, int a, float, float ) = 0; 30 | virtual void PurgeTextOverlays() = 0; 31 | VFUNC( 24, AddCapsuleOverlay( Vector& mins, Vector& maxs, float radius, int r, int g, int b, int a, float duration ), void( __thiscall* )( void*, Vector&, Vector&, float&, int, int, int, int, float ) )( mins, maxs, radius, r, g, b, a, duration ) 32 | VFUNC( 25, AddCapsuleOverlayVisible( Vector& mins, Vector& maxs, float radius, int r, int g, int b, int a, float duration ), void( __thiscall* )( void*, Vector&, Vector&, float&, int, int, int, int, float ) )( mins, maxs, radius, r, g, b, a, duration ) 33 | }; 34 | 35 | extern IVDebugOverlay* g_pDebugOverlay; -------------------------------------------------------------------------------- /internal_hvh/sdk/interfaces/IVModelRender.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct model_t 4 | { 5 | char name[ 255 ]; 6 | }; 7 | typedef unsigned short ModelInstanceHandle_t; 8 | 9 | enum modtype_t 10 | { 11 | mod_bad = 0, 12 | mod_brush, 13 | mod_sprite, 14 | mod_studio 15 | }; 16 | 17 | struct ModelRenderInfo_t 18 | { 19 | Vector origin; 20 | QAngle angles; 21 | void *pRenderable; 22 | const model_t *pModel; 23 | const matrix3x4_t *pModelToWorld; 24 | const matrix3x4_t *pLightingOffset; 25 | const Vector *pLightingOrigin; 26 | int flags; 27 | int entity_index; 28 | int skin; 29 | int body; 30 | int hitboxset; 31 | ModelInstanceHandle_t instance; 32 | ModelRenderInfo_t() 33 | { 34 | pModelToWorld = NULL; 35 | pLightingOffset = NULL; 36 | pLightingOrigin = NULL; 37 | } 38 | }; 39 | 40 | typedef void* StudioDecalHandle_t; 41 | 42 | struct studiohwdata_t; 43 | struct DrawModelState_t 44 | { 45 | studiohdr_t* m_pStudioHdr; 46 | studiohwdata_t* m_pStudioHWData; 47 | IClientRenderable* m_pRenderable; 48 | const matrix3x4_t *m_pModelToWorld; 49 | StudioDecalHandle_t m_decals; 50 | int m_drawFlags; 51 | int m_lod; 52 | }; 53 | 54 | class IMatRenderContext; 55 | class IVModelRender 56 | { 57 | public: 58 | VFUNC( 1, ForcedMaterialOverride( IMaterial *mat = nullptr, OverrideType_t type = OVERRIDE_NORMAL ), void( __thiscall* )( void*, IMaterial*, OverrideType_t, int ) )( mat, type, 0 ) 59 | VFUNC( 21, DrawModelExecute( IMatRenderContext* context, const DrawModelState_t& state, const ModelRenderInfo_t& info, matrix3x4_t* pCustomBoneToWorld = nullptr ), void( __thiscall* )( void*, IMatRenderContext*, const DrawModelState_t&, const ModelRenderInfo_t&, matrix3x4_t* ) )( context, state, info, pCustomBoneToWorld ) 60 | }; 61 | 62 | extern IVModelRender* g_pModelRender; -------------------------------------------------------------------------------- /internal_hvh/sdk/interfaces/IVPanel.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class IVPanel 4 | { 5 | public: 6 | VFUNC( 36, GetName( int panel ), const char*( __thiscall* )( void*, int ) )( panel ) 7 | }; 8 | 9 | extern IVPanel* g_pPanel; -------------------------------------------------------------------------------- /internal_hvh/sdk/interfaces/IViewRender.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class IViewRender 4 | { 5 | public: 6 | virtual void Init( void ) = 0; 7 | 8 | // Clear any systems between levels 9 | virtual void LevelInit( void ) = 0; 10 | virtual void LevelShutdown( void ) = 0; 11 | 12 | // Shutdown 13 | virtual void Shutdown( void ) = 0; 14 | 15 | // RENDERING 16 | // Called right before simulation. It must setup the view model origins and angles here so 17 | // the correct attachment points can be used during simulation. 18 | virtual void OnRenderStart() = 0; 19 | 20 | // Called to render the entire scene 21 | virtual void Render( void *rect ) = 0; 22 | 23 | // Called to render just a particular setup ( for timerefresh and envmap creation ) 24 | virtual void RenderView( const CViewSetup &view, int nClearFlags, int whatToDraw ) = 0; 25 | 26 | // What are we currently rendering? Returns a combination of DF_ flags. 27 | virtual int GetDrawFlags() = 0; 28 | 29 | // MISC 30 | // Start and stop pitch drifting logic 31 | virtual void StartPitchDrift( void ) = 0; 32 | virtual void StopPitchDrift( void ) = 0; 33 | }; 34 | 35 | extern IViewRender* g_pViewRender; -------------------------------------------------------------------------------- /internal_hvh/sdk/interfaces/IWeaponSystem.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class IWeaponSystem 4 | { 5 | virtual void unused0() = 0; 6 | virtual void unused1() = 0; 7 | public: 8 | virtual CCSWeaponData* GetWpnData( unsigned ItemDefinitionIndex ) = 0; 9 | }; 10 | 11 | extern IWeaponSystem* g_pWeaponSystem; -------------------------------------------------------------------------------- /internal_hvh/sdk/interfaces/interfaces.cpp: -------------------------------------------------------------------------------- 1 | #include "../..\include_cheat.h" 2 | 3 | IBaseClientDll* g_pClient = nullptr; 4 | IClientModeShared* g_pClientMode = nullptr; 5 | IClientEntityList* g_pEntitiyList = nullptr; 6 | IEngineClient* g_pEngine = nullptr; 7 | IPrediction* g_pPrediction = nullptr; 8 | IMoveHelper* g_pMoveHelper = nullptr; 9 | IGameMovement* g_pGameMovement = nullptr; 10 | IGlobalVarsBase* g_pGlobals = nullptr; 11 | IVModelInfo* g_pModelInfo = nullptr; 12 | IVModelRender* g_pModelRender = nullptr; 13 | IMaterialSystem* g_pMaterialSystem = nullptr; 14 | IVRenderView* g_pRenderView = nullptr; 15 | ICVar* g_pCVar = nullptr; 16 | IViewRender* g_pViewRender = nullptr; 17 | IViewRenderBeams* g_pBeams = nullptr; 18 | IInput* g_pInput = nullptr; 19 | IGameEventManager2* g_pGameEventManager = nullptr; 20 | IPhysicsSurfaceProps* g_pSurfaceProps = nullptr; 21 | IEngineTrace* g_pTrace = nullptr; 22 | IClientState* g_pClientState = nullptr; 23 | IVEffects* g_pEffects = nullptr; 24 | ISurface* g_pSurface = nullptr; 25 | IMemAlloc* g_pMemAlloc = nullptr; 26 | IVDebugOverlay* g_pDebugOverlay = nullptr; 27 | CGlowObjectManager* g_pGlowObjectManager = nullptr; 28 | IVPanel* g_pPanel = nullptr; 29 | IEngineSound* g_pEngineSound = nullptr; 30 | IWeaponSystem* g_pWeaponSystem = nullptr; 31 | CSInventoryManager* g_pCSInventoryManager = nullptr; 32 | ILocalize* g_pLocalize = nullptr; 33 | CHud* g_pHud = nullptr; 34 | SFHudDeathNoticeAndBotStatus* g_pDeathNotice = nullptr; 35 | C_CSPlayerResource** g_ppPlayerResource = nullptr; -------------------------------------------------------------------------------- /internal_hvh/sdk/interfaces/interfaces.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "IBaseClientDll.h" 4 | #include "IClientEntityList.h" 5 | #include "IClientModeShared.h" 6 | #include "IEngineClient.h" 7 | #include "IMoveHelper.h" 8 | #include "IPrediction.h" 9 | #include "IGlobalVarsBase.h" 10 | #include "IVModelInfo.h" 11 | #include "IVModelRender.h" 12 | #include "IMaterialSystem.h" 13 | #include "IMatRenderContext.h" 14 | #include "IVRenderView.h" 15 | #include "ICVar.h" 16 | #include "IViewRender.h" 17 | #include "IViewRenderBeams.h" 18 | #include "IInput.h" 19 | #include "IGameEventManager.h" 20 | #include "IPhysicsSurfaceProps.h" 21 | #include "IEngineTrace.h" 22 | #include "IClientState.h" 23 | #include "ISurface.h" 24 | #include "IMemAlloc.h" 25 | #include "IVDebugOverlay.h" 26 | #include "CGlowObjectManager.h" 27 | #include "IVPanel.h" 28 | #include "IWeaponSystem.h" 29 | #include "ILocalize.h" 30 | #include "CHud.h" 31 | #include "CSPlayerResource.h" -------------------------------------------------------------------------------- /internal_hvh/singleton.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | template 4 | class singleton 5 | { 6 | protected: 7 | singleton() {} 8 | ~singleton() {} 9 | 10 | singleton( const singleton& ) = delete; 11 | singleton& operator=( const singleton& ) = delete; 12 | 13 | singleton( singleton&& ) = delete; 14 | singleton& operator=( singleton&& ) = delete; 15 | 16 | public: 17 | static T& get() 18 | { 19 | static T inst{}; 20 | return inst; 21 | } 22 | }; 23 | -------------------------------------------------------------------------------- /internal_hvh/threadsafe_deque.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | template 6 | class msg_queue 7 | { 8 | public: 9 | // preventing implicit generation of move constructor 10 | ~msg_queue() {} 11 | 12 | void post( T&& msg ) 13 | { 14 | std::lock_guard lock( mtx ); 15 | queue.push_front( std::move( msg ) ); 16 | cond.notify_one(); 17 | } 18 | 19 | bool wait_for( T& msg, std::chrono::milliseconds time ) 20 | { 21 | std::unique_lock lock( mtx ); 22 | bool b = cond.wait_for( lock, time, [ this ] { return !queue.empty(); } ); 23 | if ( b ) 24 | { 25 | msg = std::move( queue.back() ); 26 | queue.pop_back(); 27 | return true; 28 | } 29 | else 30 | { 31 | return false; 32 | } 33 | } 34 | 35 | unsigned int size() 36 | { 37 | std::lock_guard lock( mtx ); 38 | return queue.size(); 39 | } 40 | 41 | void clear() 42 | { 43 | std::lock_guard lock( mtx ); 44 | queue.clear(); 45 | } 46 | 47 | private: 48 | std::deque queue; 49 | std::condition_variable cond; 50 | std::mutex mtx; 51 | }; 52 | --------------------------------------------------------------------------------