├── internal_hvh.sln └── internal_hvh ├── CMakeLists.txt ├── DLLMain.cpp ├── cthash.h ├── features ├── aimbot.cpp ├── aimbot.h ├── aimbot_helpers.cpp ├── aimbot_helpers.h ├── 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 ├── entity_rendering.cpp ├── entity_rendering.h ├── flashlight.cpp ├── flashlight.h ├── freestanding.cpp ├── freestanding.h ├── gamemovement.h ├── glow.cpp ├── glow.h ├── grenade_pred.cpp ├── grenade_pred.h ├── hitmarker.cpp ├── hitmarker.h ├── hitscan.cpp ├── hitscan.h ├── include_features.h ├── inventorychanger.cpp ├── inventorychanger.h ├── knifebot.cpp ├── knifebot.h ├── lag_compensation.cpp ├── lag_compensation.h ├── legit.cpp ├── legit.h ├── misc.cpp ├── misc.h ├── mt.cpp ├── mt.h ├── player_log.cpp ├── player_log.h ├── playerperf.cpp ├── playerperf.h ├── prediction.cpp ├── prediction.h ├── resolver.cpp ├── resolver.h ├── shared_data.cpp ├── shared_data.h ├── skinchanger.cpp ├── skinchanger.h ├── sound_esp.cpp ├── sound_esp.h ├── structs.h ├── thirdperson.cpp ├── thirdperson.h ├── tickbase.cpp ├── tickbase.h ├── visuals.cpp ├── visuals.h ├── wall_penetration.cpp └── wall_penetration.h ├── hooks ├── con_vars.cpp ├── create_move.cpp ├── do_post_screen_space_effects.cpp ├── draw_model_execute.cpp ├── emit_sound.cpp ├── estimate_abs_velocity.cpp ├── find_material.cpp ├── frame_stage_notify.cpp ├── hooks.h ├── is_box_visible.cpp ├── is_connected.cpp ├── level_init_post_entity.cpp ├── level_shutdown.cpp ├── lua.cpp ├── misc.cpp ├── net_props.cpp ├── override_view.cpp ├── packet_start.cpp ├── paint_traverse.cpp ├── physics_simulate.cpp ├── player.cpp ├── present.cpp ├── process_input.cpp ├── render_view.cpp ├── reset.cpp ├── run_command.cpp ├── scene_end.cpp ├── sequence.cpp ├── setup_bones_calls.cpp └── wnd_proc.cpp ├── include_cheat.h ├── includes.h ├── internal_hvh.vcxproj ├── internal_hvh.vcxproj.filters ├── internal_hvh.vcxproj.user ├── josefin_sans.h ├── jost.h ├── md5.cpp ├── md5.h ├── menu ├── effects.cpp ├── effects.h ├── elements │ ├── alpha_slider.cpp │ ├── alpha_slider.h │ ├── button.cpp │ ├── button.h │ ├── checkbox.cpp │ ├── checkbox.h │ ├── child.cpp │ ├── child.h │ ├── combobox.cpp │ ├── combobox.h │ ├── control.cpp │ ├── control.h │ ├── glitch_text.cpp │ ├── glitch_text.h │ ├── hue_slider.cpp │ ├── hue_slider.h │ ├── listbox.cpp │ ├── listbox.h │ ├── pad.h │ ├── slider.cpp │ ├── slider.h │ ├── sub_controls │ │ ├── color_picker.cpp │ │ ├── color_picker.h │ │ ├── key_bind.cpp │ │ ├── key_bind.h │ │ └── sub_control.h │ ├── sub_tab.cpp │ ├── sub_tab.h │ ├── tab.cpp │ ├── tab.h │ ├── text_box.cpp │ ├── text_box.h │ ├── weapon_tab.cpp │ ├── weapon_tab.h │ ├── window.cpp │ └── window.h ├── menu.cpp ├── menu.h └── menu_include.h ├── misc ├── MinHook.h ├── StackTracer.cpp ├── StackTracer.h ├── WinReg.hpp ├── aes256.cpp ├── aes256.h ├── config.cpp ├── config.h ├── crc.h ├── d3dfont.cpp ├── d3dfont.h ├── datamap.h ├── defs.h ├── dx_adapter.cpp ├── dx_adapter.h ├── globals.cpp ├── globals.h ├── gzip │ ├── compress.hpp │ ├── config.hpp │ ├── decompress.hpp │ ├── utils.hpp │ └── version.hpp ├── hitsounds.h ├── hooks.cpp ├── hybrid_hook.h ├── init.cpp ├── init.h ├── input.cpp ├── input.h ├── intersection.h ├── intrinsics.h ├── ipc.h ├── json.hpp ├── libMinHook-x86-v141-mt.lib ├── libMinHook-x86-v141-mtd.lib ├── listeners.cpp ├── listeners.h ├── math.cpp ├── math.h ├── memory.h ├── monocypher.c ├── monocypher.h ├── netvars.h ├── networking │ ├── connector.cpp │ ├── connector.h │ ├── include │ │ ├── data.h │ │ └── session.h │ ├── net_offsets.cpp │ ├── net_offsets.h │ └── src │ │ ├── crypto │ │ ├── helpers.cpp │ │ ├── helpers.h │ │ ├── ssl.cpp │ │ ├── ssl.h │ │ ├── ssl_context.cpp │ │ └── ssl_context.h │ │ └── session.cpp ├── offsets.h ├── profiler.h ├── protection.h ├── render.cpp ├── render.h ├── renderer │ ├── include │ │ ├── deps │ │ │ └── stb │ │ │ │ ├── stb_image.h │ │ │ │ ├── stb_rect_pack.h │ │ │ │ └── stb_truetype.h │ │ └── ren │ │ │ ├── adapter.h │ │ │ ├── adapter_dx11.h │ │ │ ├── adapter_dx9.h │ │ │ ├── adapter_gl2.h │ │ │ ├── adapter_gl3.h │ │ │ ├── anim.h │ │ │ ├── bitfont.h │ │ │ ├── command.h │ │ │ ├── font.h │ │ │ ├── layer.h │ │ │ ├── misc.h │ │ │ ├── renderer.h │ │ │ ├── texture.h │ │ │ ├── types.h │ │ │ └── vertex.h │ └── src │ │ ├── adapter_dx11.cpp │ │ ├── adapter_dx9.cpp │ │ ├── adapter_gl2.cpp │ │ ├── adapter_gl3.cpp │ │ ├── bitfont.cpp │ │ ├── command.cpp │ │ ├── font.cpp │ │ ├── layer.cpp │ │ ├── renderer.cpp │ │ └── texture.cpp ├── tsl │ ├── robin_growth_policy.h │ ├── robin_hash.h │ ├── robin_map.h │ └── robin_set.h ├── util.cpp ├── util.h ├── vm.hpp └── zip_file.hpp ├── sdk ├── CBoneChache.h ├── CCSGOPlayerAnimState.h ├── CCSGameRulesProxy.h ├── CMergedMDL.h ├── CNetChannel.h ├── ClientClass.h ├── ConVar.h ├── IClientEntity.h ├── IMaterial.h ├── IMaterialVar.h ├── INetChannelInfo.h ├── IRefCounted.h ├── KeyValues.cpp ├── KeyValues.h ├── checksum_md5.cpp ├── checksum_md5.h ├── datatypes │ ├── CUtlVector.h │ ├── Color.h │ ├── QAngle.h │ ├── VMatrix.h │ ├── Vector.cpp │ ├── Vector.h │ ├── Vector2D.h │ ├── Vector4D.h │ ├── include_datatypes.h │ ├── matrix3x3_t.h │ └── matrix3x4_t.h ├── defines.h ├── econ_item.h ├── entity_classes.cpp ├── entity_classes.h ├── include_sdk.h ├── interfaces │ ├── CGlowObjectManager.cpp │ ├── CGlowObjectManager.h │ ├── CHud.h │ ├── CSPlayerResource.h │ ├── IBaseClientDll.h │ ├── IBaseFileSystem.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 │ ├── IStudioRender.h │ ├── ISurface.h │ ├── IToolEntity.h │ ├── IVDebugOverlay.h │ ├── IVEffects.h │ ├── IVModelInfo.h │ ├── IVModelRender.h │ ├── IVPanel.h │ ├── IVRenderView.h │ ├── IViewRender.h │ ├── IViewRenderBeams.h │ ├── IWeaponSystem.h │ └── interfaces.h ├── misc.h ├── networkstringtable.h ├── panorama.h ├── structs.h ├── trace_ray.cpp └── trace_ray.h ├── smallest_pixel.h ├── space_texture.h ├── threadsafe_deque.h └── weaponicons.h /internal_hvh.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 12.00 2 | # Visual Studio Version 17 3 | VisualStudioVersion = 17.0.31606.5 4 | MinimumVisualStudioVersion = 10.0.40219.1 5 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "internal_hvh", "internal_hvh\internal_hvh.vcxproj", "{D1F5161A-D2FA-4BAB-9D72-F167448AA9C1}" 6 | EndProject 7 | Global 8 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 9 | Debug|x64 = Debug|x64 10 | Debug|x86 = Debug|x86 11 | Prerelease|x64 = Prerelease|x64 12 | Prerelease|x86 = Prerelease|x86 13 | Release|x64 = Release|x64 14 | Release|x86 = Release|x86 15 | ReleaseSymbols|x64 = ReleaseSymbols|x64 16 | ReleaseSymbols|x86 = ReleaseSymbols|x86 17 | EndGlobalSection 18 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 19 | {D1F5161A-D2FA-4BAB-9D72-F167448AA9C1}.Debug|x64.ActiveCfg = Debug|x64 20 | {D1F5161A-D2FA-4BAB-9D72-F167448AA9C1}.Debug|x64.Build.0 = Debug|x64 21 | {D1F5161A-D2FA-4BAB-9D72-F167448AA9C1}.Debug|x86.ActiveCfg = Debug|Win32 22 | {D1F5161A-D2FA-4BAB-9D72-F167448AA9C1}.Debug|x86.Build.0 = Debug|Win32 23 | {D1F5161A-D2FA-4BAB-9D72-F167448AA9C1}.Prerelease|x64.ActiveCfg = Prerelease|x64 24 | {D1F5161A-D2FA-4BAB-9D72-F167448AA9C1}.Prerelease|x64.Build.0 = Prerelease|x64 25 | {D1F5161A-D2FA-4BAB-9D72-F167448AA9C1}.Prerelease|x86.ActiveCfg = Prerelease|Win32 26 | {D1F5161A-D2FA-4BAB-9D72-F167448AA9C1}.Prerelease|x86.Build.0 = Prerelease|Win32 27 | {D1F5161A-D2FA-4BAB-9D72-F167448AA9C1}.Release|x64.ActiveCfg = Release|x64 28 | {D1F5161A-D2FA-4BAB-9D72-F167448AA9C1}.Release|x64.Build.0 = Release|x64 29 | {D1F5161A-D2FA-4BAB-9D72-F167448AA9C1}.Release|x86.ActiveCfg = Release|Win32 30 | {D1F5161A-D2FA-4BAB-9D72-F167448AA9C1}.Release|x86.Build.0 = Release|Win32 31 | {D1F5161A-D2FA-4BAB-9D72-F167448AA9C1}.ReleaseSymbols|x64.ActiveCfg = ReleaseSymbols|x64 32 | {D1F5161A-D2FA-4BAB-9D72-F167448AA9C1}.ReleaseSymbols|x64.Build.0 = ReleaseSymbols|x64 33 | {D1F5161A-D2FA-4BAB-9D72-F167448AA9C1}.ReleaseSymbols|x86.ActiveCfg = ReleaseSymbols|Win32 34 | {D1F5161A-D2FA-4BAB-9D72-F167448AA9C1}.ReleaseSymbols|x86.Build.0 = ReleaseSymbols|Win32 35 | EndGlobalSection 36 | GlobalSection(SolutionProperties) = preSolution 37 | HideSolutionNode = FALSE 38 | EndGlobalSection 39 | GlobalSection(ExtensibilityGlobals) = postSolution 40 | SolutionGuid = {FB732B27-F00F-4F23-8A30-2F871494CC54} 41 | EndGlobalSection 42 | EndGlobal 43 | -------------------------------------------------------------------------------- /internal_hvh/DLLMain.cpp: -------------------------------------------------------------------------------- 1 | #include "include_cheat.h" 2 | 3 | #include "misc/MinHook.h" 4 | #include "misc/protection.h" 5 | 6 | extern "C" _PIFV * __xi_a; 7 | extern "C" _PIFV * __xi_z; 8 | extern "C" _PVFV * __xc_a; 9 | extern "C" _PVFV * __xc_z; 10 | 11 | void __stdcall init_main() 12 | { 13 | init::on_startup(); 14 | } 15 | 16 | thread_local static std::string test = "---------- "; 17 | 18 | BOOL APIENTRY DllMain( HMODULE h_module, uintptr_t dw_reason_for_call, LPVOID lp_reserved ) 19 | { 20 | switch ( dw_reason_for_call ) 21 | { 22 | case DLL_PROCESS_ATTACH: 23 | { 24 | _( logfile, "flog.log" ); 25 | std::ofstream of( logfile, std::ofstream::out | std::ofstream::trunc ); 26 | of.close(); 27 | log( "start --------" ); 28 | 29 | util::print_log( test.c_str() ); 30 | 31 | log( "\n" ); 32 | 33 | textstart = reinterpret_cast< uint32_t >( globals::module_base = h_module ); 34 | imp( "kernel32.dll", DisableThreadLibraryCalls )( h_module ); 35 | 36 | #ifdef RELEASE 37 | HANDLE thread; 38 | syscall( NtCreateThreadEx )( &thread, MAXIMUM_ALLOWED, nullptr, current_process, 39 | &init_main, nullptr, 0x40 | THREAD_CREATE_FLAGS_HIDE_FROM_DEBUGGER, NULL, NULL, NULL, nullptr ); 40 | sysunlock(); 41 | #else 42 | DWORD tid; 43 | CloseHandle( CreateThread( nullptr, 0, reinterpret_cast< LPTHREAD_START_ROUTINE >( init_main ), nullptr, 0, &tid ) ); 44 | #endif 45 | return true; 46 | } 47 | default: 48 | return true; 49 | } 50 | } -------------------------------------------------------------------------------- /internal_hvh/features/aimbot_helpers.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace aimbot_helpers 4 | { 5 | struct choked_shot_t 6 | { 7 | choked_shot_t( QAngle angles, resolver::shot_t shot ) 8 | { 9 | this->manual = true; 10 | this->shot = shot; 11 | this->angles = angles; 12 | this->tickcount = -1; 13 | } 14 | choked_shot_t( QAngle angles, int tickcount, resolver::shot_t shot ) 15 | { 16 | this->manual = false; 17 | this->shot = shot; 18 | this->angles = angles; 19 | this->tickcount = tickcount; 20 | } 21 | bool manual = false; 22 | QAngle angles{}; 23 | int tickcount = -1; 24 | resolver::shot_t shot{}; 25 | }; 26 | 27 | void no_recoil( CUserCmd* cmd = globals::current_cmd ); 28 | void no_visual_recoil( CViewSetup& v_view ); 29 | bool autorevolver( C_WeaponCSBaseGun* weapon ); 30 | void slide_stop( CUserCmd* cmd = globals::current_cmd ); 31 | void stop_to_speed( float speed, CUserCmd* cmd = globals::current_cmd ); 32 | void stop_to_speed( float speed, CMoveData* data, C_CSPlayer* player = local_player ); 33 | void draw_debug_hitboxes( C_CSPlayer* player, matrix3x4_t* matrices, int hitbox, float duration, Color color = Color::Green() ); 34 | void remove_spread( CUserCmd* cmd = globals::current_cmd ); 35 | void manage_lagcomp(); 36 | float get_lowest_inaccuracy( C_WeaponCSBaseGun* weapon ); 37 | bool highest_accuracy( C_WeaponCSBaseGun* weapon, bool check_landing = false ); 38 | void build_seed_table(); 39 | std::tuple calc_hc( std::vector>& intersections, QAngle vangles, lag_record_t& record ); 40 | float calc_penhc( aimbot::final_target_t* target, const bool skip_full = false, const bool maximum = false ); 41 | void check_corner_hitpoint( aimbot::final_target_t& target ); 42 | bool get_current_autostop(); 43 | bool should_autostop( const aimbot::final_target_t& final_target ); 44 | float get_final_hitchance( C_WeaponCSBaseGun* weapon, const int index ); 45 | bool check_hitchance( aimbot::final_target_t& final_target ); 46 | bool check_max_hitchance( aimbot::final_target_t& final_target ); 47 | 48 | inline int tick_cocked = {}; 49 | inline int tick_strip = {}; 50 | inline std::vector> precomputed_seeds = {}; 51 | }; -------------------------------------------------------------------------------- /internal_hvh/features/animations.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace animations 4 | { 5 | struct anim_state_info_t 6 | { 7 | CBaseHandle handle; 8 | float spawn_time; 9 | CCSGOPlayerAnimState* animstate; 10 | float animvel; 11 | std::array poses; 12 | }; 13 | 14 | float get_yaw_modifier( C_CSPlayer* player, const Vector& velocity, float duckamt, const CCSGOPlayerAnimState* state ); 15 | void calculate_sim_ticks( lag_record_t* record, C_CSPlayer* player, lag_record_t* previous ); 16 | void update_player_animations( lag_record_t* record, C_CSPlayer* player, lag_record_t* previous ); 17 | bool local_bone_setup( lag_record_t& record, bool ignore_check = false ); 18 | void move_matrix( matrix3x4_t* matrix, Vector& orig_pos, Vector new_pos ); 19 | Vector get_headpos(); 20 | void build_fake_animation(); 21 | void play_additional_animations( CUserCmd* cmd, const CCSGOPlayerAnimState& pred_state, lag_record_t* record, int seed = time_to_ticks( interfaces::globals()->curtime ) ); 22 | std::pair> predict_animation_state( C_CSPlayer* player ); 23 | void predict_animation_state( lag_record_t& record, C_CSPlayer* player, int times, bool force_angle = false ); 24 | void update_animations( lag_record_t* record, CUserCmd* cmd = nullptr, bool tickbase_drift = false ); 25 | void restore_animation( int32_t sequence ); 26 | void merge_local_animation( CUserCmd* cmd, C_CSPlayer* player ); 27 | void update_addon_bits( C_CSPlayer* player ); 28 | void replace_server_model( bool start ); 29 | 30 | inline lag_record_t fake_record = {}; 31 | inline lag_record_t local_record = {}; 32 | inline lag_record_t hittable_record = {}; 33 | inline std::pair lag = {}; 34 | inline std::pair most_recent = {}; 35 | 36 | struct animation_copy 37 | { 38 | animation_copy() = default; 39 | 40 | animation_copy( int32_t seq ) 41 | { 42 | if ( local_player->get_anim_state()->last_update <= 0.f ) 43 | return; 44 | 45 | sequence = seq; 46 | checksum = interfaces::input()->m_pVerifiedCommands[ sequence % 150 ].m_crc; 47 | state = *local_player->get_anim_state(); 48 | addon = local_record.addon; 49 | client_layers = layers = local_player->get_anim_layers(); 50 | poses = local_player->get_pose_params(); 51 | lower_body_yaw_target = local_player->get_lby(); 52 | is_strafing = local_player->get_strafing(); 53 | eye_angles = *local_player->eye_angles_virtual(); 54 | } 55 | 56 | void restore( C_CSPlayer* player ) const 57 | { 58 | const auto bak = *player->get_anim_state(); 59 | *player->get_anim_state() = state; 60 | bak.copy_meta( player->get_anim_state() ); 61 | local_record.addon = addon; 62 | player->get_anim_layers() = layers; 63 | player->get_pose_params() = poses; 64 | player->get_lby() = lower_body_yaw_target; 65 | } 66 | 67 | int32_t sequence = INT_MAX; 68 | int32_t checksum = INT_MAX; 69 | CCSGOPlayerAnimState state{}; 70 | addons_t addon{}; 71 | std::array layers{}; 72 | std::array client_layers{}; 73 | std::array poses{}; 74 | float lower_body_yaw_target{}; 75 | int32_t remaining_choke{}; 76 | bool is_strafing{}; 77 | QAngle eye_angles{}; 78 | }; 79 | }; 80 | -------------------------------------------------------------------------------- /internal_hvh/features/antiaim.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace antiaim 4 | { 5 | void run(); 6 | void run_lag(); 7 | void run_on_send(); 8 | void fake_duck(); 9 | void fix_movement( CUserCmd* cmd = globals::current_cmd ); 10 | bool get_antiaim_state(); 11 | void do_jitter( float& yaw ); 12 | bool in_fakeduck(); 13 | bool started_peek_fakelag(); //DANGER!! changes return value for next call; 14 | bool check_hittable(); 15 | bool check_server_hittable(); 16 | std::pair check_knife_round(); 17 | bool check_in_defuse_range( Vector* pos = nullptr ); 18 | void fake_lag(); 19 | bool on_peek_fakelag( bool& notarget ); 20 | void do_spin( float& yaw ); 21 | void do_add( float& yaw ); 22 | float get_lean( float target_direction, float target_angle ); 23 | float get_wish_speed( CUserCmd* const cmd ); 24 | 25 | bool do_edge( float& yaw ); 26 | void do_at_target( float& yaw ); 27 | 28 | inline int to_choke = {}; 29 | inline float anim_vel = {}; 30 | inline float lby_update = {}; 31 | inline float next_lby_update = {}; 32 | inline bool in_flip = {}; 33 | inline float fake_direction = {}; 34 | inline float real_direction = {}; 35 | inline QAngle target_angle = {}; 36 | 37 | inline int antiaim_called = {}; 38 | inline float fakeduck_called = {}; 39 | inline bool started_fakelag = {}; 40 | inline bool fakelag_next = {}; 41 | inline bool in_fakelag = {}; 42 | inline bool in_onpeek = {}; 43 | inline bool in_skip_animation = {}; 44 | inline QAngle wish_angles[ 150 ] = {}; 45 | inline bool has_animstate = {}; 46 | 47 | //lua 48 | inline bool run_antiaim = {}; 49 | inline float current_lean = 0.f; 50 | inline int to_lag = {}; 51 | 52 | inline void reset() 53 | { 54 | antiaim_called = 0.f; 55 | has_animstate = false; 56 | in_fakelag = false; 57 | started_fakelag = false; 58 | fakeduck_called = 0.f; 59 | fakelag_next = false; 60 | in_onpeek = false; 61 | in_skip_animation = false; 62 | } 63 | }; 64 | -------------------------------------------------------------------------------- /internal_hvh/features/autostrafer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace autostrafer 4 | { 5 | void strafe(); 6 | inline float old_yaw{}; 7 | }; 8 | -------------------------------------------------------------------------------- /internal_hvh/features/beams.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace beams 4 | { 5 | struct impact_info_t 6 | { 7 | Vector start{}; 8 | Vector pos{}; 9 | Color color; 10 | int index; 11 | float time; 12 | 13 | impact_info_t( const float time, const Vector start, const Vector pos, const int index, const Color col = Color::White() ) 14 | { 15 | this->index = index; 16 | this->start = start; 17 | this->pos = pos; 18 | this->color = col; 19 | this->time = time; 20 | } 21 | float length() const 22 | { 23 | return start.Dist( this->pos ); 24 | } 25 | bool equal( const impact_info_t& info ) const 26 | { 27 | if ( this->index != info.index ) 28 | return false; 29 | 30 | if ( this->time != info.time ) 31 | return false; 32 | 33 | return true; 34 | } 35 | }; 36 | 37 | void draw_impacts(); 38 | void listener( IGameEvent * game_event ); 39 | void add_local_beam( impact_info_t info ); 40 | bool beam_exists( C_CSPlayer* player, const float curtime ); 41 | void add_beacon( const Vector & origin ); 42 | 43 | inline std::deque impacts = {}; 44 | inline std::deque beacons = {}; 45 | }; 46 | -------------------------------------------------------------------------------- /internal_hvh/features/bone_setup.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CBoneAccessor 4 | { 5 | public: 6 | matrix3x4_t* get_bone_array_for_write( void ) const 7 | { 8 | return m_pBones; 9 | } 10 | void set_bone_array_for_write( matrix3x4_t* bonearray ) 11 | { 12 | m_pBones = bonearray; 13 | } 14 | alignas( 16 ) matrix3x4_t* m_pBones; 15 | 16 | int m_ReadableBones; // Which bones can be read. 17 | int m_WritableBones; // Which bones can be written. 18 | }; 19 | 20 | namespace bone_setup 21 | { 22 | bool handle_bone_setup( lag_record_t& record, resolver_direction state, bool lean = false, bool extrapolated = false ); 23 | bool perform_bone_setup( lag_record_t& record, resolver_direction state, bool lean = false ); 24 | }; 25 | 26 | -------------------------------------------------------------------------------- /internal_hvh/features/chams.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | typedef unsigned short ModelInstanceHandle_t; 4 | namespace chams 5 | { 6 | struct ghost_t 7 | { 8 | int index{}; 9 | IClientRenderable* renderable{}; 10 | state_info state; 11 | Vector origin{}; 12 | QAngle abs_ang{}; 13 | float time{}; 14 | int skin{}; 15 | int body{}; 16 | int hitboxset{}; 17 | model_t* model{}; 18 | }; 19 | 20 | void dormant_chams(); 21 | void extend_drawing( ClientFrameStage_t stage ); 22 | bool run( IMatRenderContext* context, DrawModelState_t& state, ModelRenderInfo_t& info, matrix3x4_t* custom_bone_to_world ); 23 | void add_material( material_index_t idx, const std::string& shade, const std::string& material ); 24 | void add_material( material_index_t idx, const std::string& material ); 25 | bool get_interp_matrix( const player_log_t& log, matrix3x4_t* out ); 26 | bool draw_hst( const player_log_t& log, matrix3x4_t* out ); 27 | bool draw_ragdoll_chams( IMatRenderContext* context, DrawModelState_t& state, ModelRenderInfo_t& info, matrix3x4_t* pCustomBoneToWorld ); 28 | bool draw_arm_chams( IMatRenderContext* context, DrawModelState_t& state, ModelRenderInfo_t& info, matrix3x4_t* pCustomBoneToWorld ); 29 | bool draw_attachment_chams( IMatRenderContext* context, DrawModelState_t& state, ModelRenderInfo_t& info, matrix3x4_t* pCustomBoneToWorld ); 30 | void apply_material( int type, Color& col1, Color& col2, float transparency, bool hidden ); 31 | void handle_player( C_CSPlayer* player, bool hidden = false, bool fake = false, int override_type = -1 ); 32 | int get_type( C_CSPlayer* player, bool fake = false ); 33 | int get_type( int preview_type ); 34 | int get_attachment_type( int preview_type ); 35 | bool draw_player_chams( IMatRenderContext* context, DrawModelState_t& state, ModelRenderInfo_t& info, matrix3x4_t* pCustomBoneToWorld ); 36 | void draw_death_ghost(); 37 | void add_ghost( C_CSPlayer* player, lag_record_t* record ); 38 | void dark_mode( const int stage ); 39 | void handle_preview( const bool hidden, int override_type = -1 ); 40 | void handle_preview_attachments( int override_type = -1 ); 41 | 42 | void set_skybox(); 43 | void set_vgui( bool on ); 44 | 45 | inline bool m_rerun_nightmode = true; 46 | inline IMaterial* materials[ material_index_t::NUM_MATERIALS ]{}; 47 | inline std::vectorghosts = {}; 48 | 49 | inline draw_model_ent_t draw_model_ent = {}; 50 | inline bool in_glow; 51 | 52 | inline std::vector skyboxes = { 53 | 54 | _w( "sky_csgo_cloudy01" ), 55 | _w( "sky_csgo_night02" ), 56 | _w( "sky_csgo_night02b" ), 57 | _w( "cs_baggage_skybox_" ), 58 | _w( "cs_tibet" ), 59 | _w( "vietnam" ), 60 | _w( "sky_lunacy" ), 61 | _w( "embassy" ), 62 | _w( "italy" ), 63 | _w( "jungle" ), 64 | _w( "office" ), 65 | _w( "sky_cs15_daylight01_hdr" ), 66 | _w( "sky_cs15_daylight02_hdr" ), 67 | _w( "sky_day02_05" ), 68 | _w( "nukeblank" ), 69 | _w( "dustblank" ), 70 | _w( "sky_venice" ), 71 | _w( "sky_cs15_daylight03_hdr" ), 72 | _w( "sky_cs15_daylight04_hdr" ), 73 | _w( "vertigo" ), 74 | _w( "vertigoblue_hdr" ), 75 | _w( "sky_dust" ), 76 | _w( "sky_hr_aztec" ), 77 | }; 78 | }; 79 | -------------------------------------------------------------------------------- /internal_hvh/features/console_log.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace console_log 4 | { 5 | 6 | void buy_event( IGameEvent* game_event ); 7 | void hurt_event( IGameEvent* game_event, record_shot_info_t& shot_info ); 8 | void listener( IGameEvent * game_event, record_shot_info_t& shot_info ); 9 | 10 | inline bool m_in_print = false; 11 | }; 12 | -------------------------------------------------------------------------------- /internal_hvh/features/entity_rendering.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace entity_rendering 4 | { 5 | void paint(); 6 | bool world_to_screen( const Vector& in, Vector& out ); 7 | bool screen_transform( const Vector& in, Vector& out ); 8 | 9 | inline ITexture* preview_texture = nullptr; 10 | inline ITexture* cubemap_texture = nullptr; 11 | inline C_MergedMDL* preview_model = nullptr; 12 | 13 | inline CViewSetup view_setup = {}; 14 | 15 | inline matrix3x4_t preview_matrix[ 128 ]{}; 16 | inline VMatrix world_to_projection{}; 17 | inline Vector2D preview_pos{}; 18 | 19 | inline bool player_render = false; 20 | inline bool is_setup = false; 21 | 22 | inline constexpr std::array white = 23 | { 24 | 1.0f, 25 | 1.0f, 26 | 1.0f 27 | }; 28 | 29 | inline std::array light_col1 = 30 | { 31 | Vector4D{ 0.68f, 1.53f, 1.7f, 1.f }, 32 | Vector4D( 0.68f, 1.53f, 1.7f, 1.f ), 33 | Vector4D( 0.68f, 1.53f, 1.7f, 1.f ), 34 | Vector4D( 0.68f, 1.53f, 1.7f, 1.f ), 35 | Vector4D( 0.68f, 1.53f, 1.7f, 1.f ), 36 | Vector4D( 0.68f, 1.53f, 1.7f, 1.f ), 37 | }; 38 | 39 | inline std::array light_col2 = 40 | { 41 | Vector4D( 0.68f, 0.68f, 0.68f, 3.7f ), 42 | Vector4D( 0.68f, 0.68f, 0.68f, 3.7f ), 43 | Vector4D( 0.68f, 0.68f, 0.68f, 3.7f ), 44 | Vector4D( 0.68f, 0.68f, 0.68f, 3.7f ), 45 | Vector4D( 0.68f, 0.68f, 0.68f, 3.7f ), 46 | Vector4D( 0.68f, 0.68f, 0.68f, 3.7f ), 47 | }; 48 | }; -------------------------------------------------------------------------------- /internal_hvh/features/flashlight.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | #ifdef DEBUG 4 | 5 | void flashlight::run() 6 | { 7 | if ( !interfaces::engine()->IsInGame() || !interfaces::engine()->IsConnected() || !local_player || !local_player->get_alive() || !vars::visuals.flashlight->get() ) 8 | { 9 | if ( m_flashlight ) 10 | destroy(); 11 | 12 | return; 13 | } 14 | 15 | //_( flashlight001, "effects/flashlight001" ); 16 | create( local_player->EntIndex(), nullptr, 35, 1000, 1000 ); 17 | if ( !m_flashlight ) 18 | return; 19 | 20 | Vector f{}, r{}, u{}; 21 | QAngle viewAngles{}; 22 | 23 | interfaces::engine()->GetViewAngles( viewAngles ); 24 | math::angle_vectors( viewAngles, &f, &r, &u ); 25 | 26 | m_flashlight->m_bIsOn = true; 27 | m_flashlight->m_bCastsShadows = true; 28 | m_flashlight->m_flCurrentPullBackDist = 1.f; 29 | m_flashlight->m_flFov = vars::visuals.flashlight_radius->get(); 30 | update( local_player->get_eye_pos(), f, r, u ); 31 | } 32 | 33 | void flashlight::create( int ent_index, const char* name, float fov, float far_z, float lin_atten ) 34 | { 35 | // Already created ? 36 | if ( m_flashlight ) 37 | return; 38 | 39 | // 1. xref -> "effects/flashlight_freezecam" 40 | static auto func = reinterpret_cast< CFlashLightEffect * ( __vectorcall* )( void*, void*, float, float, float, float, int, const char*, float, float ) >( sig( "client.dll", "55 8B EC F3 0F 10 45 ? B8" ) ); 41 | 42 | auto new_flashlight = reinterpret_cast< CFlashLightEffect* >( interfaces::memalloc()->Alloc( sizeof( CFlashLightEffect ) ) ); 43 | if ( !new_flashlight ) 44 | return; 45 | 46 | func( new_flashlight, nullptr, 0.f, 0.f, 0.f, fov, ent_index, name, far_z, lin_atten ); 47 | 48 | m_flashlight = new_flashlight; 49 | } 50 | 51 | void flashlight::destroy() 52 | { 53 | // Already destroyed ? 54 | if ( !m_flashlight ) 55 | return; 56 | 57 | // 1 - 4. xref -> "FlashlightState" 58 | // 2 - 1. xref func 59 | static auto func = reinterpret_cast< void( __thiscall* )( void*, void* ) >( sig( "client.dll", "56 8B F1 E8 ? ? ? ? 8B 4E 28" ) ); 60 | ; 61 | m_flashlight->m_bIsOn = false; 62 | func( m_flashlight, m_flashlight ); 63 | m_flashlight = nullptr; 64 | } 65 | 66 | void flashlight::update( const Vector& pos, const Vector& forward, const Vector& right, const Vector& up ) 67 | { 68 | if ( !m_flashlight ) 69 | return; 70 | 71 | typedef void( __thiscall* update_light_t )( void*, int, const Vector&, const Vector&, const Vector&, const Vector&, float, float, float, bool, const char* ); 72 | static update_light_t orig = reinterpret_cast< update_light_t >( sig_rel( "client.dll", "E8 ? ? ? ? 8B 06 F3 0F 10 46" ) ); 73 | 74 | orig( m_flashlight, m_flashlight->m_nEntIndex, pos, forward, right, up, m_flashlight->m_flFov, m_flashlight->m_flFarZ, m_flashlight->m_flLinearAtten, m_flashlight->m_bCastsShadows, m_flashlight->m_szTextureName ); 75 | } 76 | 77 | #endif -------------------------------------------------------------------------------- /internal_hvh/features/flashlight.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CFlashLightEffect 4 | { 5 | public: 6 | bool m_bIsOn; //0x0000 7 | char pad_0x0001[ 0x3 ]; //0x0001 8 | int m_nEntIndex; //0x0004 9 | WORD m_FlashLightHandle; //0x0008 10 | char pad_0x000A[ 0x2 ]; //0x000A 11 | float m_flMuzzleFlashBrightness; //0x000C 12 | float m_flFov; //0x0010 13 | float m_flFarZ; //0x0014 14 | float m_flLinearAtten; //0x0018 15 | bool m_bCastsShadows; //0x001C 16 | char pad_0x001D[ 0x3 ]; //0x001D 17 | float m_flCurrentPullBackDist; //0x0020 18 | DWORD m_MuzzleFlashTexture; //0x0024 19 | DWORD m_FlashLightTexture; //0x0028 20 | char m_szTextureName[ 64 ]; //0x1559888 21 | }; //Size=0x006C 22 | 23 | namespace flashlight 24 | { 25 | void run(); 26 | void create( int ent_index, const char* name, float fov, float far_z, float lin_atten ); 27 | void destroy(); 28 | void update( const Vector& pos, const Vector& forward, const Vector& right, const Vector& up ); 29 | 30 | inline bool m_active = {}; 31 | inline CFlashLightEffect* m_flashlight = {}; 32 | }; -------------------------------------------------------------------------------- /internal_hvh/features/freestanding.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace freestanding 4 | { 5 | bool override( float & yaw ); 6 | bool get_rotated_damage( C_CSPlayer* shooter, CCSWeaponData* weapon, Vector shooter_position, Vector local_position, QAngle angle, float* dmg_left, float* dmg_right, float dist, bool first_run, float rot = 999.f ); 7 | bool get_real( float& yaw ); 8 | void get_targets(); 9 | bool freestand( float& yaw ); 10 | void update_hotkeys( ClientFrameStage_t stage ); 11 | void do_jitter( float & yaw ); 12 | 13 | inline float last_fs_time = {}; 14 | inline int direction = -1; 15 | inline std::vector players = {}; 16 | }; 17 | -------------------------------------------------------------------------------- /internal_hvh/features/gamemovement.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class gamemovement 4 | { 5 | public: 6 | void walk_move( QAngle viewangles, float forwardmove, float sidemove ); 7 | void accelerate( Vector& wishdir, float wishspeed, float accel, Vector& velocity ); 8 | 9 | float maxspeed, surface_friction, encumberance, healthshot_expiration, time, duckamount; 10 | Vector velocity, origin; 11 | bool scoped, heavy_armor, hostage, walking; 12 | 13 | }; -------------------------------------------------------------------------------- /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 | if ( interfaces::glow_object_manager()->m_glObjectDefinitions.Count() <= 0 ) 9 | return; 10 | 11 | m_glObjectDefinitions.resize( interfaces::glow_object_manager()->m_glObjectDefinitions.Count() ); 12 | for ( auto i = 0; i < interfaces::glow_object_manager()->m_glObjectDefinitions.Count(); i++ ) 13 | { 14 | m_glObjectDefinitions[ i ].m_vGlowColor = interfaces::glow_object_manager()->m_glObjectDefinitions[ i ].m_vGlowColor; 15 | m_glObjectDefinitions[ i ].m_flGlowAlpha = interfaces::glow_object_manager()->m_glObjectDefinitions[ i ].m_flGlowAlpha; 16 | m_glObjectDefinitions[ i ].m_bRenderWhenOccluded = interfaces::glow_object_manager()->m_glObjectDefinitions[ i ].m_bRenderWhenOccluded; 17 | m_glObjectDefinitions[ i ].m_bRenderWhenUnoccluded = interfaces::glow_object_manager()->m_glObjectDefinitions[ i ].m_bRenderWhenUnoccluded; 18 | m_glObjectDefinitions[ i ].m_flGlowAlphaMax = interfaces::glow_object_manager()->m_glObjectDefinitions[ i ].m_flGlowAlphaMax; 19 | } 20 | 21 | 22 | interfaces::glow_object_manager()->RenderGlowEffects(); 23 | } 24 | 25 | void glow::restore() 26 | { 27 | if ( interfaces::glow_object_manager()->m_glObjectDefinitions.Count() != m_glObjectDefinitions.size() ) 28 | return; 29 | 30 | for ( auto i = 0; i < interfaces::glow_object_manager()->m_glObjectDefinitions.Count(); i++ ) 31 | { 32 | interfaces::glow_object_manager()->m_glObjectDefinitions[ i ].m_vGlowColor = m_glObjectDefinitions[ i ].m_vGlowColor; 33 | interfaces::glow_object_manager()->m_glObjectDefinitions[ i ].m_flGlowAlpha = m_glObjectDefinitions[ i ].m_flGlowAlpha; 34 | interfaces::glow_object_manager()->m_glObjectDefinitions[ i ].m_bRenderWhenOccluded = m_glObjectDefinitions[ i ].m_bRenderWhenOccluded; 35 | interfaces::glow_object_manager()->m_glObjectDefinitions[ i ].m_bRenderWhenUnoccluded = m_glObjectDefinitions[ i ].m_bRenderWhenUnoccluded; 36 | interfaces::glow_object_manager()->m_glObjectDefinitions[ i ].m_flGlowAlphaMax = m_glObjectDefinitions[ i ].m_flGlowAlphaMax; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /internal_hvh/features/glow.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace glow 4 | { 5 | void draw(); 6 | void restore(); 7 | 8 | inline std::vector< CGlowObjectManager::GlowObjectDefinition_t > m_glObjectDefinitions = {}; 9 | }; -------------------------------------------------------------------------------- /internal_hvh/features/hitmarker.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace hitmarker 4 | { 5 | struct hitmarker_t 6 | { 7 | hitmarker_t( const float& time, const int& index, const int& damage, const int& hitgroup, const Vector& pos ) 8 | { 9 | this->time = time; 10 | this->index = index; 11 | this->damage = damage; 12 | this->hitgroup = hitgroup; 13 | this->pos = pos; 14 | moved = 0.f; 15 | alpha = 255.f; 16 | } 17 | float time; 18 | int index; 19 | int damage; 20 | int hitgroup; 21 | float moved; 22 | float alpha; 23 | Vector pos{}; 24 | }; 25 | 26 | void listener( IGameEvent * game_event ); 27 | void draw_hits(); 28 | void add_hit( hitmarker_t hit ); 29 | void save_files(); 30 | void render_hitmarker( hitmarker_t& hit, const Vector & screen_pos ); 31 | void render_screen_hitmarker( hitmarker_t& hit ); 32 | 33 | inline std::deque hits = {}; 34 | inline std::vector soundfiles = { 35 | 36 | _w( "*bell.wav" ), 37 | _w( "*cod.wav" ), 38 | _w( "*fatality.wav" ), 39 | _w( "buttons/arena_switch_press_02.wav" ), 40 | _w( "*bepis.wav" ), 41 | _w( "*phonk.wav" ), 42 | _w( "*sparkle.wav" ), 43 | _w( "*cock.wav" ), 44 | }; 45 | }; -------------------------------------------------------------------------------- /internal_hvh/features/include_features.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "prediction.h" 4 | #include "aimbot.h" 5 | #include "player_log.h" 6 | #include "chams.h" 7 | #include "lag_compensation.h" 8 | #include "beams.h" 9 | #include "resolver.h" 10 | #include "wall_penetration.h" 11 | #include "antiaim.h" 12 | #include "animations.h" 13 | #include "thirdperson.h" 14 | #include "hitmarker.h" 15 | #include "bone_setup.h" 16 | #include "glow.h" 17 | #include "freestanding.h" 18 | #include "misc.h" 19 | #include "visuals.h" 20 | #include "autostrafer.h" 21 | #include "console_log.h" 22 | #include "skinchanger.h" 23 | #include "inventorychanger.h" 24 | #include "knifebot.h" 25 | #include "legit.h" 26 | #include "grenade_pred.h" 27 | #include "aimbot_helpers.h" 28 | #include "sound_esp.h" 29 | #include "hitscan.h" 30 | #include "flashlight.h" 31 | #include "tickbase.h" 32 | #include "mt.h" 33 | #include "gamemovement.h" 34 | #include "entity_rendering.h" 35 | #include "playerperf.h" 36 | #include "shared_data.h" -------------------------------------------------------------------------------- /internal_hvh/features/inventorychanger.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class listbox; 4 | struct listbox_item_t; 5 | 6 | namespace inventorychanger 7 | { 8 | struct inventory_item_t 9 | { 10 | auto operator<=>( const inventory_item_t& ) const = default; 11 | 12 | bool enabled() const 13 | { 14 | return local_player && ( local_player->get_team() == 2 && enabled_t || local_player->get_team() == 3 && enabled_ct ); 15 | } 16 | 17 | int definition_index{}; 18 | int paint_kit{}; 19 | int seed{}; 20 | float wear = 0.f; 21 | int stat_trak{}; 22 | bool update = false; 23 | bool fullupdate = false; 24 | bool enabled_ct = false; 25 | bool enabled_t = false; 26 | }; 27 | 28 | void update_menu_items(); 29 | void update_selected( bool force = false ); 30 | void add(); 31 | void set( int index, bool force = false ); 32 | void load(); 33 | void save( bool force = false ); 34 | void remove(); 35 | 36 | void fill_weapon_list(); 37 | void fill_skin_list( std::string& search ); 38 | 39 | bool is_knife( int idx ); 40 | bool is_glove( int idx ); 41 | bool same_item( int idx, int idx2 ); 42 | 43 | inline std::vector items = {}; 44 | 45 | inline std::vector< skinchanger::paint_kit_data_s> menu_items_data = {}; 46 | 47 | inline std::vector weapon_menu_items_data{}; 48 | 49 | inline std::weak_ptr paint_kit_listbox{}; 50 | inline std::weak_ptr weapons_listbox{}; 51 | 52 | inline uint64_t highest_id = {}; 53 | }; -------------------------------------------------------------------------------- /internal_hvh/features/knifebot.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace knifebot 4 | { 5 | bool trace_knife( Vector spot, lag_record_t* record, bool& retstab ); 6 | bool rules_knife( lag_record_t* record ); 7 | bool is_behind(const lag_record_t* record); 8 | float get_damage(const lag_record_t* record, bool stab); 9 | }; -------------------------------------------------------------------------------- /internal_hvh/features/lag_compensation.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace lagcomp 4 | { 5 | bool run_extrapolation( const C_CSPlayer* player, const bool simple = false ); 6 | int fix_tickcount( const float& simtime ); 7 | bool valid_simtime( const float& simtime, const float time = ticks_to_time( local_player->get_tickbase() - 1 ) ); 8 | bool is_breaking_lagcomp( const C_CSPlayer* player ); 9 | bool is_breaking_lagcomp( const C_CSPlayer* player, const lag_record_t* current ); 10 | int get_real_lag( const C_CSPlayer* player, const lag_record_t* current ); 11 | float get_lerp_time(); 12 | void extrapolate( C_CSPlayer* player, Vector& origin, Vector& velocity, Vector base_velocity, int& flags, bool wasonground ); 13 | }; 14 | -------------------------------------------------------------------------------- /internal_hvh/features/legit.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct weaponconfig_legit_t; 4 | 5 | namespace legit 6 | { 7 | Vector closest_hitbox_pos( const player_log_t& log, lag_record_t* record, float& bestdist ); 8 | void run_backtrack(); 9 | void run_triggerbot(); 10 | void run_rcs( float* mouse_x, float* mouse_y, C_WeaponCSBaseGun* weapon ); 11 | void run_aim( float* mouse_x, float* mouse_y ); 12 | 13 | float get_curve( const float t ); 14 | void smooth( QAngle& dest_ang, const QAngle& cur_ang, const float speed ); 15 | Vector2D angle_to_pixels( const QAngle& angle ); 16 | QAngle pixels_to_angle( const Vector2D& pixel ); 17 | 18 | inline lag_record_t* shot_record = {}; 19 | inline int shot_index = -1; 20 | 21 | struct legit_target_t 22 | { 23 | int hitbox{}; 24 | int index{}; 25 | float fov{}; 26 | }; 27 | 28 | inline float visible_time[ 65 ]{}; 29 | inline legit_target_t target = {}; 30 | inline float target_time = {}; 31 | inline float trigger_time = {}; 32 | inline QAngle last_punch = {}; 33 | }; -------------------------------------------------------------------------------- /internal_hvh/features/misc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define sv_maxusrcmdprocessticks (((*interfaces::game_rules_proxy()) && (*interfaces::game_rules_proxy())->m_bIsValveDS()) ? 7 : 16) 4 | #define max_new_cmds (sv_maxusrcmdprocessticks - 2) 5 | 6 | namespace misc 7 | { 8 | void bhop( bool post_prediction = false ); 9 | void remove_smoke( ClientFrameStage_t stage ); 10 | void remove_flash( ClientFrameStage_t stage ); 11 | void reveal_ranks(); 12 | void clan_tag(); 13 | void play_freezetime_music(); 14 | void preserve_deathnotices( ClientFrameStage_t stage ); 15 | void buybot(); 16 | void write_tick( int cmdnum ); 17 | void custom_render_options( ClientFrameStage_t stage ); 18 | void peek_assist(); 19 | void ragdoll_slowpath( ClientFrameStage_t stage ); 20 | void fix_prediction( ClientFrameStage_t stage ); 21 | float get_latency(); 22 | 23 | inline bool retract_peek = {}; 24 | inline bool cant_reach = {}; 25 | inline bool has_position = {}; 26 | inline bool has_released = {}; 27 | inline Vector movement_position{}; 28 | inline Vector peek_position{}; 29 | inline int last_recv = {}; 30 | 31 | inline void retract() 32 | { 33 | retract_peek = true; 34 | peek_position = local_player->get_origin(); 35 | cant_reach = false; 36 | } 37 | }; 38 | -------------------------------------------------------------------------------- /internal_hvh/features/mt.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace detail 5 | { 6 | typedef int( __cdecl* allocate_thread_id_t )( ); 7 | typedef void( __cdecl* free_thread_id_t )( ); 8 | 9 | struct spinlock 10 | { 11 | std::atomic lock_ = { false }; 12 | 13 | void lock() noexcept 14 | { 15 | for ( ;; ) 16 | { 17 | // Optimistically assume the lock is free on the first try 18 | if ( !lock_.exchange( true, std::memory_order_acquire ) ) 19 | { 20 | return; 21 | } 22 | // Wait for lock to be released without generating cache misses 23 | while ( lock_.load( std::memory_order_relaxed ) ) 24 | { 25 | // Issue X86 PAUSE or ARM YIELD instruction to reduce contention between 26 | // hyper-threads 27 | _mm_pause(); 28 | } 29 | } 30 | } 31 | 32 | bool try_lock() noexcept 33 | { 34 | // First do a relaxed load to check if lock is free in order to prevent 35 | // unnecessary cache misses if someone does while(!try_lock()) 36 | return !lock_.load( std::memory_order_relaxed ) && 37 | !lock_.exchange( true, std::memory_order_acquire ); 38 | } 39 | 40 | void unlock() noexcept 41 | { 42 | lock_.store( false, std::memory_order_release ); 43 | } 44 | }; 45 | 46 | class call_queue 47 | { 48 | public: 49 | struct queue_element 50 | { 51 | queue_element( std::function call ) : call( std::move( call ) ) {} 52 | std::function call; 53 | }; 54 | 55 | 56 | call_queue() = default; 57 | void init(); 58 | 59 | void perform( std::vector>& calls ); 60 | 61 | void process_queue( int index ); 62 | #ifndef RELEASE 63 | void decomission(); 64 | #endif 65 | std::vector threads = {}; 66 | bool decomissioned = {}; 67 | int count_ = {}; 68 | private: 69 | allocate_thread_id_t allocate_thread_id_ = {}; 70 | free_thread_id_t free_thread_id_ = {}; 71 | 72 | size_t calculate_remaining_tls_slots() const; 73 | std::vector> queue_ = {}; 74 | std::atomic to_run_ = 0; 75 | spinlock queue_mtx_ = {}; 76 | std::condition_variable_any queue_cond_ = {}; 77 | }; 78 | 79 | extern call_queue callqueue; 80 | } 81 | -------------------------------------------------------------------------------- /internal_hvh/features/player_log.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct anim_debug_info_t 4 | { 5 | matrix3x4_t m_client_bones[ 128 ]{}; 6 | matrix3x4_t m_server_bones[ 128 ]{}; 7 | 8 | uint32_t m_has_data{}; 9 | static auto constexpr SERVER = ( 1 << 0 ); 10 | static auto constexpr CLIENT = ( 1 << 1 ); 11 | 12 | void emplace_server( matrix3x4_t* bones ) 13 | { 14 | if ( m_has_data & SERVER ) 15 | return; 16 | 17 | memcpy( m_server_bones, bones, 128 * sizeof( matrix3x4_t ) ); 18 | m_has_data |= SERVER; 19 | } 20 | 21 | void emplace_client( matrix3x4_t* bones ) 22 | { 23 | if ( m_has_data & CLIENT ) 24 | return; 25 | 26 | memcpy( m_client_bones, bones, 128 * sizeof( matrix3x4_t ) ); 27 | m_has_data |= CLIENT; 28 | } 29 | }; 30 | 31 | template 32 | struct ring_buffer_t 33 | { 34 | T& get_or_put( size_t const& key ) 35 | { 36 | if ( memory[ key % size ].key != key ) 37 | { 38 | memory[ key % size ].key = key; 39 | memory[ key % size ].value = {}; 40 | } 41 | 42 | return memory[ key % size ].value; 43 | } 44 | 45 | struct 46 | { 47 | size_t key; 48 | T value; 49 | } memory[ size ]; 50 | }; 51 | 52 | namespace player_log 53 | { 54 | struct shared_esp_data 55 | { 56 | uint16_t identifier; 57 | uint8_t user_id; 58 | uint8_t weapon_id; 59 | uint32_t server_tick; 60 | Vector pos; 61 | }; 62 | 63 | void run_log( ClientFrameStage_t stage ); 64 | void queue_esp_data( C_CSPlayer* player ); 65 | void send_esp_data(); 66 | void parse_esp_data( const int client, const voice_usable_fields& data ); 67 | void run_player( C_CSPlayer* player ); 68 | player_log_t& get_log( int index ); 69 | void filter_records(); 70 | 71 | inline player_log_t logs[ 65 ] = {}; 72 | inline std::deque> queued_esp_data; 73 | 74 | #ifdef _DEBUG 75 | inline ring_buffer_t anim_debug_info[ 65 ] = {}; 76 | #endif 77 | }; -------------------------------------------------------------------------------- /internal_hvh/features/playerperf.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | #include 3 | 4 | void split_string( std::vector& ret, std::string s ) 5 | { 6 | int start = 0; 7 | int end = s.find( '\n' ); 8 | while ( end != -1 ) 9 | { 10 | ret.emplace_back( s.substr( start, end - start ) ); 11 | start = end + 1; 12 | end = s.find( '\n', start ); 13 | } 14 | ret.emplace_back( s.substr( start, end - start ) ); 15 | } 16 | 17 | void playerperf::on_handle_siminfo( const player_siminfo_t& sim_info ) 18 | { 19 | if ( recv_tick != interfaces::globals()->tickcount ) 20 | { 21 | while ( player_server_info.size() > 150 ) 22 | player_server_info.pop_back(); 23 | count = 0; 24 | pos = 0; 25 | recv_tick = interfaces::globals()->tickcount; 26 | } 27 | 28 | if ( std::ranges::find_if( player_server_info, [&] ( const player_serverinfo_t& elem ) { return elem.sim_info == sim_info; } ) != player_server_info.end() ) 29 | return; 30 | 31 | player_server_info.insert( player_server_info.begin() + count++, { player_cmdinfo_t{}, sim_info } ); 32 | } 33 | 34 | void playerperf::on_handle_cmdinfo( const player_cmdinfo_t& cmd_info ) 35 | { 36 | if ( pos >= count ) 37 | return; 38 | 39 | player_server_info.at( pos++ ).cmd_info = cmd_info; 40 | } 41 | 42 | bool playerperf::handle_message( const char* str ) 43 | { 44 | auto strings = std::vector{}; 45 | split_string( strings, std::string( str ) ); 46 | if ( strings.empty() ) 47 | return false; 48 | 49 | auto found = false; 50 | for ( const auto& elem : strings ) 51 | { 52 | _( fmt1, "%f %d %d %f %f %f [vel %f]" ); 53 | _( fmt2, "%f %d %d" ); 54 | 55 | player_siminfo_t sim_info{}; 56 | player_cmdinfo_t cmd_info{}; 57 | 58 | if ( sscanf_s( elem.c_str(), fmt1.c_str(), &sim_info.m_flTime, &sim_info.m_nNumCmds, &sim_info.m_nTicksCorrected, 59 | &sim_info.m_flFinalSimulationTime, &sim_info.m_flGameSimulationTime, &sim_info.m_flServerFrameTime, &sim_info.vel ) == 7 ) 60 | { 61 | on_handle_siminfo( sim_info ); 62 | found = true; 63 | } 64 | else if ( sscanf_s( elem.c_str(), fmt2.c_str(), &cmd_info.m_flTime, &cmd_info.m_nNumCmds, &cmd_info.m_nDroppedPackets ) == 3 ) 65 | { 66 | on_handle_cmdinfo( cmd_info ); 67 | found = true; 68 | } 69 | } 70 | 71 | return found; 72 | } -------------------------------------------------------------------------------- /internal_hvh/features/playerperf.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace playerperf 4 | { 5 | struct player_siminfo_t 6 | { 7 | bool operator==( const player_siminfo_t& ) const = default; 8 | 9 | float m_flTime; 10 | // # of CUserCmds in this update 11 | int m_nNumCmds; 12 | // If clock needed correction, # of ticks added/removed 13 | int m_nTicksCorrected; // +ve or -ve 14 | // player's m_flSimulationTime at end of frame 15 | float m_flFinalSimulationTime; 16 | float m_flGameSimulationTime; 17 | // estimate of server perf 18 | float m_flServerFrameTime; 19 | float vel; 20 | }; 21 | 22 | struct player_cmdinfo_t 23 | { 24 | bool operator==( const player_cmdinfo_t& ) const = default; 25 | 26 | // realtime of sample 27 | float m_flTime; 28 | // # of CUserCmds in this update 29 | int m_nNumCmds; 30 | // # of dropped packets on the link 31 | int m_nDroppedPackets; 32 | }; 33 | 34 | struct player_serverinfo_t 35 | { 36 | player_cmdinfo_t cmd_info{}; 37 | player_siminfo_t sim_info{}; 38 | }; 39 | 40 | void on_handle_siminfo( const player_siminfo_t& sim_info ); 41 | void on_handle_cmdinfo( const player_cmdinfo_t& cmd_info ); 42 | bool handle_message( const char* str ); 43 | 44 | inline std::deque player_server_info = {}; 45 | inline int recv_tick = {}; 46 | inline int count = {}; 47 | inline int pos = {}; 48 | }; -------------------------------------------------------------------------------- /internal_hvh/features/prediction.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "animations.h" 3 | 4 | namespace prediction 5 | { 6 | struct pred_info_t 7 | { 8 | void reset() 9 | { 10 | *this = {}; 11 | } 12 | int sequence = {}; 13 | float m_curtime = {}; 14 | int m_flags = {}; 15 | int tick_base = {}; 16 | int buttons = {}; 17 | Vector origin = {}; 18 | Vector velocity = {}; 19 | bool has_anim_state = {}; 20 | float throwtime = {}; 21 | int movetype = {}; 22 | float postpone_fire_ready_time = FLT_MAX; 23 | float viewoffset_z = {}; 24 | float view_delta = {}; 25 | float undpred_change_time = {}; 26 | Vector maxs = {}; 27 | CBaseHandle groundentity = {}; 28 | CBaseHandle wpn = {}; 29 | float last_shot = 0.f; 30 | CCSGOPlayerAnimState anim_state = {}; 31 | animations::animation_copy animation = {}; 32 | float collision_viewheight{}; 33 | float collision_bounds_change_time{}; 34 | int ev = {}; 35 | 36 | struct tickbase_t 37 | { 38 | int limit = {}; 39 | int sent_commands = {}; 40 | int choked_commands = {}; 41 | bool skip_fake_commands = {}; 42 | } tickbase = {}; 43 | }; 44 | 45 | void start( int sequence_nr ); 46 | void finish( bool sendpacket = false ); 47 | void run_prediction( int command_number = interfaces::client_state()->lastoutgoingcommand + interfaces::client_state()->chokedcommands + 1 ); 48 | pred_info_t& get_pred_info( int cmd ); 49 | void clear_pred_info(); 50 | void set_last_command_number( int num ); 51 | void predict_post_pone_time( CUserCmd* cmd ); 52 | void predict_can_fire( CUserCmd* cmd ); 53 | 54 | void take_shot( bool shot = true ); 55 | void take_secondary_shot( bool shot = true ); 56 | bool has_shot(); 57 | bool can_fire(); 58 | void evaluate_shots(); 59 | void reset_shot(); 60 | void set_forced_shot(); 61 | 62 | inline Vector2D unpred_move = {}; 63 | inline bool computing = {}; 64 | inline float unpred_throw_time = {}; 65 | inline int orig_predicted = {}; 66 | inline bool had_attack = {}; 67 | inline bool had_secondary_attack = {}; 68 | inline bool can_shoot = {}; 69 | inline bool has_shot_this_cycle = {}; 70 | inline float orig_curtime = {}; 71 | inline float orig_frametime = {}; 72 | inline bool attempted_jump = {}; 73 | inline std::array pred_info = {}; 74 | inline int unpred_flags = {}; 75 | inline Vector unpred_abs_origin = {}; 76 | inline Vector unpred_vel = {}; 77 | inline Vector initial_vel = {}; 78 | inline int last_update_command_number = {}; 79 | inline int prone_delay = {}; 80 | 81 | inline static constexpr auto prone_time = 0.03448275862f; 82 | inline static constexpr auto post_delay = 0.2f; 83 | }; 84 | -------------------------------------------------------------------------------- /internal_hvh/features/shared_data.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | void shared_data::send_data_msg( const voice_usable_fields& data ) 4 | { 5 | CCLCMsg_VoiceData msg; 6 | memset( &msg, 0, sizeof( CCLCMsg_VoiceData ) ); 7 | 8 | reinterpret_cast< uint32_t( __fastcall* )( CCLCMsg_VoiceData*, void* ) >( make_offset( "engine.dll", sig_msg_voicedata_constructor ) )( &msg, nullptr ); 9 | 10 | msg.set_usable_fields( data ); 11 | 12 | struct 13 | { 14 | char data[ 16 ]{}; 15 | uint32_t current_len = 0; 16 | uint32_t max_len = 15; 17 | } voice_data{}; 18 | msg.data = &voice_data; 19 | msg.format = 0; 20 | msg.flags = 63; 21 | 22 | original( hook::send_net_msg )( interfaces::client_state()->m_NetChannel, nullptr, *reinterpret_cast< INetMessage* >( &msg ), false, true ); 23 | } 24 | 25 | 26 | bool shared_data::on_voice_data( const CSVCMsg_VoiceData* msg ) 27 | { 28 | if ( !vars::misc.shared_esp->get() ) 29 | return true; 30 | 31 | if ( msg->format != 0 ) 32 | return true; 33 | 34 | const auto data = msg->get_usable_fields(); 35 | if ( !data.sequence_bytes && !data.section_number && !data.uncompressed_sample_offset ) // check for empty message due to bHearsPlayer 36 | return false; 37 | 38 | if ( msg->client + 1 == interfaces::engine()->GetLocalPlayer() ) 39 | return false; 40 | 41 | player_log::parse_esp_data( msg->client + 1, data ); 42 | 43 | return false; 44 | } -------------------------------------------------------------------------------- /internal_hvh/features/shared_data.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace shared_data 4 | { 5 | void send_data_msg( const voice_usable_fields& data ); 6 | bool on_voice_data( const CSVCMsg_VoiceData* msg ); 7 | } 8 | 9 | -------------------------------------------------------------------------------- /internal_hvh/features/sound_esp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct SndInfo_t; 4 | namespace sound_esp 5 | { 6 | void update(); 7 | void update_origin( sound_data_t& player, const Vector& origin ); 8 | Vector get_position( int index, bool lerp = false ); 9 | bool get_last_update( int index ); 10 | sound_data_t* get_sound_player( int index ); 11 | void on_start_sound( const start_sound_params* params, char* name ); 12 | void on_item_equip( IGameEvent* game_event ); 13 | 14 | inline std::array players = {}; 15 | }; -------------------------------------------------------------------------------- /internal_hvh/features/thirdperson.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | float BezierBlend2( float t ) 4 | { 5 | return t * t * ( 3.0f - 2.0f * t ); 6 | } 7 | 8 | [[clang::optnone]] void thirdperson::run() 9 | { 10 | #ifndef NO_NETOFFSETS 11 | 12 | VIRTUALIZER_LION_WHITE_START 13 | 14 | if ( !interfaces::engine()->IsInGame() || !local_player ) 15 | return; 16 | 17 | if ( util::get_current_tick() > util::last_heartbeat_tick.load() + 60000u ) 18 | { 19 | log( "connection failure\n" ); 20 | #ifdef ALPHA 21 | util::print_log( std::to_string( util::get_current_tick() - util::last_heartbeat_tick ).c_str() ); 22 | log( "\n" ); 23 | #endif 24 | util::crash(); 25 | } 26 | 27 | VIRTUALIZER_LION_WHITE_END 28 | #else 29 | if ( !interfaces::engine()->IsInGame() || !local_player ) 30 | return; 31 | #endif 32 | 33 | const auto weapon = local_weapon; 34 | 35 | static auto progress = 0.f; 36 | if ( local_player->get_alive() && vars::misc.thirdperson->get() && ( !vars::misc.thirdperson_grenade->get() || !weapon || !weapon->is_grenade() ) ) 37 | { 38 | interfaces::input()->m_fCameraInThirdPerson = true; 39 | 40 | progress = clamp( progress + interfaces::globals()->frametime * 6.f, 40.f / vars::misc.thirdperson_dist->get(), 1.f ); 41 | 42 | var( cam_idealdist ); 43 | var( cam_collision ); 44 | var( cam_snapto ); 45 | 46 | cam_idealdist->set_value( vars::misc.thirdperson_dist->get() * ( vars::visuals.disable_thirdperson_interp->get() ? 1.f : BezierBlend2( progress ) ) ); 47 | cam_collision->set_value( 1 ); 48 | cam_snapto->set_value( 1 ); 49 | } 50 | else if ( interfaces::input()->m_fCameraInThirdPerson ) 51 | { 52 | progress = vars::misc.thirdperson->get() ? 1.f : 0.f; 53 | interfaces::input()->m_fCameraInThirdPerson = false; 54 | } 55 | 56 | static auto b_once = false; 57 | 58 | if ( local_player->get_alive() || !vars::misc.thirdperson_dead->get() ) 59 | { 60 | b_once = false; 61 | return; 62 | } 63 | 64 | if ( b_once ) 65 | local_player->get_observer_mode() = 5; 66 | 67 | if ( local_player->get_observer_mode() == 4 ) 68 | b_once = true; 69 | } 70 | -------------------------------------------------------------------------------- /internal_hvh/features/thirdperson.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace thirdperson 4 | { 5 | void run(); 6 | }; -------------------------------------------------------------------------------- /internal_hvh/features/tickbase.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CCLCMsg_Move 4 | { 5 | private: 6 | virtual ~CCLCMsg_Move(); 7 | char pad[ 8 ]{}; 8 | public: 9 | int backup_commands{}; 10 | int new_commands{}; 11 | }; 12 | 13 | namespace tickbase 14 | { 15 | void reset(); 16 | bool is_ready(); 17 | void adjust_limit_dynamic( bool finalize = false ); 18 | bool holds_tick_base_weapon(); 19 | void attempt_shift_back( bool& send_packet ); 20 | void revert_shift_back(); 21 | void fill_fake_commands(); 22 | void apply_static_configuration(); 23 | int determine_optimal_shift(); 24 | int determine_optimal_limit(); 25 | float get_adjusted_time(); 26 | int compute_current_limit( int command_number = globals::current_cmd ? globals::current_cmd->command_number : 0 ); 27 | void on_send_command( const CUserCmd* cmd = globals::current_cmd ); 28 | void on_finish_command( bool sendpacket, const CUserCmd* cmd = globals::current_cmd ); 29 | void on_recharge( const CUserCmd* cmd ); 30 | void on_runcmd( const CUserCmd* cmd, int& tickbase ); 31 | 32 | inline int clock_drift = {}, server_limit = {}, to_recharge = {}, to_shift = {}, to_adjust = {}, to_correct = {}; 33 | inline bool force_choke = {}, force_unchoke = {}, force_drop = {}, skip_next_adjust = {}, fast_fire = {}, hide_shot = {}, post_shift = {}; 34 | }; -------------------------------------------------------------------------------- /internal_hvh/features/visuals.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace evo 5 | { 6 | namespace ren 7 | { 8 | class layer; 9 | } 10 | } 11 | 12 | namespace visuals 13 | { 14 | struct misc_data_t 15 | { 16 | misc_data_t() = default; 17 | bool valid = false; 18 | float spread = -1.f; 19 | int wallbang = -1; 20 | bool scoped = false; 21 | bool alive{}; 22 | bool doubletap{}; 23 | bool silent{}; 24 | bool anti_exploit{}; 25 | bool mindmg_override{}; 26 | float outgoing{}; 27 | float incoming{}; 28 | float lby{}; 29 | Vector vel{}; 30 | float anim_vel{}; 31 | float z_vel{}; 32 | float duckamt{}; 33 | bool lc{}; 34 | bool can_shift{}; 35 | bool valve_ds = false; 36 | }; 37 | 38 | void run(); 39 | void render(); 40 | void queue_custom_player_esp(); 41 | void render_custom_player_esp(); 42 | void players_get(); 43 | void player_skeleton( const visual_data_t& player, evo::ren::layer& layer ); 44 | void player_box( const visual_data_t& player, evo::ren::layer& layer ); 45 | void player_info( const visual_data_t& player, evo::ren::layer& layer ); 46 | bool bar_ping( const visual_data_t& player, int elements, evo::ren::layer& layer ); 47 | void bar_health( const visual_data_t& player, int elements, evo::ren::layer& layer ); 48 | void bar_armor( const visual_data_t& player, int elements, evo::ren::layer& layer ); 49 | void bar_ammo( const visual_data_t& player, int elements, evo::ren::layer& layer ); 50 | void player_out_of_fov( const visual_data_t& player, bool dormant = false ); 51 | void queue_world_data(); 52 | void queue_player_data(); 53 | void queue_misc_data(); 54 | void players_esp(); 55 | void defuse_bar( const world_data_t& ent ); 56 | void ammo_bar( const world_data_t& ent ); 57 | void smoke_timer( const world_data_t& ent ); 58 | void inferno_timer( const world_data_t& ent ); 59 | void world_info( const world_data_t& ent ); 60 | void world_esp(); 61 | void draw_scope( const misc_data_t& misc_data ); 62 | void aa_indicator( const misc_data_t& misc_data, int& offset ); 63 | void fakeduck_indicator( const misc_data_t& misc_data, int& offset ); 64 | void lean_indicator( const misc_data_t& misc_data, int& offset ); 65 | void doubletap_indicator( const misc_data_t& misc_data, int& offset ); 66 | void freestand_indicator( const misc_data_t& misc_data, int& offset ); 67 | void recharge_bar( const misc_data_t& misc_data, int& offset ); 68 | void silent_indicator( const misc_data_t& misc_data, int& offset ); 69 | void anti_exploit_indicator( const misc_data_t& misc_data, int& offset ); 70 | void override_indicator( const misc_data_t& misc_data, int& offset ); 71 | void force_safety_indicator( const misc_data_t& misc_data, int& offset ); 72 | void force_baim_indicator( const misc_data_t& misc_data, int& offset ); 73 | void hsonly_indicator( const misc_data_t& misc_data, int& offset ); 74 | void lc_indicator( const misc_data_t& misc_data, int& offset ); 75 | void draw_misc_data(); 76 | void spread_circle( const misc_data_t& data ); 77 | void autowall_crosshair( const misc_data_t& data ); 78 | std::string grenade_to_name( int id ); 79 | 80 | 81 | inline std::array players = {}; 82 | inline visual_world_data_t world_data = {}; 83 | inline misc_data_t misc_data = {}; 84 | inline visual_data_t preview_data = {}; 85 | inline float game_curtime = {}; 86 | inline bool setup_the_bones = false; 87 | }; 88 | -------------------------------------------------------------------------------- /internal_hvh/features/wall_penetration.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace penetration 4 | { 5 | struct fire_bullet_data 6 | { 7 | Vector src; 8 | trace_t enter_trace; 9 | Vector direction; 10 | ITraceFilter filter; 11 | float trace_length; 12 | float trace_length_remaining; 13 | float current_damage; 14 | int penetrate_count; 15 | }; 16 | 17 | enum 18 | { 19 | safety_none = 0, 20 | safety_no_roll = 2, 21 | safety_full = 6 22 | }; 23 | 24 | struct pen_data 25 | { 26 | pen_data( lag_record_t* record = nullptr, resolver_direction dir = resolver_direction::resolver_networked, int safety = safety_none, lag_record_t* extra = nullptr, CCSWeaponData* custom_data = nullptr ) 27 | { 28 | this->record = record; 29 | this->dir = dir; 30 | this->safety = safety; 31 | this->extra = extra; 32 | this->custom_data = custom_data; 33 | this->weapon = nullptr; 34 | } 35 | 36 | lag_record_t* extra = nullptr; 37 | lag_record_t* record = nullptr; 38 | CCSWeaponData* custom_data = nullptr; 39 | CGameTrace* out_trace = nullptr; 40 | C_WeaponCSBaseGun* weapon = nullptr; 41 | resolver_direction dir = resolver_direction::resolver_networked; 42 | bool one_wall = false; 43 | int safety = 0; 44 | 45 | // only set if hb test before awall 46 | bool custom_test = false; 47 | trace_t tr = {}; 48 | }; 49 | 50 | struct awall_trace_t 51 | { 52 | int index; 53 | Vector start; 54 | Vector point; 55 | }; 56 | 57 | bool is_cfuncbrush( IClientEntity* entity ); 58 | bool is_breakable_entity( C_BaseEntity* entity ); 59 | void scale_damage( int item_definition_index, int hit_group, float armor, bool heavy_armor, bool helment, float& currentDamage ); 60 | void scale_damage( C_CSPlayer* ent, int hit_group, CCSWeaponData* weapon_data, float& currentDamage, bool scale = true ); 61 | bool trace_to_studio_csgo_hitgroups_priority( Ray_t* ray, CStudioHdr* pStudioHdr, mstudiohitboxset_t* set, matrix3x4_t** scan_matrix, int fContentsMask, Vector* vecOrigin, float flScale, trace_t* trace ); 62 | bool trace_to_exit( CGameTrace& enter_trace, CGameTrace& exit_trace, Vector start_position, Vector direction ); 63 | bool handle_bullet_penetration( CCSWeaponData* weapon_data, CGameTrace& enter_trace, Vector& eye_position, Vector direction, int& possible_hits_remaining, float& current_damage, float penetration_power ); 64 | bool can_hit( C_CSPlayer* shooter, pen_data pen_data, const Vector pos, aimbot::aimpoint_t* point, int& damage, bool hitchance = false ); 65 | bool can_hit( int item_definition_index, const Vector pos, const Vector end, int& damage, trace_t& trace ); 66 | CCSWeaponData* get_normal_weapon(); 67 | CCSWeaponData* get_full_weapon(); 68 | bool fire_bullet( C_WeaponCSBaseGun* weapon, pen_data& pen_data, const Vector pos, aimbot::aimpoint_t* point, int& damage, bool hitchance = false ); 69 | int can_wallbang(); 70 | bool check_hittable( awall_trace_t trace ); 71 | bool test_hitboxes( trace_t& tr, Ray_t& ray, const pen_data& pen_data, int force_hitgorup = -1 ); 72 | 73 | constexpr auto ray_extension = 40.f; 74 | }; 75 | -------------------------------------------------------------------------------- /internal_hvh/hooks/con_vars.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | #include 3 | 4 | int __fastcall hook::convar_get_int_engine( ConVar* convar, void* edx ) 5 | { 6 | if ( reinterpret_cast< uintptr_t >( _ReturnAddress() ) == make_offset( "engine.dll", sig_ret_to_draw_notify ) || reinterpret_cast< uintptr_t >( _ReturnAddress() ) == make_offset( "engine.dll", sig_ret_to_add_notify ) ) // engine hook 7 | return true; 8 | 9 | if ( reinterpret_cast< uintptr_t >( _ReturnAddress() ) == make_offset( "engine.dll", sig_ret_to_console_print ) && console_log::m_in_print ) // engine hook 10 | return true; 11 | 12 | if ( reinterpret_cast< uintptr_t >( _ReturnAddress() ) == make_offset( "client.dll", sig_ret_to_cam_think ) ) // engine hook 13 | return true; 14 | 15 | return original_vfunc( convar, convar_get_int_engine )( convar, edx ); 16 | } 17 | 18 | int __fastcall hook::convar_get_int_client( ConVar* convar, void* edx ) 19 | { 20 | if ( reinterpret_cast< uintptr_t >( _ReturnAddress() ) == make_offset( "client.dll", sig_ret_to_draw_crosshair ) && !local_player->get_scoped() && local_player->get_alive() && vars::misc.force_crosshair->get() ) // client hook 21 | return 3; 22 | 23 | if ( vars::misc.birthday_mode->get() && fnv1a_rt( convar->name ) == FNV1A( "sv_party_mode" ) ) 24 | return true; 25 | 26 | return original_vfunc( convar, convar_get_int_client )( convar, edx ); 27 | } 28 | 29 | float __fastcall hook::convar_get_float_engine( ConVar* convar, void* edx ) 30 | { 31 | if ( *reinterpret_cast< uint8_t* >( reinterpret_cast< uintptr_t >( _ReturnAddress() ) + 0x8F ) == 0x77 32 | && *reinterpret_cast< uint8_t* >( reinterpret_cast< uintptr_t >( _ReturnAddress() ) + 0x90 ) == 0x2E 33 | && *reinterpret_cast< uint8_t* >( reinterpret_cast< uintptr_t >( _ReturnAddress() ) + 0x91 ) == 0x80 ) 34 | { 35 | const auto darkness = vars::visuals.dark->get() ? vars::visuals.darkness->get() : 0.f; 36 | return clamp( .5f - ( darkness * .01f ) * .475f, 0.01f, 1.f ); 37 | } 38 | 39 | return original_vfunc( convar, convar_get_float_engine )( convar, edx ); 40 | } 41 | 42 | void __fastcall hook::server_cmd_key_values( void* ecx, void* edx, KeyValues* key_values ) 43 | { 44 | if ( fnv1a_rt( key_values->get_name() ) == FNV1A( "CrosshairCode" ) ) 45 | key_values->set_string( xorstr_( "code" ), xorstr_( "CSGO-9whau-zVNhk-799MD-jBNq3-HsnkP" ) ); 46 | 47 | return original( server_cmd_key_values )( ecx, edx, key_values ); 48 | } 49 | 50 | void __cdecl hook::convar_network_change_callback( ConVar* var, const char* old1, float old2 ) 51 | { 52 | const auto var2 = reinterpret_cast< ConVar* >( reinterpret_cast< uintptr_t >( var ) - 0x18 ); 53 | 54 | if ( var->flags & ( 1 << 9 ) ) 55 | { 56 | if ( fnv1a_rt( var->get_name() ) == FNV1A( "cl_lagcompensation" ) ) 57 | ConVar::cl_lagcompensation = fnv1a_rt( var2->value.string ) != FNV1A( "0" ); 58 | else if ( fnv1a_rt( var->get_name() ) == FNV1A( "cl_predict" ) ) 59 | ConVar::cl_predict = fnv1a_rt( var2->value.string ) != FNV1A( "0" ); 60 | } 61 | 62 | original( convar_network_change_callback )( var, old1, old2 ); 63 | } 64 | -------------------------------------------------------------------------------- /internal_hvh/hooks/do_post_screen_space_effects.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | bool _fastcall hook::do_post_screen_space_effects( void* ecx, void* edx, CViewSetup* setup ) 4 | { 5 | glow::draw(); 6 | 7 | lua::api.callback( FNV1A( "on_do_post_screen_space_effects" ) ); 8 | 9 | chams::in_glow = true; 10 | const auto ret = original( do_post_screen_space_effects )( ecx, edx, setup ); 11 | chams::in_glow = false; 12 | 13 | glow::restore(); 14 | 15 | return ret; 16 | } -------------------------------------------------------------------------------- /internal_hvh/hooks/emit_sound.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | int __fastcall hook::emit_sound( void* thisptr, int edx, void* filter, int iEntIndex, int iChannel, const char* pSoundEntry, unsigned int nSoundEntryHash, const char* pSample, float flVolume, float flAttenuation, int nSeed, int iFlags, int iPitch, const Vector* pOrigin, const Vector* pDirection, void* pUtlVecOrigins, bool bUpdatePositions, float soundtime, int speakerentity, int unk ) 4 | { 5 | if ( CGameMovement::computing ) 6 | return 0; 7 | 8 | if ( !interfaces::engine()->IsInGame() && vars::misc.autoaccept->get() && fnv1a_rt( pSoundEntry ) == FNV1A( "UIPanorama.popup_accept_match_beep" ) ) 9 | { 10 | reinterpret_cast< char( __stdcall* )( const char* ) >( make_offset( "client.dll", sig_is_ready ) )( " " ); 11 | interfaces::surface()->PlaySound( xorstr_( "buttons/light_power_on_switch_01.wav" ) ); 12 | 13 | FLASHWINFO flash; 14 | flash.cbSize = sizeof( FLASHWINFO ); 15 | flash.hwnd = init::window; 16 | flash.dwFlags = FLASHW_ALL | FLASHW_TIMERNOFG; 17 | flash.uCount = 0; 18 | flash.dwTimeout = 0; 19 | imp( "user32.dll", FlashWindowEx )( &flash ); 20 | 21 | return original( emit_sound )( thisptr, edx, filter, iEntIndex, iChannel, pSoundEntry, nSoundEntryHash, pSample, 0.f, flAttenuation, nSeed, iFlags, iPitch, pOrigin, pDirection, pUtlVecOrigins, bUpdatePositions, soundtime, speakerentity, unk ); 22 | } 23 | 24 | _( weapon, "weapon" ); 25 | _( draw, "draw" ); 26 | _( deploy, "deploy" ); 27 | if ( strstr( pSample, weapon.c_str() ) && ( strstr( pSample, draw.c_str() ) || strstr( pSample, deploy.c_str() ) ) ) 28 | { 29 | static uint32_t prev_hash = 0; 30 | const uint32_t hash = fnv1a_rt( pSample ); 31 | 32 | if ( prev_hash == hash ) 33 | return 0; 34 | 35 | prev_hash = hash; 36 | } 37 | 38 | return original( emit_sound )( thisptr, edx, filter, iEntIndex, iChannel, pSoundEntry, nSoundEntryHash, pSample, flVolume, flAttenuation, nSeed, iFlags, iPitch, pOrigin, pDirection, pUtlVecOrigins, bUpdatePositions, soundtime, speakerentity, unk ); 39 | } 40 | 41 | int __fastcall hook::start_sound_immediate( start_sound_params* params, int edx ) 42 | { 43 | if ( CGameMovement::computing || !params || !params->sfx ) 44 | return 0; 45 | 46 | char name[ MAX_PATH ]; 47 | params->sfx->get_name( name, MAX_PATH ); 48 | 49 | if ( params->fromserver && params->sound_source == interfaces::engine()->GetLocalPlayer() ) 50 | { 51 | _( player_footsteps, "player\\footsteps" ); 52 | _( zoom, "zoom" ); 53 | if ( strstr( name, player_footsteps.c_str() ) || strstr( name, zoom.c_str() ) ) 54 | return 0; 55 | } 56 | 57 | sound_esp::on_start_sound( params, name ); 58 | 59 | return original( start_sound_immediate )( params, edx ); 60 | } 61 | 62 | void __fastcall hook::start_sound( IMoveHelper* move_helper, int edx, const Vector& origin, const char* soundname ) 63 | { 64 | if ( CGameMovement::computing ) 65 | return; 66 | 67 | original( start_sound )( move_helper, edx, origin, soundname ); 68 | } -------------------------------------------------------------------------------- /internal_hvh/hooks/estimate_abs_velocity.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | #include 3 | 4 | void __fastcall hook::estimate_abs_velocity( C_CSPlayer* player, int edx, Vector* out ) 5 | { 6 | // grab return address from stack frame. 7 | uintptr_t* _ebp; 8 | __asm mov _ebp, ebp; 9 | auto& ret_addr = _ebp[ 1 ]; 10 | 11 | // game tried to setup velocity for something irrelevant. 12 | if ( ret_addr != make_offset( "client.dll", sig_ret_to_setup_velocity ) || !player->is_player() || vars::legit_enabled() && player->EntIndex() != interfaces::engine()->GetLocalPlayer() ) 13 | return original( estimate_abs_velocity )( player, edx, out ); 14 | 15 | // write 'real' velocity to output. 16 | Vector velocity{}; 17 | if ( player->EntIndex() == interfaces::engine()->GetLocalPlayer() && false ) 18 | { 19 | original( estimate_abs_velocity )( player, edx, out ); 20 | velocity = *out; 21 | } 22 | else 23 | { 24 | velocity = player->get_velocity(); 25 | *out = velocity; 26 | } 27 | 28 | // skip velocity clamping shit. 29 | ret_addr += 0x101; 30 | 31 | // emulate volatile registers between the two addresses. 32 | __asm 33 | { 34 | movss xmm1, velocity.z 35 | movss xmm3, velocity.y 36 | movss xmm4, velocity.x 37 | } 38 | } -------------------------------------------------------------------------------- /internal_hvh/hooks/find_material.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | #include "intrin.h" 3 | 4 | IMaterial* __fastcall hook::find_material( void* thisptr, void* edx, const char* material_name, const char* texture_group, bool complain, const char* complain_prefix ) 5 | { 6 | if ( !vars::misc.remove_blur->get() ) 7 | return original( find_material )( thisptr, edx, material_name, texture_group, complain, complain_prefix ); 8 | 9 | if ( material_name[ 0 ] == 'd' && material_name[ 4 ] == 's' && material_name[ 10 ] == 'b' ) 10 | { 11 | _( str, "dev/clearalpha" ); 12 | static auto clear_alpha = original( find_material )( thisptr, edx, str.c_str(), nullptr, complain, complain_prefix ); 13 | return clear_alpha; 14 | } 15 | 16 | return original( find_material )( thisptr, edx, material_name, texture_group, complain, complain_prefix ); 17 | } -------------------------------------------------------------------------------- /internal_hvh/hooks/frame_stage_notify.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | #include 3 | 4 | extern std::vector> queued_calls; 5 | 6 | void __stdcall hook::frame_stage_notify( ClientFrameStage_t stage ) 7 | { 8 | visuals::game_curtime = interfaces::globals()->curtime; 9 | 10 | if ( globals::erase_init ) 11 | { 12 | erase_fn( init::on_startup ); 13 | globals::erase_init = false; 14 | } 15 | 16 | misc::custom_render_options( stage ); 17 | 18 | chams::dark_mode( stage ); 19 | 20 | freestanding::update_hotkeys( stage ); 21 | 22 | misc::remove_smoke( stage ); 23 | 24 | misc::remove_flash( stage ); 25 | 26 | misc::preserve_deathnotices( stage ); 27 | 28 | player_log::run_log( stage ); 29 | 30 | misc::fix_prediction( stage ); 31 | 32 | lua::api.callback( FNV1A( "on_frame_stage_notify" ), [&] ( lua::state& s ) -> int 33 | { 34 | s.push( static_cast< int >( stage ) ); 35 | s.push( true ); 36 | 37 | return 2; 38 | } ); 39 | 40 | if ( stage == FRAME_RENDER_START ) 41 | { 42 | if ( interfaces::engine()->IsConnected() && interfaces::engine()->IsInGame() ) 43 | { 44 | /*for ( const auto player : interfaces::entity_list()->get_players() ) 45 | { 46 | auto& var_mapping = player->get_var_mapping(); 47 | auto& entries = var_mapping.m_Entries; 48 | 49 | for ( auto j = 0; j < entries.Count(); j++ ) 50 | { 51 | const auto& entry = entries[ j ]; 52 | entry.watcher->get_type_flags() |= 1 << 4; 53 | } 54 | }*/ 55 | 56 | if ( const auto player = local_player; player && player->get_alive() && player->get_anim_state() ) 57 | { 58 | const auto bak_sequence = player->get_sequence(); 59 | player->get_sequence() = -1; 60 | player->get_anim_state()->player = nullptr; 61 | original( update_clientside_anim )( player, nullptr ); 62 | player->get_anim_state()->player = player; 63 | player->get_sequence() = bak_sequence; 64 | } 65 | } 66 | } 67 | 68 | original( frame_stage_notify )( stage ); 69 | 70 | resolver::approve_shots( stage ); 71 | 72 | resolver::update_missed_shots( stage ); 73 | 74 | chams::extend_drawing( stage ); 75 | 76 | misc::ragdoll_slowpath( stage ); 77 | 78 | skinchanger::run( stage ); 79 | 80 | if ( stage == FRAME_RENDER_END ) 81 | { 82 | if ( adapter && dx_adapter::mtx.try_lock() ) 83 | { 84 | dx_adapter::clear_buffer(); 85 | 86 | visuals::run(); 87 | visuals::render(); 88 | entity_rendering::paint(); 89 | 90 | for ( auto& call : queued_calls ) 91 | call(); 92 | 93 | queued_calls.clear(); 94 | 95 | lua::api.in_render = true; 96 | lua::api.callback( FNV1A( "on_paint" ) ); 97 | lua::api.in_render = false; 98 | 99 | dx_adapter::ready = true; 100 | dx_adapter::mtx.unlock(); 101 | } 102 | 103 | thirdperson::run(); 104 | } 105 | 106 | lua::api.callback( FNV1A( "on_frame_stage_notify" ), [&] ( lua::state& s ) -> int 107 | { 108 | s.push( static_cast< int >( stage ) ); 109 | s.push( false ); 110 | 111 | return 2; 112 | } ); 113 | 114 | if ( stage == FRAME_START ) 115 | lua::api.run_timers(); 116 | } 117 | -------------------------------------------------------------------------------- /internal_hvh/hooks/is_box_visible.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | #include 3 | 4 | int __stdcall hook::is_box_visible( const Vector& mins, const Vector& maxs ) 5 | { 6 | if ( reinterpret_cast< uintptr_t >( _ReturnAddress() ) == make_offset( "client.dll", sig_ret_is_box_visible ) ) 7 | return 1; 8 | 9 | return original( is_box_visible )( mins, maxs ); 10 | } -------------------------------------------------------------------------------- /internal_hvh/hooks/is_connected.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | #include 3 | 4 | bool __fastcall hook::is_connected( void* ecx, void* edx ) 5 | { 6 | if ( reinterpret_cast< uintptr_t >( _ReturnAddress() ) == make_offset( "client.dll", sig_ret_to_enable_inventory ) ) // enable inventory 7 | return false; 8 | 9 | return original( is_connected )( ecx, edx ); 10 | } 11 | -------------------------------------------------------------------------------- /internal_hvh/hooks/level_shutdown.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | 4 | void __fastcall hook::level_shutdown( void* ecx, void* edx ) 5 | { 6 | skinchanger::on_level_shudown(); 7 | 8 | return original( level_shutdown )( ecx, edx ); 9 | } 10 | -------------------------------------------------------------------------------- /internal_hvh/hooks/lua.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | void __fastcall hook::client_cmd_unrestricted( IEngineClient* client, int edx, const char* szCmdString, const char* newFlag ) 4 | { 5 | if ( std::string cmd = szCmdString; cmd.starts_with( _r( "> " ) ) || cmd.starts_with( _r( "eval " ) ) ) 6 | return lua::api.on_con_command( { cmd.begin() + ( cmd.starts_with( _r( "> " ) ) ? 2 : 5 ), cmd.end() } ); 7 | 8 | lua::api.callback( FNV1A( "on_console_input" ), [&] ( lua::state& s ) -> int 9 | { 10 | s.push( szCmdString ); 11 | return 1; 12 | } ); 13 | 14 | original( client_cmd_unrestricted )( client, edx, szCmdString, newFlag ); 15 | } -------------------------------------------------------------------------------- /internal_hvh/hooks/misc.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | NTSTATUS NTAPI hook::nt_query_virtual_memory( HANDLE process_handle, PVOID base_address, int memory_information_class, PMEMORY_BASIC_INFORMATION mem_information, ULONG length, PULONG result_length ) 4 | { 5 | const auto status = hook_list[ reinterpret_cast< uintptr_t >( nt_query_virtual_memory ) ].get_original()( process_handle, base_address, memory_information_class, mem_information, length, result_length ); 6 | if ( !status && !memory_information_class && mem_information && mem_information->AllocationBase == globals::module_base ) 7 | mem_information->Type = MEM_IMAGE; 8 | 9 | return status; 10 | } 11 | 12 | int32_t __stdcall hook::get_module_handle_ex_a( uint32_t flags, const char* str, uint32_t* mod ) 13 | { 14 | uintptr_t** _ebp; 15 | __asm mov _ebp, ebp; 16 | auto& ret_addr = _ebp[ 1 ]; 17 | 18 | if ( *ret_addr == 0x2374c085 ) 19 | { 20 | ret_addr = reinterpret_cast< uintptr_t* >( reinterpret_cast< uintptr_t >( ret_addr ) + 0x47 ); 21 | return 1; 22 | } 23 | 24 | return original( get_module_handle_ex_a )( flags, str, mod ); 25 | } 26 | 27 | int __fastcall hook::particle_draw_model( void* ecx, void* edx, int flags, const RenderableInstance_t& instance ) 28 | { 29 | const auto brightness = 1.f + ( !vars::visuals.dark->get() ? 0.f : vars::visuals.darkness->get() * 0.01f ); 30 | const Vector def( brightness, brightness, brightness ); 31 | 32 | CMatRenderContextPtr ctx( interfaces::material_system()( )->GetRenderContext() ); 33 | const auto org = ctx->GetToneMappingScaleLinear(); 34 | ctx->SetToneMappingScaleLinear( def ); 35 | 36 | const auto ret = original( particle_draw_model )( ecx, edx, flags, instance ); 37 | 38 | ctx->SetToneMappingScaleLinear( org ); 39 | ctx.SafeRelease(); 40 | 41 | return ret; 42 | } -------------------------------------------------------------------------------- /internal_hvh/hooks/override_view.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | #include "intrin.h" 3 | 4 | void __fastcall hook::trace_ray( void* thisptr, void* edx, Ray_t& ray, unsigned int fMask, ITraceFilter* pTraceFilter, trace_t* pTrace ) 5 | { 6 | if ( reinterpret_cast< uintptr_t >( _ReturnAddress() ) == make_offset( "client.dll", sig_ret_to_trace_ray ) ) 7 | { 8 | if ( fMask == 0x200400B ) 9 | { 10 | CTraceFilterSimpleNoPlayers new_filter( local_player, 0 ); 11 | if ( local_player && antiaim::in_fakeduck() ) 12 | ray.m_Start.z = local_player->get_abs_origin().z + 64.f; 13 | 14 | return original( trace_ray )( thisptr, edx, ray, fMask, &new_filter, pTrace ); 15 | } 16 | 17 | if ( pTraceFilter->pSkip == local_player ) 18 | { 19 | CTraceFilterSimpleNoTeammates new_filter( local_player, 0 ); 20 | return original( trace_ray )( thisptr, edx, ray, fMask, &new_filter, pTrace ); 21 | } 22 | } 23 | 24 | return original( trace_ray )( thisptr, edx, ray, fMask, pTraceFilter, pTrace ); 25 | } 26 | 27 | void __stdcall hook::override_view( CViewSetup* setup ) 28 | { 29 | if ( local_player && antiaim::in_fakeduck() && local_player->get_alive() && interfaces::input()->m_fCameraInThirdPerson ) 30 | setup->origin.z = local_player->get_abs_origin().z + 64.f; 31 | 32 | original( override_view )( setup ); 33 | } -------------------------------------------------------------------------------- /internal_hvh/hooks/packet_start.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | bool __fastcall hook::send_net_msg( void* netchan, void* edx, INetMessage& msg, bool reliable, bool voice ) 4 | { 5 | if ( vars::misc.sv_pure->get() && msg.GetType() == 14 ) 6 | return true; 7 | 8 | if ( msg.GetType() == 18 && fnv1a_rt( msg.GetName() ) == FNV1A( "CCLCMsg_CmdKeyValues" ) ) 9 | { 10 | const auto keyvalues = KeyValues::from_netsmg( reinterpret_cast< INetMessage* >( reinterpret_cast< uintptr_t >( &msg ) + 0x4 ) ); 11 | const auto orig_name = keyvalues->get_name(); 12 | const auto name = fnv1a_rt( keyvalues->get_name() ); 13 | const auto cmp = name == FNV1A( "UserExtraData" ) || name == FNV1A( "GameInfo" ); 14 | keyvalues->~KeyValues(); 15 | if ( cmp ) 16 | return true; 17 | } 18 | 19 | if ( msg.GetGroup() == 9 ) 20 | voice = false; 21 | 22 | return original( send_net_msg )( netchan, edx, msg, reliable, voice ); 23 | } 24 | 25 | void __fastcall hook::packet_start( IClientState* state, uint32_t edx, int incoming_sequence, int outgoing_acknowledged ) 26 | { 27 | // erase commands that are out of range by a huge margin. 28 | globals::sent_commands.erase( std::ranges::remove_if( globals::sent_commands, [&] ( const uint32_t& cmd ) { return abs( static_cast< int32_t >( outgoing_acknowledged - cmd ) ) >= 150; } ).begin(), globals::sent_commands.end() ); 29 | 30 | // rollback the ack count to what we aimed for. 31 | auto target_acknowledged = outgoing_acknowledged; 32 | for ( const auto cmd : globals::sent_commands ) 33 | if ( outgoing_acknowledged >= cmd ) 34 | target_acknowledged = cmd; 35 | 36 | original( packet_start )( state, edx, incoming_sequence, target_acknowledged ); 37 | } 38 | 39 | bool __fastcall hook::SVCMsg_VoiceData( void* ecx, void* edx, CSVCMsg_VoiceData* msg ) 40 | { 41 | if ( shared_data::on_voice_data( msg ) ) 42 | return original( SVCMsg_VoiceData )( ecx, edx, msg ); 43 | 44 | return true; 45 | } -------------------------------------------------------------------------------- /internal_hvh/hooks/paint_traverse.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | void __fastcall hook::paint_traverse( void* pPanels, int edx, unsigned int panel, bool forceRepaint, bool allowForce ) 4 | { 5 | static unsigned int scope_panel; 6 | if ( !scope_panel ) 7 | { 8 | const auto panelname = interfaces::panel()->GetName( panel ); 9 | 10 | _( HudZoom, "HudZoom" ); 11 | if ( !strcmp( panelname, HudZoom.c_str() ) ) 12 | scope_panel = panel; 13 | } 14 | 15 | if ( panel == scope_panel && ( vars::misc.remove_scope->get() == 1 || vars::misc.remove_scope->get() == 3 || vars::misc.remove_scope->get() == 4 ) ) 16 | return; 17 | 18 | original( paint_traverse )( pPanels, edx, panel, forceRepaint, allowForce ); 19 | 20 | static unsigned int draw_panel; 21 | if ( !draw_panel ) 22 | { 23 | const auto panelname = interfaces::panel()->GetName( panel ); 24 | 25 | _( FocusOverlayPanel, "FocusOverlayPanel" ); 26 | if ( !strcmp( panelname, FocusOverlayPanel.c_str() ) ) 27 | draw_panel = panel; 28 | } 29 | 30 | if ( panel != draw_panel ) 31 | return; 32 | 33 | lua::api.callback( FNV1A( "on_paint_traverse" ) ); 34 | } -------------------------------------------------------------------------------- /internal_hvh/hooks/present.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | #include 3 | #include 4 | #include "../josefin_sans.h" 5 | 6 | using namespace evo::ren; 7 | 8 | long __stdcall hook::present( IDirect3DDevice9* device, RECT* pSourceRect, RECT* pDestRect, HWND hDestWindowOverride, RGNDATA* pDirtyRegion ) 9 | { 10 | g_input->run(); 11 | 12 | if ( !adapter ) 13 | { 14 | adapter = std::make_shared( device, init::window ); 15 | 16 | char win_dir_arr[ 256 ]{}; 17 | GetSystemWindowsDirectoryA( win_dir_arr, 256 ); 18 | 19 | std::string win_dir{ win_dir_arr }; 20 | draw.manage( FNV1A( "esp" ), std::make_shared<::gui::bitfont>( xorstr_( "Smallest Pixel-7" ), 11.f, 400, ff_antialias | ff_outline, 0, 0x45F ) ); 21 | draw.manage( FNV1A( "esp_name" ), std::make_shared( win_dir + xorstr_( "/fonts/segoeuib.ttf" ), 13.f, ff_shadow, 0, 0x45F ) ); 22 | draw.manage( FNV1A( "title_font" ), std::make_shared( josefin_sans.data(), josefin_sans.size(), 11.f, 0, 0, 0x80 ) ); 23 | draw.manage( FNV1A( "control" ), std::make_shared( josefin_sans.data(), josefin_sans.size(), 11.57f, 0, 0, 0x80 ) ); 24 | draw.manage( FNV1A( "child_title" ), std::make_shared( josefin_sans.data(), josefin_sans.size(), 11.57f, 0, 0, 0x80 ) ); // 600 25 | draw.manage( FNV1A( "tab_font" ), std::make_shared( josefin_sans.data(), josefin_sans.size(), 15.5f, 0, 0, 0x80 ) ); // 600 26 | draw.manage( FNV1A( "glitch_font" ), std::make_shared( win_dir + xorstr_( "/fonts/verdanab.ttf" ), 25.f, 0, 0, 0x80 ) ); 27 | draw.manage( FNV1A( "lby" ), std::make_shared( win_dir + xorstr_( "/fonts/verdanab.ttf" ), 27.f, ff_shadow, 0, 0x80 ) ); 28 | draw.manage( FNV1A( "control_unicode" ), std::make_shared( win_dir + xorstr_( "/fonts/seguisb.ttf" ), 14.6f, 0, 0, 0x45F ) ); 29 | 30 | adapter->create_objects(); 31 | } 32 | 33 | draw.set_frame_time( interfaces::globals()->frametime ); 34 | adapter->refresh(); 35 | 36 | dx_adapter::mtx.lock(); 37 | if ( dx_adapter::ready ) 38 | { 39 | adapter->flush(); 40 | dx_adapter::swap_buffers(); 41 | dx_adapter::ready = false; 42 | } 43 | dx_adapter::mtx.unlock(); 44 | 45 | g_menu->run(); 46 | 47 | adapter->render(); 48 | adapter->flush(); 49 | 50 | return original( present )( device, pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion ); 51 | } 52 | 53 | -------------------------------------------------------------------------------- /internal_hvh/hooks/process_input.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | #include 3 | 4 | void __fastcall hook::lock_cursor( void* ecx, void* edx ) 5 | { 6 | if ( g_menu->is_open() ) 7 | return interfaces::surface()->UnlockCursor(); 8 | 9 | original( lock_cursor )( ecx, edx ); 10 | } 11 | 12 | void __fastcall hook::draw_set_color( void* ecx, void* edx, int r, int g, int b, int a ) 13 | { 14 | const auto return_address = reinterpret_cast< uintptr_t >( _ReturnAddress() ); 15 | 16 | if ( vars::misc.remove_scope->get() == 2 17 | && ( return_address == make_offset( "client.dll", sig_ret_to_scope_arc ) 18 | || return_address == make_offset( "client.dll", sig_ret_to_scope_lens ) ) ) 19 | { 20 | // We don't want this to draw, so we set the alpha to 0 21 | return original( draw_set_color )( ecx, edx, r, g, b, 0 ); 22 | } 23 | 24 | original( draw_set_color )( ecx, edx, r, g, b, a ); 25 | } 26 | 27 | int __fastcall hook::hud_reticle_process_input( void* ecx, void* edx ) 28 | { 29 | QAngle viewangles; 30 | interfaces::engine()->GetViewAngles( viewangles ); 31 | interfaces::prediction()->SetLocalViewAngles( viewangles ); 32 | 33 | return original( hud_reticle_process_input )( ecx, edx ); 34 | } -------------------------------------------------------------------------------- /internal_hvh/hooks/render_view.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | void __fastcall hook::render_view( void* thisptr, void* edx, CViewSetup& setup, CViewSetup& hudViewSetup, unsigned int nClearFlags, uint8_t whatToDraw ) 4 | { 5 | aimbot_helpers::no_visual_recoil( setup ); 6 | 7 | beams::draw_impacts(); 8 | 9 | var( r_aspectratio ); 10 | r_aspectratio->set_value( vars::misc.aspect_ratio->get() / 100.f ); 11 | 12 | if ( vars::misc.vm_fov_enabled->get() && local_player && ( !local_player->get_scoped() || local_weapon && local_weapon->get_weapon_type() == WEAPONTYPE_SNIPER_RIFLE ) ) 13 | setup.fovViewmodel = vars::misc.vm_fov->get(); 14 | 15 | if ( vars::misc.remove_scope->get() ) 16 | reinterpret_cast< float* >( make_offset( "client.dll", sig_post_process_params ) )[ 5 ] = 0.f; 17 | 18 | var( mat_software_aa_strength ); 19 | const auto backup_aa_strength = mat_software_aa_strength->get_float(); 20 | mat_software_aa_strength->set_float( 0.f ); 21 | 22 | *reinterpret_cast< bool* >( make_offset( "client.dll", sig_disable_post_processing ) ) = vars::visuals.disable_postprocessing->get(); 23 | original( render_view )( thisptr, edx, setup, hudViewSetup, nClearFlags, whatToDraw ); 24 | 25 | mat_software_aa_strength->set_float( backup_aa_strength ); 26 | } 27 | -------------------------------------------------------------------------------- /internal_hvh/hooks/reset.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | #include 3 | 4 | using namespace evo::ren; 5 | 6 | long __stdcall hook::reset( IDirect3DDevice9* device, D3DPRESENT_PARAMETERS* pp ) 7 | { 8 | if ( !adapter ) 9 | return original( reset )( device, pp ); 10 | 11 | 12 | adapter->destroy_objects(); 13 | 14 | const auto hr = original( reset )( device, pp ); 15 | 16 | adapter->create_objects(); 17 | 18 | return hr; 19 | } 20 | -------------------------------------------------------------------------------- /internal_hvh/hooks/scene_end.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | void __fastcall hook::scene_end( void* ecx, void* edx ) 4 | { 5 | original( scene_end )( ecx, edx ); 6 | 7 | chams::dormant_chams(); 8 | 9 | chams::draw_death_ghost(); 10 | } 11 | 12 | void __stdcall hook::calc_renderable_world_space_aabb_bloated( RenderableInfo_t* info, Vector& absMins, Vector& absMaxs ) 13 | { 14 | if ( !info || !info->m_pRenderable ) 15 | return original( calc_renderable_world_space_aabb_bloated )( info, absMins, absMaxs ); 16 | 17 | const auto unknown = info->m_pRenderable->GetIClientUnknown(); 18 | if ( !unknown ) 19 | return original( calc_renderable_world_space_aabb_bloated )( info, absMins, absMaxs ); 20 | 21 | const auto player = reinterpret_cast< C_BasePlayer* >( unknown->GetBaseEntity() ); 22 | if ( !player || !player->is_player() && player->GetClientClass()->m_ClassID != ClassId::CCSRagdoll ) 23 | return original( calc_renderable_world_space_aabb_bloated )( info, absMins, absMaxs ); 24 | 25 | if ( !vars::visuals.chams.extended->get() || !local_player || player == local_player || !local_player->get_alive() ) 26 | return original( calc_renderable_world_space_aabb_bloated )( info, absMins, absMaxs ); 27 | 28 | const auto backup_renderable = info->m_pRenderable; 29 | info->m_pRenderable = local_player->get_renderable(); 30 | original( calc_renderable_world_space_aabb_bloated )( info, absMins, absMaxs ); 31 | info->m_pRenderable = backup_renderable; 32 | } 33 | 34 | #define IsLeafMarker( p ) (bool)((reinterpret_cast(p)) & 1) 35 | 36 | 37 | void __stdcall hook::add_renderables_to_render_lists( const SetupRenderInfo_t& info, int nCount, RenderableInfo_t** ppRenderables, BuildRenderListInfo_t* pRLInfo, int nDetailCount, void* pDetailInfo ) 38 | { 39 | for ( auto i = 0; i < nCount; ++i ) 40 | { 41 | const auto renderable_info = ppRenderables[ i ]; 42 | if ( IsLeafMarker( renderable_info ) ) 43 | continue; 44 | 45 | if ( renderable_info && renderable_info->m_nModelType == 2 && !renderable_info->m_bDisableCSMRendering ) 46 | renderable_info->m_nTranslucencyType = vars::visuals.prop_transparency->get() > 0.f ? 1 : 2; 47 | 48 | if ( renderable_info && renderable_info->m_nModelType == 1 && renderable_info->m_pRenderable ) 49 | { 50 | const auto unkn = renderable_info->m_pRenderable->GetIClientUnknown(); 51 | const auto ent = unkn ? unkn->GetBaseEntity() : nullptr; 52 | 53 | if ( ent && ent->is_player() ) 54 | renderable_info->m_nTranslucencyType = 1; 55 | 56 | /*const auto parent = reinterpret_cast< IClientRenderable* >( renderable_info->m_pRenderable )->GetShadowParent(); 57 | const auto unknown = parent != nullptr ? parent->GetIClientUnknown() : nullptr; 58 | const auto owner = unknown != nullptr ? reinterpret_cast< C_CSPlayer* const >( unknown->GetIClientEntity() ) : nullptr; 59 | if ( owner && owner->is_player() ) 60 | renderable_info->m_nTranslucencyType = 1;*/ 61 | } 62 | 63 | } 64 | original( add_renderables_to_render_lists )( info, nCount, ppRenderables, pRLInfo, nDetailCount, pDetailInfo ); 65 | } -------------------------------------------------------------------------------- /internal_hvh/hooks/wnd_proc.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | LRESULT __stdcall hook::wnd_proc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ) 4 | { 5 | lua::api.callback( FNV1A( "on_input" ), [&] ( lua::state& s ) -> int 6 | { 7 | s.push( static_cast< int >( uMsg ) ); 8 | s.push( static_cast< int >( wParam ) ); 9 | s.push( static_cast< int >( lParam ) ); 10 | 11 | return 3; 12 | } ); 13 | 14 | 15 | auto handled_mouse = false; 16 | auto handled_keyboard = false; 17 | auto handled_char = false; 18 | 19 | if ( uMsg == WM_KEYUP && wParam == VK_INSERT ) 20 | g_menu->toggle(); 21 | 22 | if ( hWnd != GetActiveWindow() ) 23 | { 24 | for ( auto i = 0; i < 256; i++ ) 25 | { 26 | g_input->m_key_info.at( i ).pressed = false; 27 | g_input->m_key_info.at( i ).held = false; 28 | g_input->m_key_info.at( i ).released = true; 29 | } 30 | 31 | g_menu->run_hotkey_input(); 32 | } 33 | else 34 | { 35 | handled_mouse = g_input->run_mouse( uMsg ); 36 | handled_keyboard = g_input->run_keyboard( uMsg, wParam ); 37 | 38 | if ( uMsg == WM_CHAR ) 39 | { 40 | if ( wParam > 0 && wParam < 0x10000 ) 41 | g_input->m_last_char = static_cast< wchar_t >( wParam ); 42 | 43 | handled_char = true; 44 | } 45 | } 46 | 47 | //if ( uMsg == WM_KEYUP && wParam == VK_END ) // debug 48 | //g_menu->reset(); 49 | 50 | if ( handled_keyboard ) 51 | g_menu->run_hotkey_input(); 52 | 53 | if ( g_menu->is_open() && ( handled_mouse || handled_keyboard || handled_char ) ) 54 | { 55 | g_menu->run_input(); 56 | 57 | const auto handled_scroll = g_input->get_mouse().scroll == 0; 58 | 59 | g_input->get_mouse().reset_scroll(); 60 | 61 | g_input->clear_char(); 62 | 63 | if ( handled_mouse || handled_scroll && uMsg == WM_MOUSEWHEEL || wParam == VK_ESCAPE || g_menu->get_keyboard_control() ) 64 | return false; 65 | } 66 | 67 | for ( auto i = 0; i < 256; i++ ) 68 | g_input->m_key_info.at( i ).released = false; 69 | 70 | const auto ret = original( wnd_proc )( hWnd, uMsg, wParam, lParam ); 71 | 72 | return ret && !handled_keyboard && !handled_mouse; 73 | } -------------------------------------------------------------------------------- /internal_hvh/include_cheat.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "includes.h" 4 | 5 | #include "misc/tsl/robin_map.h" 6 | #include "misc/offsets.h" 7 | #include "misc/networking/net_offsets.h" 8 | #include "cthash.h" 9 | #include "misc/memory.h" 10 | #include "misc/util.h" 11 | #include "misc/hybrid_hook.h" 12 | #include "misc/init.h" 13 | #include "sdk/defines.h" 14 | #include "sdk/datatypes/include_datatypes.h" 15 | #include "misc/math.h" 16 | #include "sdk/include_sdk.h" 17 | #include "misc/globals.h" 18 | #include "misc/intersection.h" 19 | #include "hooks/hooks.h" 20 | #include "features/include_features.h" 21 | #include "misc/listeners.h" 22 | #include "misc/renderer/include/ren/renderer.h" 23 | #include "misc/dx_adapter.h" 24 | #include "../misc/input.h" 25 | #include 26 | #include 27 | #include 28 | #include "menu/menu_include.h" -------------------------------------------------------------------------------- /internal_hvh/includes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef RELEASE 4 | namespace std 5 | { 6 | inline const char* _Syserror_map( int ) { return nullptr; } 7 | [[noreturn]] inline void _Throw_C_error( int ) { while ( true ); } 8 | [[noreturn]] inline void _Throw_Cpp_error( int ) { while ( true ); } 9 | inline int _Winerror_map( int ) { return 0; } 10 | [[noreturn]] inline void _Xbad_function_call() { while ( true ); } 11 | [[noreturn]] inline void _Xinvalid_argument( char const* ) { while ( true ); } 12 | [[noreturn]] inline void _Xlength_error( char const* ) { while ( true ); } 13 | [[noreturn]] inline void _Xout_of_range( char const* ) { while ( true ); } 14 | } 15 | #endif 16 | 17 | #pragma warning( disable : 4530 ) 18 | 19 | #define WIN32_NO_STATUS 20 | #define _WINSOCKAPI_ 21 | #define NOCRYPT 22 | #include 23 | #undef WIN32_NO_STATUS 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include "threadsafe_deque.h" 38 | #include 39 | 40 | #ifdef NO_VIRT 41 | #define VIRTUALIZER_TIGER_WHITE_START {} 42 | #define VIRTUALIZER_TIGER_WHITE_END {} 43 | #define VIRTUALIZER_SHARK_RED_START {} 44 | #define VIRTUALIZER_SHARK_RED_END {} 45 | #define VIRTUALIZER_LION_WHITE_START {} 46 | #define VIRTUALIZER_LION_WHITE_END {} 47 | #define VIRTUALIZER_LION_RED_START {} 48 | #define VIRTUALIZER_LION_RED_END {} 49 | #define VIRTUALIZER_LION_BLACK_START {} 50 | #define VIRTUALIZER_LION_BLACK_END {} 51 | #define VIRTUALIZER_DOLPHIN_WHITE_START {} 52 | #define VIRTUALIZER_DOLPHIN_WHITE_END {} 53 | #define VIRTUALIZER_DOLPHIN_WHITE_START {} 54 | #define VIRTUALIZER_DOLPHIN_WHITE_END {} 55 | #define VIRTUALIZER_DOLPHIN_BLACK_START {} 56 | #define VIRTUALIZER_DOLPHIN_BLACK_END {} 57 | #else 58 | #include 59 | #endif 60 | 61 | template __forceinline int signum( T val ) 62 | { 63 | return ( T( 0 ) < val ) - ( val < T( 0 ) ); 64 | } 65 | 66 | template __forceinline T clamp( const T& n, const T& lower, const T& upper ) 67 | { 68 | return max( lower, min( n, upper ) ); 69 | }; 70 | 71 | #ifndef __clang__ 72 | #define __attribute__(x) 73 | #endif 74 | 75 | #pragma comment(lib, "d3d9.lib") 76 | #pragma comment(lib, "d3dx9.lib") 77 | #pragma comment(lib, "winmm.lib") 78 | #pragma warning( disable : 4616 ) 79 | #pragma warning( disable : 4244 ) 80 | #pragma warning( disable : 4838 ) 81 | #pragma warning( disable : 4018 ) 82 | #pragma warning( disable : 1251 ) 83 | #pragma warning( disable : 3291 ) 84 | #pragma warning( disable : 1491 ) 85 | #pragma warning( disable : 1563 ) 86 | #pragma warning( disable : 4750 ) -------------------------------------------------------------------------------- /internal_hvh/internal_hvh.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /internal_hvh/menu/effects.h: -------------------------------------------------------------------------------- 1 | class particle 2 | { 3 | public: 4 | particle( const Vector& pos, const Vector& velocity, const bool golden ) : pos( pos ), velocity( velocity ), golden( golden ) {} 5 | 6 | Vector pos; 7 | Vector velocity; 8 | bool golden; 9 | }; 10 | 11 | class particle_drawer 12 | { 13 | public: 14 | particle_drawer( const int width, const int height, const int particles, const float foreground_plane ) : 15 | max_particles{ particles }, 16 | screen_width{ width }, 17 | screen_height{ height }, 18 | focus_point{ width / 2.f, height / 2.f }, 19 | foreground_plane{ foreground_plane } { spawn_particles(); } 20 | 21 | ~particle_drawer() = default; 22 | 23 | void draw( int alpha ); 24 | void draw_foreground( const int alpha ); 25 | private: 26 | void spawn_particles(); 27 | void handle_respawn( particle& particle ) const; 28 | 29 | void update( particle& particle ) const; 30 | static void parallax( particle& particle, const evo::ren::vec2& delta ); 31 | void draw_particle( particle& particle, const int alpha, const bool foreground ) const; 32 | 33 | int max_particles = -1; 34 | int screen_width = -1; 35 | int screen_height = -1; 36 | evo::ren::vec2 focus_point{}; 37 | float foreground_plane = 0.f; 38 | std::vector particles{}; 39 | }; -------------------------------------------------------------------------------- /internal_hvh/menu/elements/alpha_slider.cpp: -------------------------------------------------------------------------------- 1 | #include "../menu_include.h" 2 | 3 | using namespace evo::ren; 4 | 5 | void alpha_slider::run_render( evo::ren::vec2& pos ) 6 | { 7 | if ( !should_render() ) 8 | return; 9 | 10 | m_pos = pos; 11 | 12 | handle_hover_progress(); 13 | 14 | /* 15 | * Name of the slider 16 | */ 17 | 18 | /* 19 | * Store position where operators will be drawn 20 | */ 21 | m_operator_pos = { floorf( m_pos.x + m_size.x - g_menu->get_style( e_menu_style::window_padding ).x ), floorf( m_pos.y + m_string_size.y / 2 + 2 ) }; 22 | 23 | /* 24 | * Start drawing the actual slider below the text 25 | */ 26 | _u( name, m_name ); 27 | if ( !name.empty() ) 28 | { 29 | m_pos.y += m_string_size.y; 30 | } 31 | 32 | 33 | auto& d = draw.get_layer( layer::foreground ); 34 | 35 | /* 36 | * Inner 37 | */ 38 | d.add_rect_filled_linear_gradient( rect_legacy( { m_pos.x + 1, m_pos.y + 1 }, { m_size.x - 1, m_string_size.y * .65f - 2 } ), gui_color::control_top(), gui_color::control_bot() ); 39 | d.add_rect_filled( rect_legacy( { m_pos.x + 2, m_pos.y + 2 }, { m_size.x - 3, m_string_size.y * .65f - 2 } ), gui_color::custom( color( 242, 242, 242 ) ) ); 40 | 41 | //upper 42 | for ( size_t i = 0; i < m_size.x - 12; i += 10 ) 43 | { 44 | d.add_rect_filled( rect_legacy( { m_pos.x + 2 + i, m_pos.y + 2 }, { 5, 4 } ), color( 213, 213, 213 ) ); 45 | } 46 | 47 | //lower 48 | for ( size_t i = 0; i < m_size.x - 12; i += 10 ) 49 | { 50 | d.add_rect_filled( rect_legacy( { m_pos.x + 2 + 5 + i, m_pos.y + 2 + 4 }, { 5, 4 } ), color( 213, 213, 213 ) ); 51 | } 52 | 53 | 54 | /* 55 | * Border 56 | */ 57 | d.add_rect( rect_legacy( { m_pos.x, m_pos.y }, { m_size.x + 1, m_string_size.y * .75f } ), gui_color::palette::border() ); 58 | d.add_rect( rect_legacy( { m_pos.x, m_pos.y }, { m_size.x + 1, m_string_size.y * .75f } ), m_dragging ? gui_color::palette::main_pink() : gui_color::palette::main_pink( m_hover_progress * 255 ) ); 59 | 60 | /* 61 | * Slider bounds 62 | */ 63 | const auto slider_pos = Vector2D( m_pos.x + 2, m_pos.y + 3 ); 64 | const auto slider_size = Vector2D( ( m_size.x - 3 ) * ( m_var->get() - m_min ) / static_cast< float >( m_max - m_min ), m_string_size.y * .75f - 3 ); 65 | 66 | /* 67 | * Value slider 68 | */ 69 | 70 | d.add_rect_filled_linear_gradient( rect_legacy( { slider_pos.x, slider_pos.y - 1 }, { m_size.x - 3, slider_size.y - 1 } ), 71 | gui_color::custom( Color( m_color->get(), 0 ) ), gui_color::custom( Color( m_color->get(), 255 ) ), true ); 72 | 73 | d.add_rect_filled( rect_legacy( { slider_pos.x + slider_size.x - 2, slider_pos.y - 4 }, { 4, slider_size.y + 5 } ), gui_color::palette::main_pink() ); 74 | 75 | /* 76 | * Reset position and adjust for controls after 77 | */ 78 | m_pos = pos; 79 | 80 | if ( !m_manual_padding ) 81 | pos.y += m_size.y + g_menu->get_style( e_menu_style::control_padding ).y; 82 | } 83 | 84 | -------------------------------------------------------------------------------- /internal_hvh/menu/elements/alpha_slider.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | class alpha_slider : public slider 5 | { 6 | public: 7 | alpha_slider( std::string name, value* var, value* color, float min, float max, uint8_t flags = slider_style::flags::none, std::string format = "%.f", float step = 1.f ) : slider( name, var, min, max, flags, format, step ), m_color( color ) {} 8 | 9 | void run_render( evo::ren::vec2& pos ) override; 10 | private: 11 | value* m_color; 12 | }; -------------------------------------------------------------------------------- /internal_hvh/menu/elements/button.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class value; 4 | 5 | namespace luabridge 6 | { 7 | class LuaRef; 8 | } 9 | 10 | namespace button_style 11 | { 12 | enum flags 13 | { 14 | none = 1 << 0, 15 | lua = 1 << 1, 16 | }; 17 | } 18 | 19 | class button : public control 20 | { 21 | public: 22 | button( std::string name, std::function func, uint8_t flags = button_style::flags::none ); 23 | 24 | void run_render( evo::ren::vec2& pos ) override; 25 | void run_input() override; 26 | 27 | void set_lua_callback( luabridge::LuaRef func ); 28 | private: 29 | std::function m_func = nullptr; 30 | std::thread m_func_thread = {}; 31 | bool m_held = false; 32 | bool m_running = false; 33 | bool m_cancel_callback = false; 34 | 35 | uint8_t m_flags; 36 | }; -------------------------------------------------------------------------------- /internal_hvh/menu/elements/checkbox.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | class value; 5 | 6 | class checkbox : public control 7 | { 8 | public: 9 | checkbox( std::string name, value* var ); 10 | 11 | void run_render( evo::ren::vec2& pos ) override; 12 | void run_input() override; 13 | 14 | bool can_add_subcontrols() override 15 | { 16 | return true; 17 | } 18 | private: 19 | 20 | }; 21 | -------------------------------------------------------------------------------- /internal_hvh/menu/elements/child.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | #include "../../sdk/datatypes/Vector2D.h" 6 | 7 | class tab; 8 | class control; 9 | class sub_tab; 10 | 11 | class child : public std::enable_shared_from_this 12 | { 13 | public: 14 | child( std::string name, evo::ren::vec2 offset, evo::ren::vec2 size, std::vector> controls = {}, std::shared_ptr window_parent = nullptr ); 15 | 16 | void run_render(); 17 | void run_input(); 18 | void reset_state(); 19 | 20 | void init( std::shared_ptr tab ); 21 | 22 | evo::ren::vec2 get_size() const; 23 | evo::ren::vec2 get_pos() const; 24 | 25 | std::string& get_name(); 26 | 27 | std::vector>& get_controls(); 28 | 29 | std::shared_ptr get_parent() const; 30 | void run_hotkey_input(); 31 | std::shared_ptr add_control( std::shared_ptr control ); 32 | void remove_control( std::shared_ptr control ); 33 | private: 34 | std::string m_name; 35 | 36 | void handle_scroll(); 37 | void render_scroll() const; 38 | 39 | evo::ren::vec2 m_pos{}; 40 | evo::ren::vec2 m_offset{}; 41 | evo::ren::vec2 m_size = {}; 42 | 43 | int m_scroll_amount {}; 44 | float m_max_scroll_size {}; 45 | 46 | evo::ren::vec2 m_string_size; 47 | 48 | std::shared_ptrm_window_parent; 49 | std::shared_ptr m_parent; 50 | std::vector> m_controls; 51 | }; -------------------------------------------------------------------------------- /internal_hvh/menu/elements/combobox.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace combobox_style 6 | { 7 | enum flags 8 | { 9 | none, 10 | pop_up, 11 | multi_select 12 | }; 13 | } 14 | 15 | struct combo_item_t 16 | { 17 | combo_item_t() = default; 18 | combo_item_t( std::string name, const int index ) : m_value( nullptr ), m_index( index ), m_name( std::move( name ) ) {} 19 | combo_item_t( std::string name, value* val ) : m_value( val ), m_index( -1 ), m_name( std::move( name ) ) {} 20 | combo_item_t( std::string name, std::string string ) : m_value( nullptr ), m_index( -1 ), m_name( std::move( name ) ), m_string( std::move( string ) ) {} 21 | 22 | value* m_value{}; 23 | int m_index{}; 24 | std::string m_name; 25 | std::string m_string; 26 | }; 27 | 28 | class combobox : public control 29 | { 30 | public: 31 | combobox( const std::string& name, value* var, combobox_style::flags flags = combobox_style::flags::none, std::vector items = {} ); 32 | 33 | void run_render( evo::ren::vec2& pos ) override; 34 | void run_input() override; 35 | void popup_input(); 36 | bool is_combo() override 37 | { 38 | return true; 39 | } 40 | 41 | bool can_add_subcontrols() override 42 | { 43 | return true; 44 | } 45 | 46 | combobox* add_item( const std::string& name, value* var ); 47 | 48 | void reset_state() override 49 | { 50 | if ( g_menu->get_focussed_control() && g_menu->get_focussed_control() == this ) 51 | g_menu->set_focussed_control( nullptr ); 52 | 53 | m_hover_progress = 0.f; 54 | m_hovered = false; 55 | m_open = false; 56 | 57 | for ( auto& control : m_controls ) 58 | control->reset_state(); 59 | } 60 | 61 | std::vector& get_items() 62 | { 63 | return m_items; 64 | } 65 | 66 | void set_items( const std::vector& new_items ) 67 | { 68 | m_items = new_items; 69 | } 70 | 71 | private: 72 | std::string get_display_name(); 73 | void render_popup( const evo::ren::vec2& pos, const evo::ren::vec2& size ); 74 | void render_scroll() const; 75 | 76 | void handle_scroll(); 77 | 78 | evo::ren::vec2 m_popup_pos{}; 79 | evo::ren::vec2 m_popup_size{}; 80 | 81 | bool m_open{}; 82 | bool m_cached_text{}; 83 | 84 | int m_scroll_amount{}; 85 | 86 | std::string m_display_text{}; 87 | 88 | combobox_style::flags m_flags{}; 89 | 90 | std::vector m_items{}; 91 | }; 92 | -------------------------------------------------------------------------------- /internal_hvh/menu/elements/glitch_text.cpp: -------------------------------------------------------------------------------- 1 | #include "../menu_include.h" 2 | 3 | using namespace evo::ren; 4 | 5 | void glitch_text::run_render( std::string text, const vec2& pos, uint32_t font ) 6 | { 7 | static auto last_frame = interfaces::globals()->framecount; 8 | 9 | const auto calculate_glitch = [] ( float& factor ) -> void 10 | { 11 | /* 12 | * Don't do our calculations multiple times per frame! 13 | */ 14 | if ( last_frame == interfaces::globals()->framecount ) 15 | return; 16 | 17 | /* 18 | * Value will reach 1 within 200ms 19 | */ 20 | static auto should_add = false; 21 | 22 | VAL_SMOOTHER( factor, -1.f, 1.f, should_add, 1.f / 0.2f ); 23 | 24 | if ( factor <= -1.f || factor >= 1.f ) 25 | should_add = !should_add; 26 | 27 | last_frame = interfaces::globals()->framecount; 28 | }; 29 | 30 | static auto factor = -1.f; 31 | 32 | calculate_glitch( factor ); 33 | 34 | auto& d = draw.get_layer( layer::foreground ); 35 | /* 36 | * Top text ( blue ) 37 | */ 38 | d.add_text( draw.get_font( font ), { pos.x + factor * 2, pos.y - 1 * std::abs( factor ) }, text, gui_color::glitch_blue() ); 39 | 40 | /* 41 | * Bottom text ( red ) 42 | */ 43 | d.add_text( draw.get_font( font ), { pos.x + -factor * 2, pos.y + 1 * std::abs( factor ) }, text, gui_color::glitch_red() ); 44 | } 45 | -------------------------------------------------------------------------------- /internal_hvh/menu/elements/glitch_text.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | class glitch_text 5 | { 6 | public: 7 | static void run_render( std::string text, const evo::ren::vec2& pos, uint32_t font ); 8 | private: 9 | }; 10 | -------------------------------------------------------------------------------- /internal_hvh/menu/elements/hue_slider.cpp: -------------------------------------------------------------------------------- 1 | #include "../menu_include.h" 2 | 3 | using namespace evo::ren; 4 | 5 | void hue_slider::run_render( vec2& pos ) 6 | { 7 | if ( !should_render() ) 8 | return; 9 | 10 | m_pos = pos; 11 | 12 | handle_hover_progress(); 13 | 14 | /* 15 | * Name of the slider 16 | */ 17 | 18 | /* 19 | * Store position where operators will be drawn 20 | */ 21 | m_operator_pos = { floorf( m_pos.x + m_size.x - g_menu->get_style( e_menu_style::window_padding ).x ), floorf( m_pos.y + m_string_size.y / 2 + 2 ) }; 22 | 23 | /* 24 | * Start drawing the actual slider below the text 25 | */ 26 | _u( name, m_name ); 27 | if ( !name.empty() ) 28 | { 29 | m_pos.y += m_string_size.y; 30 | } 31 | 32 | auto& d = draw.get_layer( layer::foreground ); 33 | 34 | /* 35 | * Inner 36 | */ 37 | d.add_rect_filled_linear_gradient( rect_legacy( { m_pos.x + 1, m_pos.y + 1 }, { m_size.x - 2, m_string_size.y * .65f - 2 } ), gui_color::control_top(), gui_color::control_bot() ); 38 | 39 | /* 40 | * Border 41 | */ 42 | d.add_rect( rect_legacy( { m_pos.x, m_pos.y }, { m_size.x, m_string_size.y * .75f } ), gui_color::palette::border() ); 43 | d.add_rect( rect_legacy( { m_pos.x, m_pos.y }, { m_size.x, m_string_size.y * .75f } ), m_dragging ? gui_color::palette::main_pink() : gui_color::palette::main_pink( m_hover_progress * 255 ) ); 44 | 45 | /* 46 | * Slider bounds 47 | */ 48 | const auto slider_pos = Vector2D( m_pos.x + 2, m_pos.y + 3 ); 49 | const auto slider_size = Vector2D( ( m_size.x - 3 ) * ( m_var->get() - m_min ) / static_cast< float >( m_max - m_min ), m_string_size.y * .75f - 3 ); 50 | 51 | /* 52 | * Value slider 53 | */ 54 | // split bar into 6 segments 55 | const auto segment_size = ( m_size.x - 3 ) / 6.f; 56 | 57 | for ( auto i = 0u; i < 6u; i++ ) 58 | { 59 | const auto cur_color = Color::FromHSB( ( 1.f / 6.f ) * i, 1.f, 1.f ); 60 | const auto next_color = Color::FromHSB( ( 1.f / 6.f ) * ( i + 1 ), 1.f, 1.f ); 61 | 62 | const auto cur_segment = segment_size * i; 63 | 64 | d.add_rect_filled_linear_gradient( rect_legacy( { slider_pos.x + cur_segment, slider_pos.y - 1 }, { i == 5 ? floor( segment_size ) - 1 : ceil( segment_size ), slider_size.y - 1 } ), 65 | cur_color.direct(), next_color.direct(), true ); 66 | } 67 | 68 | d.add_rect_filled( rect_legacy( { slider_pos.x + slider_size.x - 2, slider_pos.y - 4 }, { 4, slider_size.y + 5 } ), gui_color::palette::main_pink() ); 69 | 70 | /* 71 | * Reset position and adjust for controls after 72 | */ 73 | m_pos = pos; 74 | 75 | if ( !m_manual_padding ) 76 | pos.y += m_size.y + g_menu->get_style( e_menu_style::control_padding ).y; 77 | } 78 | 79 | -------------------------------------------------------------------------------- /internal_hvh/menu/elements/hue_slider.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class hue_slider : public slider 4 | { 5 | public: 6 | hue_slider( std::string name, value* var, float min, float max, uint8_t flags = slider_style::flags::none, std::string format = "%.f", float step = 1.f ) : slider( name, var, min, max, flags, format, step ) {} 7 | 8 | void run_render( evo::ren::vec2& pos ) override; 9 | }; 10 | -------------------------------------------------------------------------------- /internal_hvh/menu/elements/listbox.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace listbox_style 4 | { 5 | enum flags 6 | { 7 | none = 1 << 0, 8 | search_bar = 1 << 1, 9 | }; 10 | } 11 | 12 | struct listbox_item_t 13 | { 14 | listbox_item_t( std::string name, const int index, const color col = gui_color::text_solid() ) : m_index( index ), m_color( col ) 15 | { 16 | m_name = std::move( name ); 17 | _u( u_name, m_name ); 18 | hash = fnv1a_rt( u_name ); 19 | return; 20 | } 21 | 22 | std::string m_name; 23 | int m_index; 24 | color m_color; 25 | fnv_t hash; 26 | }; 27 | 28 | class value; 29 | class text_box; 30 | 31 | class listbox : public control 32 | { 33 | public: 34 | listbox( value* var, std::vector* items, int items_to_display = 7, uint8_t flags = listbox_style::flags::none ); 35 | listbox( const std::string& name, value* var, std::vector& items, int items_to_display = 7, uint8_t flags = listbox_style::flags::none ); 36 | listbox( const std::string& name, value* var, std::vector* items, int items_to_display = 7, uint8_t flags = listbox_style::flags::none ); 37 | 38 | void run_render( evo::ren::vec2& pos ) override; 39 | void run_input() override; 40 | void reset_itemcache() { m_last_itemsize = -1; } 41 | std::wstring& get_search() { return m_search; } 42 | bool is_listbox() override 43 | { 44 | return true; 45 | } 46 | std::vector& get_items() const 47 | { 48 | return *m_items; 49 | } 50 | 51 | void set_items( const std::vector& new_items ) 52 | { 53 | ( m_direct ? *m_items : m_items_alt ) = new_items; 54 | reset_itemcache(); 55 | } 56 | 57 | void reset_scroll() 58 | { 59 | m_scroll_amount = 0; 60 | } 61 | void adjust_scroll() 62 | { 63 | const auto items_to_display = std::max( 1u, m_items_to_display == -1 ? m_display_items->size() : m_items_to_display ); 64 | if ( m_var->get() < m_scroll_amount - 1 || m_var->get() > m_scroll_amount + items_to_display - 1 ) 65 | { 66 | m_scroll_amount = m_var->get() - 4; 67 | if ( static_cast< int >( m_display_items->size() - items_to_display ) > 0 ) 68 | m_scroll_amount = clamp( m_scroll_amount, 0, static_cast< int >( m_display_items->size() - items_to_display ) ); 69 | else 70 | m_scroll_amount = 0; 71 | } 72 | } 73 | 74 | uint8_t m_flags; 75 | private: 76 | void handle_items() const; 77 | 78 | void render_scroll() const; 79 | void handle_scroll(); 80 | 81 | void cache_items(); 82 | 83 | int m_items_to_display; 84 | int m_scroll_amount; 85 | 86 | bool m_cached_items; 87 | 88 | bool m_direct = false; 89 | std::vector* m_items; 90 | std::vector m_items_alt; 91 | std::vector* m_display_items; 92 | std::vector m_display_items_alt; 93 | int m_last_itemsize; 94 | 95 | std::shared_ptr m_search_bar; 96 | std::wstring m_search; 97 | int m_old_search; 98 | }; 99 | -------------------------------------------------------------------------------- /internal_hvh/menu/elements/pad.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class pad : public control 4 | { 5 | public: 6 | pad( const int pad ) : m_pad( pad ) { m_size.y = pad; } 7 | 8 | void run_render( evo::ren::vec2& pos ) override 9 | { 10 | if ( !should_render() ) 11 | return; 12 | pos.y += m_pad; 13 | } 14 | void run_input() override {} 15 | private: 16 | int m_pad = 0; 17 | }; -------------------------------------------------------------------------------- /internal_hvh/menu/elements/slider.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace slider_style 5 | { 6 | enum flags 7 | { 8 | none = 1 << 0, 9 | no_operators = 1 << 1, 10 | no_focus = 1 << 2 11 | }; 12 | } 13 | 14 | class slider : public control 15 | { 16 | public: 17 | slider( std::string name, value* var, float min, float max, uint8_t flags = slider_style::flags::none, std::string format = "%.f", float step = 1.f ); 18 | 19 | void run_render( evo::ren::vec2& pos ) override; 20 | void run_input() override; 21 | protected: 22 | std::string get_value_text() const; 23 | 24 | void calc_fraction(); 25 | 26 | void render_operators() const; 27 | void handle_operators() const; 28 | evo::ren::vec2 m_operator_pos{}; 29 | 30 | float m_fraction; 31 | float m_min; 32 | float m_max; 33 | float m_step; 34 | 35 | bool m_dragging; 36 | bool m_in_slider_area; 37 | 38 | std::string m_format; 39 | 40 | uint8_t m_flags; 41 | }; 42 | 43 | 44 | -------------------------------------------------------------------------------- /internal_hvh/menu/elements/sub_controls/color_picker.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace colorpicker_style 4 | { 5 | enum flags : int 6 | { 7 | none = 1, 8 | no_rainbow = 2, 9 | no_alpha_bar = 4, 10 | open_left = 8 11 | }; 12 | 13 | inline flags operator|( const flags a, const flags b ) 14 | { 15 | return static_cast< flags >( static_cast< int >( a ) | static_cast< int >( b ) ); 16 | } 17 | } 18 | 19 | class color_picker : public sub_control 20 | { 21 | public: 22 | color_picker( value* var, colorpicker_style::flags flags = colorpicker_style::flags::none ); 23 | 24 | void run_render( evo::ren::vec2 pos, evo::ren::vec2 size ) override; 25 | void run_input() override; 26 | bool is_colorpicker() override { return true; } 27 | int get_flags() const { return m_flags; } 28 | void reset_state() override 29 | { 30 | if ( m_parent && m_parent->get_focussed_control() == this ) 31 | { 32 | m_parent->set_focussed_control( nullptr ); 33 | if ( g_menu->get_focussed_control() ) 34 | g_menu->set_focussed_control( nullptr ); 35 | } 36 | 37 | m_hover_progress = 0.f; 38 | m_hovered = false; 39 | m_popup_open = false; 40 | m_holding_controls = false; 41 | } 42 | 43 | value* get_var() const { return m_var; } 44 | 45 | void update_color() const 46 | { 47 | const auto size = Vector2D( m_popup_size.x - g_menu->get_style( e_menu_style::child_padding ).x * 2 - 2, 200 - 2 ); 48 | const auto hue = m_hue->get() * 0.01f; 49 | const auto saturation = clamp( m_cursor.x / size.x, 0.f, 1.f ); 50 | const auto brightness = clamp( 1.f - m_cursor.y / size.y, 0.f, 1.f ); 51 | 52 | m_var->set( Color( Color::FromHSB( hue, saturation, brightness ), m_alpha->get() / 100.f * 255.f ).GetD3DColor() ); 53 | } 54 | void force_color() 55 | { 56 | const auto size = Vector2D( m_popup_size.x - g_menu->get_style( e_menu_style::child_padding ).x * 2 - 2, 200 - 2 ); 57 | const auto col = Color( m_var->get(), 255 ); 58 | m_cursor = { col.saturation() * size.x, ( 1.f - col.brightness() ) * size.y }; 59 | m_alpha->set( Color( m_var->get() ).aBase() * 100.f ); 60 | m_hue->set( col.hue() * 100.f ); 61 | } 62 | private: 63 | void render_close_button() const; 64 | void render_color_mouse_preview() const; 65 | void render_color_picker(); 66 | 67 | void calc_popup_size(); 68 | 69 | Color get_color(); 70 | 71 | evo::ren::color m_color; 72 | evo::ren::color m_hovering_color; 73 | 74 | bool m_popup_open; 75 | bool m_needs_press; 76 | bool m_holding_controls; 77 | 78 | evo::ren::vec2 m_close_pos{}; 79 | evo::ren::vec2 m_popup_pos{}; 80 | evo::ren::vec2 m_popup_size; 81 | evo::ren::vec2 m_control_size{}; 82 | 83 | evo::ren::vec2 m_cursor{}; 84 | 85 | colorpicker_style::flags m_flags; 86 | 87 | value* m_hue; 88 | value* m_alpha; 89 | 90 | std::vector> m_sub_controls; 91 | 92 | static LPDIRECT3DTEXTURE9 m_picker_texture; 93 | static LPD3DXSPRITE ColorPickerSprite; 94 | }; 95 | -------------------------------------------------------------------------------- /internal_hvh/menu/elements/sub_controls/key_bind.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "sub_control.h" 3 | 4 | class sub_control; 5 | class value; 6 | 7 | namespace keybind_style 8 | { 9 | enum mode : int 10 | { 11 | always, 12 | hold, 13 | toggle 14 | }; 15 | } 16 | 17 | class key_bind : public sub_control 18 | { 19 | public: 20 | key_bind( value* var, value* key ); 21 | key_bind( value* key ); 22 | 23 | void run_render( evo::ren::vec2 pos, evo::ren::vec2 size ) override; 24 | void run_input() override; 25 | bool is_keybind() override 26 | { 27 | return true; 28 | } 29 | void run_hotkey_input() override 30 | { 31 | handle_mode(); 32 | } 33 | void reset_state() override 34 | { 35 | if ( m_parent && m_parent->get_focussed_control() == this ) 36 | { 37 | m_parent->set_focussed_control( nullptr ); 38 | 39 | if ( g_menu->get_focussed_control() ) 40 | g_menu->set_focussed_control( nullptr ); 41 | } 42 | 43 | m_hover_progress = 0.f; 44 | m_hovered = false; 45 | m_popup_open = false; 46 | m_waiting = false; 47 | m_held = false; 48 | } 49 | 50 | int get_key() const 51 | { 52 | return m_key->get(); 53 | } 54 | 55 | int get_mode() const 56 | { 57 | return m_mode->get(); 58 | } 59 | private: 60 | void handle_mode(); 61 | 62 | bool m_waiting; 63 | bool m_held; 64 | bool m_popup_open; 65 | 66 | evo::ren::vec2 m_popup_pos{}; 67 | 68 | std::shared_ptr m_popup; 69 | 70 | value* m_key; 71 | value* m_mode; 72 | value* m_tempval; 73 | }; 74 | -------------------------------------------------------------------------------- /internal_hvh/menu/elements/sub_controls/sub_control.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class sub_control : public std::enable_shared_from_this 4 | { 5 | public: 6 | virtual ~sub_control() = default; 7 | 8 | virtual void run_render( evo::ren::vec2 pos, evo::ren::vec2 size ) = 0; 9 | virtual void run_input() = 0; 10 | virtual void run_hotkey_input() {} 11 | virtual void reset_state() {} 12 | virtual bool is_colorpicker() { return false; } 13 | virtual bool is_keybind() { return false; } 14 | 15 | static bool is_hovered( const evo::ren::vec2& pos, const evo::ren::vec2& size ) 16 | { 17 | const auto info = g_input->get_mouse(); 18 | 19 | return info.pos.x > pos.x && info.pos.x < pos.x + size.x && info.pos.y > pos.y && info.pos.y < pos.y + size.y; 20 | } 21 | 22 | void handle_hover_progress() 23 | { 24 | VAL_SMOOTHER( m_hover_progress, 0.f, 1.f, m_hovered, 1.f / 0.25f ); 25 | } 26 | 27 | void handle_active_progress( bool active ) 28 | { 29 | VAL_SMOOTHER( m_active_progress, 0.f, 1.f, active, 1.f / 0.35f ); 30 | } 31 | 32 | evo::ren::vec2 get_size() const 33 | { 34 | return m_size; 35 | } 36 | 37 | evo::ren::vec2 get_pos() const 38 | { 39 | return m_pos; 40 | } 41 | 42 | float get_max_size() const 43 | { 44 | return m_max_size; 45 | } 46 | 47 | void set_parent( std::shared_ptr parent ) 48 | { 49 | m_parent = parent; 50 | } 51 | 52 | bool should_render() const 53 | { 54 | if ( m_dependencies.empty() ) 55 | return true; 56 | 57 | auto ret = false; 58 | 59 | for ( auto& dependency : m_dependencies ) 60 | { 61 | if ( !dependency.m_val ) 62 | return true;//!interfaces::engine()->IsInGame() || !( *interfaces::game_rules_proxy() )->m_bIsValveDS(); 63 | 64 | if ( !dependency.m_flip && dependency.m_val->get() == dependency.m_required ) 65 | ret = true; 66 | 67 | if ( dependency.m_flip && dependency.m_val->get() != dependency.m_required ) 68 | ret = true; 69 | } 70 | 71 | return ret; 72 | } 73 | 74 | std::shared_ptr add_dependency( const control_dependency_t dependency ) 75 | { 76 | m_dependencies.push_back( dependency ); 77 | return shared_from_this(); 78 | } 79 | 80 | protected: 81 | bool m_hovered = false; 82 | 83 | evo::ren::vec2 m_pos = {}; 84 | evo::ren::vec2 m_size = {}; 85 | 86 | std::shared_ptr m_parent; 87 | 88 | float m_active_progress = 0.f; 89 | float m_hover_progress = 0.f; 90 | float m_max_size = 30.f; 91 | 92 | public: 93 | bool m_in_force_off = false; 94 | 95 | protected: 96 | std::vector m_dependencies; 97 | 98 | value* m_var = nullptr; 99 | int m_temp_value = 1; 100 | bool m_last_key_state = false; 101 | }; 102 | 103 | -------------------------------------------------------------------------------- /internal_hvh/menu/elements/sub_tab.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | #include "../../sdk/datatypes/Vector2D.h" 6 | 7 | class child; 8 | class control; 9 | class tab; 10 | class weapon_tab; 11 | 12 | class sub_tab 13 | { 14 | public: 15 | sub_tab( std::string name, std::vector> childs = {} ); 16 | sub_tab( std::string name, std::vector> sub_tabs ); 17 | 18 | virtual ~sub_tab() = default; 19 | 20 | void add_child( std::shared_ptr child ); 21 | virtual void run_render( evo::ren::vec2& pos ); 22 | virtual void run_input(); 23 | void run_hotkey_input(); 24 | void handle_line(); 25 | void handle_hover(); 26 | void reset_state(); 27 | 28 | void init( std::shared_ptr tab, int id ); 29 | void init( std::shared_ptr sub_tab, int id ); 30 | 31 | evo::ren::vec2 get_pos() const { return m_pos; } 32 | std::vector>& get_children(); 33 | std::vector>& get_subtabs(); 34 | 35 | std::shared_ptr get_parent() const; 36 | std::shared_ptr get_parent_sub_tab() const; 37 | 38 | int get_active_sub_tab() const 39 | { 40 | return m_active_sub_tab; 41 | } 42 | 43 | void set_active_sub_tab( const int id ) 44 | { 45 | m_active_sub_tab = id; 46 | } 47 | 48 | std::string& get_name() { return m_name; } 49 | protected: 50 | std::string m_name; 51 | 52 | bool m_hovered = false; 53 | bool m_active = false; 54 | 55 | float m_hover_progress = 0.f; 56 | float m_line_size = 1.f; 57 | 58 | evo::ren::vec2 m_pos = {}; 59 | evo::ren::vec2 m_size = {}; 60 | evo::ren::vec2 m_string_size = {}; 61 | 62 | int m_active_sub_tab = 0; 63 | 64 | int m_id = {}; 65 | 66 | std::shared_ptr m_parent = {}; 67 | std::shared_ptr m_parent_sub_tab = {}; 68 | std::vector> m_childs = {}; 69 | std::vector> m_sub_tabs = {}; 70 | }; 71 | -------------------------------------------------------------------------------- /internal_hvh/menu/elements/tab.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | #include "../../sdk/datatypes/Vector2D.h" 6 | 7 | class window; 8 | class child; 9 | class sub_tab; 10 | 11 | class tab : public std::enable_shared_from_this 12 | { 13 | public: 14 | tab( std::string name, std::vector> sub_tabs = {}, bool noarea = false ); 15 | 16 | void run_render( Vector2D& pos ); 17 | void run_input(); 18 | void reset_state(); 19 | 20 | std::shared_ptr get_parent() const; 21 | 22 | void init( std::shared_ptr window, int id ); 23 | 24 | sub_tab* add_subtab( const char* name ); 25 | 26 | bool has_sub_tabs() const; 27 | int get_active_sub_tab() const; 28 | void set_active_sub_tab( int id ); 29 | void run_hotkey_input(); 30 | 31 | std::string& get_name() { return m_name; } 32 | 33 | std::vector>& get_subtabs(); 34 | bool m_noarea = {}; 35 | private: 36 | void handle_line(); 37 | void handle_hover(); 38 | 39 | std::string m_name; 40 | 41 | float m_line_size = 1.f; 42 | float m_hover_progress = {}; 43 | 44 | bool m_hovered = {}; 45 | bool m_active = {}; 46 | 47 | evo::ren::vec2 m_pos = {}; 48 | evo::ren::vec2 m_size = {}; 49 | evo::ren::vec2 m_string_size = {}; 50 | 51 | int m_id = {}; 52 | int m_active_sub_tab = 0; 53 | int m_last_active = {}; 54 | 55 | std::shared_ptr m_parent = {}; 56 | std::vector> m_subtabs = {}; 57 | }; 58 | -------------------------------------------------------------------------------- /internal_hvh/menu/elements/text_box.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace textbox_style 4 | { 5 | enum flags 6 | { 7 | none = 1 << 0, 8 | search_bar = 1 << 1, 9 | }; 10 | } 11 | 12 | class value; 13 | 14 | class text_box : public control 15 | { 16 | public: 17 | text_box( std::string name, std::wstring& in, uint8_t flags = textbox_style::flags::none ); 18 | text_box( std::string name, value* val, uint8_t flags = textbox_style::flags::none ); 19 | 20 | void run_render( evo::ren::vec2& pos ) override; 21 | void run_input() override; 22 | private: 23 | bool m_focus; 24 | 25 | std::wstring* m_text; 26 | value* m_value; 27 | 28 | uint8_t m_flags; 29 | }; -------------------------------------------------------------------------------- /internal_hvh/menu/elements/weapon_tab.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class weapon_tab : public sub_tab 4 | { 5 | public: 6 | weapon_tab( std::string name, std::vector> childs = {} ); 7 | void run_render( evo::ren::vec2& pos ) override; 8 | void run_input() override; 9 | uint32_t texture_id; 10 | }; 11 | -------------------------------------------------------------------------------- /internal_hvh/menu/elements/window.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | class tab; 6 | class child; 7 | 8 | class window 9 | { 10 | public: 11 | window( std::string name, evo::ren::vec2 size, evo::ren::vec2 pos = evo::ren::vec2( 0, 0 ), window_style::flags flags = window_style::flags::none, std::vector> tabs = {} ); 12 | ~window() = default; 13 | 14 | void reset_state() const; 15 | void run_render(); 16 | void run_input(); 17 | void run_hotkey_input(); 18 | 19 | evo::ren::vec2 get_size() const; 20 | evo::ren::vec2 get_pos() const; 21 | 22 | int get_tab_amount() const; 23 | void set_active_tab( int id ); 24 | int get_active_tab() const; 25 | 26 | evo::ren::vec2 get_control_area_start() const; 27 | evo::ren::vec2 get_control_area_size() const; 28 | 29 | std::vector>& get_tabs(); 30 | 31 | std::shared_ptr config_child; 32 | 33 | private: 34 | void border() const; 35 | void header() const; 36 | void glow() const; 37 | 38 | std::string m_name; 39 | 40 | int m_active_tab; 41 | int m_old_active_tab{}; 42 | 43 | evo::ren::vec2 m_drag_offset{}; 44 | 45 | evo::ren::vec2 m_pos{}; 46 | evo::ren::vec2 m_size{}; 47 | window_style::flags m_flags; 48 | 49 | std::vector> m_tabs; 50 | }; 51 | -------------------------------------------------------------------------------- /internal_hvh/menu/menu_include.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../include_cheat.h" 4 | 5 | #include "effects.h" 6 | #include "menu.h" 7 | 8 | #include "../misc/config.h" 9 | 10 | #include "elements/window.h" 11 | #include "elements/tab.h" 12 | #include "elements/child.h" 13 | 14 | #include "elements/control.h" 15 | #include "elements/sub_controls/sub_control.h" 16 | #include "elements/glitch_text.h" 17 | #include "elements/sub_tab.h" 18 | #include "elements/weapon_tab.h" 19 | #include "elements/checkbox.h" 20 | #include "elements/combobox.h" 21 | #include "elements/slider.h" 22 | #include "elements/hue_slider.h" 23 | #include "elements/alpha_slider.h" 24 | #include "elements/button.h" 25 | #include "elements/pad.h" 26 | #include "elements/text_box.h" 27 | #include "elements/listbox.h" 28 | 29 | #include "elements/sub_controls/key_bind.h" 30 | #include "elements/sub_controls/color_picker.h" 31 | -------------------------------------------------------------------------------- /internal_hvh/misc/StackTracer.h: -------------------------------------------------------------------------------- 1 | /* 2 | // 3 | // Description: This class is used to get the call stack when there is an exception being caught use SEH 4 | // 5 | // Author: Baiyan Huang 6 | // Date: 8/30/2009 7 | // 8 | // Usage: 9 | // __try 10 | // { 11 | // // main functions... 12 | // } 13 | // __except(StackTracer::ExceptionFilter(GetExceptionInformation())) 14 | // { 15 | // // Your code to show or log the exception msg... 16 | // } 17 | */ 18 | 19 | #pragma once 20 | #include 21 | 22 | struct FunctionCall 23 | { 24 | std::string FunctionName; 25 | std::string FileName; 26 | int LineNumber; 27 | uint32_t Address; 28 | std::string Module; 29 | }; 30 | 31 | class StackTracer 32 | { 33 | public: 34 | // Always return EXCEPTION_EXECUTE_HANDLER after getting the call stack 35 | static LONG ExceptionFilter( LPEXCEPTION_POINTERS e ); 36 | 37 | // return the exception message along with call stacks 38 | static std::string GetExceptionMsg(); 39 | 40 | // Return exception code and call stack data structure so that 41 | // user could customize their own message format 42 | static DWORD GetExceptionCode(); 43 | static std::vector GetExceptionCallStack(); 44 | 45 | private: 46 | static StackTracer s_StackTracer; 47 | 48 | private: 49 | StackTracer( void ); 50 | ~StackTracer( void ); 51 | 52 | // The main function to handle exception 53 | LONG __stdcall HandleException( LPEXCEPTION_POINTERS e ); 54 | 55 | // Work through the stack upwards to get the entire call stack 56 | void TraceCallStack( CONTEXT* pContext ); 57 | 58 | private: 59 | DWORD m_dwExceptionCode; 60 | 61 | std::vector m_vecCallStack; 62 | 63 | typedef std::map CodeDescMap; 64 | CodeDescMap m_mapCodeDesc; 65 | 66 | DWORD m_dwMachineType; // Machine type matters when trace the call stack (StackWalk64) 67 | 68 | }; 69 | -------------------------------------------------------------------------------- /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 | bool m_use_draft_quality{}; 47 | 48 | public: 49 | enum font_flags 50 | { 51 | centered_x = 1 << 0, 52 | centered_y = 1 << 1, 53 | left_aligned = 1 << 2, 54 | right_aligned = 1 << 3, 55 | top_aligned = 1 << 4, 56 | bottom_aligned = 1 << 5, 57 | outline = 1 << 6, 58 | drop_shadow = 1 << 7 59 | }; 60 | 61 | HRESULT draw_string( float x, float y, uint32_t color, const wchar_t* text, uint16_t flags = 0L ); 62 | HRESULT draw_radial( float x, float y, uint32_t color1, uint32_t color2, const wchar_t* text, uint16_t flags = 0L ); 63 | HRESULT get_text_extent( const wchar_t* text, SIZE* size ); 64 | 65 | HRESULT init_device_objects( IDirect3DDevice9* dev ); 66 | HRESULT restore_device_objects(); 67 | HRESULT invalidate_device_objects(); 68 | HRESULT delete_device_objects(); 69 | 70 | c_font(); 71 | c_font( std::string font, uint32_t height, uint32_t weight, bool use_draft_quality = false, uint32_t heighest_char = 0x80, uint32_t flags = 0 ); 72 | ~c_font(); 73 | 74 | void destroy() 75 | { 76 | invalidate_device_objects(); 77 | delete_device_objects(); 78 | text_coords.clear(); 79 | lookup_table.clear(); 80 | } 81 | 82 | float line_height; 83 | }; -------------------------------------------------------------------------------- /internal_hvh/misc/globals.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | #include 3 | 4 | namespace globals 5 | { 6 | float random_float( float from, float to ) { return reinterpret_cast< float( * ) ( float, float ) >( make_offset( "vstdlib.dll", sig_random_float ) )( from, to ); } 7 | int random_int( int from, int to ) { return reinterpret_cast< int( * ) ( int, int ) >( make_offset( "vstdlib.dll", sig_random_int ) )( from, to ); } 8 | void random_seed( int seed ) { reinterpret_cast< void( * ) ( int ) >( make_offset( "vstdlib.dll", sig_random_seed ) )( seed ); } 9 | 10 | C_CSPlayer* get_player( const int index ) { return reinterpret_cast< C_CSPlayer* >( interfaces::entity_list()->get_client_entity( index ) ); } 11 | C_WeaponCSBaseGun* get_weapon( const CBaseHandle handle ) { if ( !handle ) { return nullptr; } return reinterpret_cast< C_WeaponCSBaseGun* >( interfaces::entity_list()->get_client_entity_from_handle( handle ) ); } 12 | 13 | secure_info_t secure_info = {}; 14 | 15 | bool is_dangerzone() 16 | { 17 | var( game_mode ); 18 | var( game_type ); 19 | return game_type->get_int() == 6 && game_mode->get_int() == 0; 20 | } 21 | 22 | void util_trace_line( const Vector& vec_start, const Vector& vec_end, const unsigned n_mask, const C_BaseEntity* ignore, trace_t* p_trace, int collision_group ) 23 | { 24 | Ray_t ray; 25 | ray.Init( vec_start, vec_end ); 26 | 27 | CTraceFilterSimple filter( ignore, nullptr, collision_group ); 28 | interfaces::engine_trace()->TraceRay( ray, n_mask, &filter, p_trace ); 29 | } 30 | 31 | bool line_goes_through_smoke( const Vector& vec_start, const Vector& vec_end ) 32 | { 33 | return reinterpret_cast< bool( __cdecl* ) ( Vector, Vector, uint16_t ) >( make_offset( "client.dll", sig_line_goes_through_smoke ) )( vec_start, vec_end, 1 ); 34 | } 35 | 36 | void util_trace_hull( const Vector& vec_start, const Vector& vec_end, const Vector& extents, const unsigned n_mask, const C_BaseEntity* ignore, trace_t* p_trace, int collision_group ) 37 | { 38 | Ray_t ray; 39 | ray.Init( vec_start, vec_end, extents * -1.f, extents ); 40 | 41 | CTraceFilterSimple filter( ignore, nullptr, collision_group ); 42 | interfaces::engine_trace()->TraceRay( ray, n_mask, &filter, p_trace ); 43 | } 44 | 45 | void util_clip_trace_to_player( const Vector& vec_start, const Vector& vec_end, const unsigned int n_mask, C_BaseEntity* target, trace_t* p_trace ) 46 | { 47 | if ( !target ) 48 | return; 49 | 50 | trace_t player_trace; 51 | Ray_t ray; 52 | ray.Init( vec_start, vec_end ); 53 | 54 | const auto smallest_fraction = p_trace->fraction; 55 | interfaces::engine_trace()->ClipRayToEntity( ray, n_mask, target, &player_trace ); 56 | 57 | if ( player_trace.fraction < smallest_fraction ) 58 | *p_trace = player_trace; 59 | } 60 | } -------------------------------------------------------------------------------- /internal_hvh/misc/globals.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define local_player ( reinterpret_cast< C_CSPlayer* >( interfaces::entity_list()->get_client_entity( interfaces::engine()->GetLocalPlayer() ) ) ) 4 | #define local_weapon ( reinterpret_cast< C_WeaponCSBaseGun* >( interfaces::entity_list()->get_client_entity_from_handle( local_player->get_active_weapon() ) ) ) 5 | 6 | struct weaponconfig_t; 7 | namespace globals 8 | { 9 | inline HMODULE module_base; 10 | 11 | struct secure_info_t 12 | { 13 | int pad{}; 14 | uint64_t initial_checksum = 0; 15 | union 16 | { 17 | unsigned int threads_ran; 18 | unsigned int threads_ran_cached; 19 | } values{}; 20 | int useless_pad{}; 21 | } extern secure_info; 22 | 23 | C_CSPlayer* get_player( int index ); 24 | C_WeaponCSBaseGun* get_weapon( CBaseHandle handle ); 25 | bool is_dangerzone(); 26 | inline bool in_cm = {}; 27 | 28 | inline bool* send_packet = {}; 29 | inline CUserCmd* current_cmd = {}; 30 | inline CUserCmd* first_cmd = {}; 31 | inline std::vector sent_commands = {}; 32 | inline std::vector outgoing_commands = {}; 33 | 34 | struct 35 | { 36 | std::string name; 37 | std::string expiry; 38 | std::vector img; 39 | bool alpha = false; 40 | } inline user_info; 41 | 42 | float random_float( float from, float to ); 43 | int random_int( int from, int to ); 44 | void random_seed( int seed ); 45 | 46 | bool line_goes_through_smoke( const Vector& vec_start, const Vector& vec_end ); 47 | void util_trace_line( const Vector& vec_start, const Vector& vec_end, const unsigned n_mask, const C_BaseEntity* ignore, trace_t* p_trace, int collision_group = 0 ); 48 | void util_trace_hull( const Vector& vec_start, const Vector& vec_end, const Vector& extents, const unsigned n_mask, const C_BaseEntity* ignore, trace_t* p_trace, int collision_group = 0 ); 49 | void util_clip_trace_to_player( const Vector& vec_start, const Vector& vec_end, const unsigned int n_mask, C_BaseEntity* target, trace_t* p_trace ); 50 | 51 | inline bool nospread = {}; 52 | inline bool restricted_unduck = {}; 53 | inline int shot_command = {}; 54 | inline int choked_shot_command = {}; 55 | inline bool erase_init = {}; 56 | inline float interpolated_curtime = {}; 57 | } 58 | 59 | 60 | -------------------------------------------------------------------------------- /internal_hvh/misc/gzip/config.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef ZLIB_CONST 4 | #define ZLIB_CONST 5 | #endif -------------------------------------------------------------------------------- /internal_hvh/misc/gzip/utils.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace gzip { 4 | 5 | // These live in gzip.hpp because it doesnt need to use deps. 6 | // Otherwise, they would need to live in impl files if these methods used 7 | // zlib structures or functions like inflate/deflate) 8 | inline bool is_compressed(const char* data, std::size_t size) 9 | { 10 | return size > 2 && 11 | ( 12 | // zlib 13 | ( 14 | static_cast(data[0]) == 0x78 && 15 | (static_cast(data[1]) == 0x9C || 16 | static_cast(data[1]) == 0x01 || 17 | static_cast(data[1]) == 0xDA || 18 | static_cast(data[1]) == 0x5E)) || 19 | // gzip 20 | (static_cast(data[0]) == 0x1F && static_cast(data[1]) == 0x8B)); 21 | } 22 | } // namespace gzip 23 | -------------------------------------------------------------------------------- /internal_hvh/misc/gzip/version.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /// The major version number 4 | #define GZIP_VERSION_MAJOR 1 5 | 6 | /// The minor version number 7 | #define GZIP_VERSION_MINOR 0 8 | 9 | /// The patch number 10 | #define GZIP_VERSION_PATCH 0 11 | 12 | /// The complete version number 13 | #define GZIP_VERSION_CODE (GZIP_VERSION_MAJOR * 10000 + GZIP_VERSION_MINOR * 100 + GZIP_VERSION_PATCH) 14 | 15 | /// Version number as string 16 | #define GZIP_VERSION_STRING "1.0.0" -------------------------------------------------------------------------------- /internal_hvh/misc/init.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace init 6 | { 7 | void on_startup(); 8 | void get_modules(); 9 | void load_fonts(); 10 | void remove_fonts(); 11 | void get_materials(); 12 | void patches(); 13 | void save_resources(); 14 | void init_pred_map(); 15 | #ifndef RELEASE 16 | void unload_cheat(); 17 | #endif 18 | 19 | inline std::vector mem_font_hadles = {}; 20 | inline HWND window = {}; 21 | } -------------------------------------------------------------------------------- /internal_hvh/misc/input.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../sdk/datatypes/Vector2D.h" 4 | #include 5 | #include 6 | #include 7 | 8 | #include "ren/types.h" 9 | 10 | 11 | enum e_mouse_state 12 | { 13 | idle, 14 | pressed, 15 | held 16 | }; 17 | 18 | struct mouse_info_t 19 | { 20 | void reset_scroll() 21 | { 22 | scroll = 0; 23 | } 24 | 25 | e_mouse_state state; 26 | e_mouse_state state_right; 27 | int scroll; 28 | 29 | evo::ren::vec2 pos; 30 | }; 31 | 32 | struct key_info_t 33 | { 34 | bool pressed; 35 | bool held; 36 | bool released; 37 | }; 38 | 39 | class input 40 | { 41 | public: 42 | bool run_mouse( const UINT message ); 43 | bool run_keyboard( const UINT message, const WPARAM param ); 44 | 45 | static std::string get_key_string( const int i ); 46 | 47 | void reset_mouse(); 48 | bool mouse_in_bounds( const evo::ren::vec2& pos, const evo::ren::vec2& size ) const; 49 | 50 | void run(); 51 | mouse_info_t& get_mouse(); 52 | key_info_t get_key( int key ) const; 53 | 54 | wchar_t get_last_char() const; 55 | void clear_char(); 56 | private: 57 | mouse_info_t m_mouse_info; 58 | public: 59 | std::array m_key_info; 60 | public: 61 | wchar_t m_last_char; 62 | }; 63 | 64 | extern input* g_input; 65 | -------------------------------------------------------------------------------- /internal_hvh/misc/ipc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace ipc 7 | { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /internal_hvh/misc/libMinHook-x86-v141-mt.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reversed2603/fatality_source/dee7327e3b55c03ee93e9eaa0c4dcada64e49110/internal_hvh/misc/libMinHook-x86-v141-mt.lib -------------------------------------------------------------------------------- /internal_hvh/misc/libMinHook-x86-v141-mtd.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reversed2603/fatality_source/dee7327e3b55c03ee93e9eaa0c4dcada64e49110/internal_hvh/misc/libMinHook-x86-v141-mtd.lib -------------------------------------------------------------------------------- /internal_hvh/misc/listeners.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | void listeners::event_listeners::FireGameEvent( IGameEvent* game_event ) 4 | { 5 | record_shot_info_t shot_info = {}; 6 | const auto event_name = fnv1a_rt( game_event->GetName() ); 7 | 8 | if ( event_name == FNV1A( "player_hurt" ) ) 9 | { 10 | resolver::hurt_listener( game_event, shot_info ); 11 | hitmarker::listener( game_event ); 12 | } 13 | else if ( event_name == FNV1A( "bullet_impact" ) ) 14 | { 15 | resolver::listener( game_event ); 16 | beams::listener( game_event ); 17 | } 18 | else if ( event_name == FNV1A( "weapon_fire" ) ) 19 | { 20 | resolver::listener( game_event ); 21 | } 22 | else if ( event_name == FNV1A( "game_newmap" ) ) 23 | { 24 | chams::m_rerun_nightmode = true; 25 | } 26 | else if ( event_name == FNV1A( "grenade_thrown" ) ) 27 | { 28 | grenade_pred::register_grenade( game_event ); 29 | } 30 | else if ( event_name == FNV1A( "item_equip" ) ) 31 | { 32 | sound_esp::on_item_equip( game_event ); 33 | } 34 | 35 | console_log::listener( game_event, shot_info ); 36 | 37 | const std::string name = XOR_STR( "on_" ) + std::string( game_event->GetName() ); 38 | lua::api.create_callback( name.c_str() ); 39 | 40 | const auto cbk = [game_event]( lua::state& s ) -> int { 41 | s.create_user_object_ptr( XOR_STR( "csgo.event" ), game_event ); 42 | return 1; 43 | }; 44 | 45 | lua::api.callback( FNV1A( "on_game_event" ), cbk ); 46 | lua::api.callback( fnv1a_rt( name.c_str() ), cbk ); 47 | } -------------------------------------------------------------------------------- /internal_hvh/misc/listeners.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class IGameEvent; 4 | namespace listeners 5 | { 6 | class event_listeners : public IGameEventListener2 7 | { 8 | public: 9 | event_listeners() 10 | { 11 | interfaces::game_event_manager()->AddListenerGlobal( this, false ); 12 | }; 13 | ~event_listeners() { interfaces::game_event_manager()->RemoveListener( this ); }; 14 | virtual void FireGameEvent( IGameEvent* p_event ) override; 15 | int GetEventDebugID() override { return 0x2A; }; 16 | }; 17 | 18 | inline event_listeners * event_listener = {}; 19 | 20 | __declspec( noinline ) inline void setup_listeners() { if ( !event_listener ) { event_listener = new event_listeners(); } erase_end } 21 | inline void remove_listeners() { delete event_listener; } 22 | }; 23 | 24 | -------------------------------------------------------------------------------- /internal_hvh/misc/networking/include/session.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include "data.h" 8 | #include "../src/crypto/ssl.h" 9 | 10 | namespace networking 11 | { 12 | class session 13 | { 14 | public: 15 | session( const char* server, uint16_t port, const std::string& token ); 16 | bool has_data(); 17 | bool is_connected(); 18 | bool read( std::string& s ); 19 | bool write( const std::vector& s ); 20 | int update( const std::vector& update ); 21 | bool try_write(); 22 | bool try_read( std::vector>& ret ); 23 | std::vector> process( bool& success ); 24 | 25 | struct 26 | { 27 | uint8_t shared_key[ 32 ]; 28 | uint8_t nonce[ 24 ]; 29 | bool has_key = false; 30 | } key{}; 31 | std::atomic_bool closed = false; 32 | 33 | inline void close() 34 | { 35 | if ( !closed.load() ) 36 | { 37 | closed = true; 38 | ssl_->shutdown( true ); 39 | imp( "ws2_32.dll", closesocket )( socket_ ); 40 | } 41 | 42 | } 43 | 44 | inline ~session() 45 | { 46 | close(); 47 | } 48 | 49 | 50 | private: 51 | std::shared_ptr ssl_; 52 | std::shared_ptr ctx_; 53 | 54 | SOCKET socket_; 55 | std::vector> updates_; 56 | std::mutex mutex; 57 | std::mutex networking_mutex; 58 | }; 59 | 60 | inline int init_status = 0; 61 | 62 | } -------------------------------------------------------------------------------- /internal_hvh/misc/networking/net_offsets.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace offsets 4 | { 5 | enum class as_enum; 6 | } 7 | 8 | namespace networking 9 | { 10 | class net_offsets 11 | { 12 | public: 13 | void init(); 14 | uint64_t get_offset( uint64_t offset_hashed, bool remove = true ); 15 | static void precache_map_load(); 16 | void precache_init(); 17 | 18 | __forceinline bool set_offsets() 19 | { 20 | if ( !mutex.try_lock() ) 21 | return false; 22 | 23 | for ( auto& [id, offset] : vec_offsets ) 24 | { 25 | if ( static_cast< offsets::as_enum >( id ) > offsets::as_enum::INVALID && static_cast< offsets::as_enum >( id ) < offsets::as_enum::COUNT ) 26 | if ( !requested[ static_cast< size_t >( id ) ] ) 27 | offset = id * offset ^ 0x1937282717263726; 28 | 29 | offsets[ id ] = offset; 30 | } 31 | 32 | mutex.unlock(); 33 | return true; 34 | } 35 | 36 | std::mutex queue_mtx_ = {}; 37 | std::condition_variable queue_cond_ = {}; 38 | std::atomic_int in_request = 0; 39 | bool heartbeat = false; 40 | std::vector requested{}; 41 | std::vector received{}; 42 | std::shared_mutex mutex{}; 43 | std::vector offsets{}; 44 | std::vector> vec_offsets{}; 45 | 46 | static constexpr uint64_t deleted_val = 0x1947265784932001; 47 | static constexpr uint64_t init_val = 0x9273628581726547; 48 | static constexpr uint64_t invalid_val = 0x9273819408473928; 49 | }; 50 | 51 | inline net_offsets* network_offsets; 52 | } 53 | 54 | -------------------------------------------------------------------------------- /internal_hvh/misc/networking/src/crypto/helpers.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "helpers.h" 4 | 5 | //credits: https://math.stackexchange.com/questions/424238/random-primes-between-4000000000-and-4294967291-c 6 | int isprime( int n ) 7 | { 8 | /*if((n&1)==0) return n==2;*/ 9 | if ( n % 3 == 0 ) return n == 3; 10 | /*if(n<25) return n>1;*/ 11 | int p = 5; 12 | while ( p * p <= n ) 13 | { 14 | if ( n % p == 0 ) return 0; 15 | p += 2; 16 | if ( n % p == 0 ) return 0; 17 | p += 4; 18 | } 19 | return 1; 20 | } 21 | //credits: https://www.geeksforgeeks.org/euclidean-algorithms-basic-and-extended/ 22 | int gcd( int a, int b ) 23 | { 24 | if ( a == 0 ) 25 | return b; 26 | return gcd( b % a, a ); 27 | } 28 | 29 | std::pair euclid_extended( int a, int b ) 30 | { 31 | if ( !b ) 32 | { 33 | return { 1, 0 }; 34 | } 35 | 36 | auto result = euclid_extended( b, a % b ); 37 | return { result.second, result.first - ( a / b ) * result.second }; 38 | } 39 | 40 | int generateCoprime( int n ) 41 | { 42 | int generated = rand() % 10000; 43 | while ( gcd( n, generated ) != 1 ) 44 | generated = rand() % 10000; 45 | return generated; 46 | } 47 | 48 | int logPower( int n, int p, int mod ) 49 | { 50 | int result = 1; 51 | for ( ; p; p >>= 1 ) 52 | { 53 | if ( p & 1 ) 54 | result = ( 1LL * result * n ) % mod; 55 | n = ( 1LL * n * n ) % mod; 56 | } 57 | return result; 58 | } 59 | 60 | int modularInverse( int n, int mod ) 61 | { 62 | int inverse = euclid_extended( n, mod ).first; 63 | while ( inverse < 0 ) 64 | inverse += mod; 65 | return inverse; 66 | } 67 | 68 | int randInRange( int min, int max ) 69 | { 70 | int range = max - min + 1; 71 | return rand() % range + min; 72 | } 73 | 74 | bool rabin_miller( int n ) 75 | { 76 | bool ok = true; 77 | 78 | for ( int i = 1; i <= 5 && ok; i++ ) 79 | { 80 | int a = rand() + 1; 81 | int result = logPower( a, n - 1, n ); 82 | ok &= ( result == 1 ); 83 | } 84 | 85 | return ok; 86 | } 87 | 88 | int randPrime( int n ) 89 | { 90 | int generated = rand() % ( int ) pow( 10.0, ( double ) n ); 91 | while ( !rabin_miller( generated ) ) 92 | generated = rand() % ( int ) pow( 10.0, ( double ) n );; 93 | return generated; 94 | } 95 | -------------------------------------------------------------------------------- /internal_hvh/misc/networking/src/crypto/helpers.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | int randPrime( int n ); 4 | int randInRange( int min, int max ); 5 | int gcd( int a, int b ); 6 | int modularInverse( int n, int mod ); 7 | int generateCoprime( int n ); 8 | int isprime( int n ); 9 | int logPower( int n, int p, int mod ); -------------------------------------------------------------------------------- /internal_hvh/misc/networking/src/crypto/ssl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include "ssl_context.h" 10 | 11 | namespace crypto 12 | { 13 | void ssl_print_error( const std::string& message ); 14 | 15 | class ssl 16 | { 17 | public: 18 | ssl( const std::shared_ptr& ctx, uintptr_t sock ); 19 | ~ssl(); 20 | 21 | void shutdown( bool sd ); 22 | 23 | bool accept(); 24 | bool connect(); 25 | bool send( unsigned char* buf, size_t len, size_t* r = nullptr ); 26 | bool recv( char* buf, size_t len, size_t* r = nullptr ); 27 | bool has_data(); 28 | 29 | bool is_valid() const { return obj != nullptr; } 30 | 31 | public: 32 | bool do_async_call( const std::function fn, const std::string& err_msg = "", size_t* r = nullptr ); 33 | bool do_async_call( const std::function fn, const std::string& err_msg, void* buf, size_t len, size_t* r = nullptr ); 34 | 35 | std::mutex obj_mtx{}; 36 | SSL* obj{}; 37 | }; 38 | } 39 | -------------------------------------------------------------------------------- /internal_hvh/misc/networking/src/crypto/ssl_context.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | #include "ssl_context.h" 3 | #include "ssl.h" 4 | 5 | using namespace crypto; 6 | 7 | ssl_context::ssl_context() 8 | { 9 | SSL_library_init(); 10 | SSLeay_add_all_algorithms(); 11 | SSL_load_error_strings(); 12 | } 13 | 14 | ssl_context::~ssl_context() 15 | { 16 | if ( ctx ) 17 | SSL_CTX_free( ctx ); 18 | 19 | EVP_cleanup(); 20 | } 21 | 22 | bool ssl_context::create_server() 23 | { 24 | if ( !create( TLSv1_2_server_method() ) ) 25 | return false; 26 | 27 | config(); 28 | 29 | if ( !SSL_CTX_use_certificate_file( ctx, cert.c_str(), SSL_FILETYPE_PEM ) ) 30 | { 31 | ssl_print_error( XOR_STR( "Failed to set certificate" ) ); 32 | return false; 33 | } 34 | 35 | if ( !SSL_CTX_use_PrivateKey_file( ctx, pk.c_str(), SSL_FILETYPE_PEM ) ) 36 | { 37 | ssl_print_error( XOR_STR( "Failed to set private key" ) ); 38 | return false; 39 | } 40 | 41 | return true; 42 | } 43 | 44 | bool ssl_context::create_client() 45 | { 46 | if ( !create( TLSv1_2_client_method() ) ) 47 | return false; 48 | 49 | config(); 50 | return true; 51 | } 52 | 53 | bool ssl_context::create( const SSL_METHOD* method ) 54 | { 55 | ctx = SSL_CTX_new( method ); 56 | if ( !ctx ) 57 | { 58 | ssl_print_error( XOR_STR( "Failed to create context" ) ); 59 | return false; 60 | } 61 | 62 | return true; 63 | } 64 | 65 | void ssl_context::config() const 66 | { 67 | SSL_CTX_set_ecdh_auto( ctx, 1 ); 68 | SSL_CTX_set_mode( ctx, SSL_MODE_AUTO_RETRY ); 69 | SSL_CTX_set_mode( ctx, SSL_MODE_RELEASE_BUFFERS ); 70 | } 71 | -------------------------------------------------------------------------------- /internal_hvh/misc/networking/src/crypto/ssl_context.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace crypto 7 | { 8 | // should be instantinated only once 9 | class ssl_context 10 | { 11 | public: 12 | ssl_context(); 13 | ~ssl_context(); 14 | 15 | void set_certificate( const std::string& path ) 16 | { 17 | cert = path; 18 | } 19 | 20 | void set_private_key( const std::string& path ) 21 | { 22 | pk = path; 23 | } 24 | 25 | bool create_server(); 26 | bool create_client(); 27 | 28 | SSL_CTX* get() 29 | { 30 | return ctx; 31 | } 32 | 33 | private: 34 | bool create( const SSL_METHOD* method ); 35 | void config() const; 36 | 37 | SSL_CTX* ctx{}; 38 | 39 | std::string cert{}; 40 | std::string pk{}; 41 | }; 42 | } 43 | -------------------------------------------------------------------------------- /internal_hvh/misc/profiler.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef RELEASE 4 | 5 | #include 6 | #include 7 | 8 | namespace util 9 | { 10 | struct function_profiler_t 11 | { 12 | std::chrono::steady_clock::time_point m_start; 13 | std::chrono::steady_clock::time_point m_end; 14 | std::function m_notify; 15 | 16 | function_profiler_t() : m_notify( nullptr ) 17 | { 18 | m_start = std::chrono::steady_clock::now(); 19 | } 20 | 21 | function_profiler_t( std::function notify ) : m_notify( notify ) 22 | { 23 | m_start = std::chrono::steady_clock::now(); 24 | } 25 | 26 | ~function_profiler_t() 27 | { 28 | m_end = std::chrono::steady_clock::now(); 29 | 30 | if ( m_notify ) 31 | m_notify( std::chrono::duration_cast< std::chrono::microseconds >( m_end - m_start ).count() ); 32 | } 33 | }; 34 | 35 | struct function_profiler_average_t 36 | { 37 | std::chrono::steady_clock::time_point m_start; 38 | std::chrono::steady_clock::time_point m_end; 39 | uint32_t m_calls_to_notify; 40 | 41 | inline static uint32_t m_counter = 0; 42 | inline static uint32_t m_min = 0; 43 | inline static uint32_t m_max = 0; 44 | inline static float m_average = 0.f; 45 | 46 | function_profiler_average_t( uint32_t calls_to_notify = 50 ) : m_calls_to_notify( calls_to_notify ) 47 | { 48 | m_start = std::chrono::steady_clock::now(); 49 | } 50 | 51 | ~function_profiler_average_t() 52 | { 53 | m_end = std::chrono::steady_clock::now(); 54 | 55 | auto t = std::chrono::duration_cast< std::chrono::microseconds >( m_end - m_start ).count(); 56 | 57 | if ( t > m_max ) 58 | m_max = t; 59 | 60 | if ( t < m_min ) 61 | m_min = t; 62 | 63 | m_average = 0.9f * m_average + ( 1.f - 0.9f ) * ( t ); 64 | 65 | if ( ++m_counter > 100 ) 66 | { 67 | util::print_dev_console( true, Color::Lime(), "max: %d, min %d, avg: %f\n", m_max, m_min, m_average ); 68 | 69 | m_average = 0.f; 70 | m_max = 0; 71 | m_min = UINT_MAX; 72 | m_counter = 0; 73 | } 74 | } 75 | }; 76 | } 77 | 78 | #endif -------------------------------------------------------------------------------- /internal_hvh/misc/renderer/include/ren/adapter.h: -------------------------------------------------------------------------------- 1 | #ifndef EV0LVE_RENDERER_ADAPTER_H 2 | #define EV0LVE_RENDERER_ADAPTER_H 3 | 4 | #define WIN32_LEAN_AND_MEAN 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | namespace evo::ren 11 | { 12 | /** 13 | * Adapter base class 14 | */ 15 | class adapter_base 16 | { 17 | public: 18 | adapter_base( HWND wnd = nullptr ) : window( wnd ), run( true ) 19 | {} 20 | 21 | /** 22 | * Creates GPU objects if they are not created yet 23 | */ 24 | virtual void create_objects() 25 | { 26 | draw.for_each_font( [] ( std::shared_ptr& f ) 27 | { 28 | f->create(); 29 | } ); 30 | 31 | draw.for_each_texture( [] ( std::shared_ptr& t ) 32 | { 33 | t->create(); 34 | } ); 35 | } 36 | 37 | /** 38 | * Destroys previously created GPU objects 39 | */ 40 | virtual void destroy_objects() 41 | { 42 | draw.for_each_font( [] ( std::shared_ptr& f ) 43 | { 44 | f->destroy(); 45 | } ); 46 | 47 | draw.for_each_texture( [] ( std::shared_ptr& t ) 48 | { 49 | t->destroy(); 50 | } ); 51 | } 52 | 53 | /** 54 | * Renders layers onto framebuffer 55 | */ 56 | virtual void render() 57 | { 58 | if ( !run ) 59 | return; 60 | 61 | draw.for_each_anim( [] ( std::shared_ptr& a ) 62 | { 63 | a->animate( draw.get_frame_time() ); 64 | } ); 65 | } 66 | 67 | /** 68 | * Creates a GPU texture 69 | * @param arr RGBA (or similar) buffer 70 | * @param w Width 71 | * @param h Height 72 | * @param p Stride 73 | * @return GPU object pointer or nullptr on failure 74 | */ 75 | virtual void* create_texture( void* arr, uint32_t w, uint32_t h, uint32_t p ) { return nullptr; } 76 | 77 | /** 78 | * Destroys a GPU texture 79 | * @param tex GPU object pointer 80 | */ 81 | virtual void destroy_texture( void* tex ) {} 82 | 83 | /** 84 | * Refreshes draw and rendering informations for frame 85 | */ 86 | void refresh() 87 | { 88 | if ( !window || !run ) 89 | return; 90 | 91 | RECT client_rect{}; 92 | GetClientRect( window, &client_rect ); 93 | 94 | display.x = ( float ) client_rect.right - client_rect.left; 95 | display.y = ( float ) client_rect.bottom - client_rect.top; 96 | } 97 | 98 | /** 99 | * Flushes layers 100 | */ 101 | void flush() const 102 | { 103 | draw.for_each_layer( [] ( layer& l ) 104 | { 105 | if ( l.get_draw_mode() == layer::dm_normal ) 106 | l.clear(); 107 | } ); 108 | } 109 | 110 | bool run{}; // Should process layers 111 | HWND window{}; // Window handle 112 | vec2 display{}; // Display area (aka #0 clip area) 113 | float dpi{ 1 }; // Scaling 114 | std::string name{ "None" }; // Adapter name (for debug purposes) 115 | }; 116 | 117 | inline std::shared_ptr adapter{}; 118 | } 119 | 120 | #endif //EV0LVE_RENDERER_ADAPTER_H 121 | -------------------------------------------------------------------------------- /internal_hvh/misc/renderer/include/ren/adapter_dx11.h: -------------------------------------------------------------------------------- 1 | #ifdef EVO_USE_DX11 2 | 3 | #ifndef EV0LVE_RENDERER_ADAPTER_DX11_H 4 | #define EV0LVE_RENDERER_ADAPTER_DX11_H 5 | 6 | #include 7 | 8 | #pragma warning (push) 9 | #pragma warning (disable: 4005) 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #pragma warning (pop) 17 | 18 | namespace evo::ren 19 | { 20 | class adapter_dx11 : public adapter_base 21 | { 22 | public: 23 | adapter_dx11(ID3D11Device* dev, ID3D11DeviceContext* c, HWND wnd) : adapter_base(wnd), device(dev), ctx(c) 24 | { 25 | name = "DirectX 11"; 26 | } 27 | 28 | void create_objects() override; 29 | void destroy_objects() override; 30 | void render() override; 31 | 32 | void* create_texture(void* arr, uint32_t w, uint32_t h, uint32_t p) override; 33 | void destroy_texture(void* tex) override; 34 | 35 | private: 36 | void create_const_buffer(); 37 | void create_blend_state(); 38 | void create_rasterizer_state(); 39 | void create_aa_rasterizer_state(); 40 | void create_depth_stencil_state(); 41 | void create_sampler_state(); 42 | 43 | ID3D11Device* device{}; 44 | ID3D11DeviceContext* ctx{}; 45 | ID3D11VertexShader* vertex_shader{}; 46 | ID3D11PixelShader* pixel_shader{}; 47 | ID3D11InputLayout* input_layout{}; 48 | ID3D11Buffer* vertex_buffer{}; 49 | ID3D11Buffer* index_buffer{}; 50 | ID3D11DepthStencilState* depth_stencil{}; 51 | ID3D11RasterizerState* rasterizer_state{}; 52 | ID3D11RasterizerState* aa_rasterizer_state{}; 53 | ID3D11BlendState* blend_state{}; 54 | ID3D11Buffer* constant_buffer{}; 55 | ID3D11SamplerState* texture_sampler{}; 56 | ID3D11ShaderResourceView* texture_object{}; 57 | 58 | size_t vb_size{5000}; 59 | size_t ib_size{10000}; 60 | 61 | bool objects_created{}; 62 | }; 63 | } 64 | 65 | #endif //EV0LVE_RENDERER_ADAPTER_DX11_H 66 | #endif -------------------------------------------------------------------------------- /internal_hvh/misc/renderer/include/ren/adapter_gl2.h: -------------------------------------------------------------------------------- 1 | #ifdef EVO_USE_GL2 2 | 3 | #ifndef ADAPTER_GL3_4CA217FB1105496AB7731FEE2E02D2BC_H 4 | #define ADAPTER_GL3_4CA217FB1105496AB7731FEE2E02D2BC_H 5 | 6 | #include 7 | #include 8 | 9 | namespace evo::ren 10 | { 11 | class gl2_backup 12 | { 13 | public: 14 | gl2_backup() 15 | { 16 | glGetIntegerv(GL_TEXTURE_BINDING_2D, &texture); 17 | glGetIntegerv(GL_POLYGON_MODE, polygon_mode); 18 | glGetIntegerv(GL_VIEWPORT, viewport); 19 | glGetIntegerv(GL_SCISSOR_BOX, scissor_box); 20 | glGetIntegerv(GL_SHADE_MODEL, &shade_model); 21 | 22 | glGetTexEnviv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, &tex_env_mode); 23 | } 24 | 25 | ~gl2_backup() 26 | { 27 | glBindTexture(GL_TEXTURE_2D, static_cast(texture)); 28 | 29 | glPolygonMode(GL_FRONT, (GLenum)polygon_mode[0]); 30 | glPolygonMode(GL_BACK, (GLenum)polygon_mode[1]); 31 | 32 | glViewport(viewport[0], viewport[1], viewport[2], viewport[3]); 33 | glScissor(scissor_box[0], scissor_box[1], scissor_box[2], scissor_box[3]); 34 | glShadeModel(shade_model); 35 | glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, tex_env_mode); 36 | } 37 | 38 | private: 39 | GLint texture{}, polygon_mode[2]{}, viewport[4]{}, scissor_box[4]{}, shade_model{}, tex_env_mode{}; 40 | }; 41 | 42 | class adapter_gl2 : public adapter_base 43 | { 44 | public: 45 | adapter_gl2(HWND wnd) : adapter_base(wnd) 46 | { 47 | name = "OpenGL 2"; 48 | } 49 | 50 | void create_objects() override; 51 | void destroy_objects() override; 52 | void render() override; 53 | 54 | void * create_texture(void *arr, uint32_t w, uint32_t h, uint32_t p) override; 55 | void destroy_texture(void *tex) override; 56 | 57 | private: 58 | bool objects_created{}; 59 | 60 | GLuint pixel_texture{}; 61 | }; 62 | } 63 | 64 | #endif //ADAPTER_GL3_4CA217FB1105496AB7731FEE2E02D2BC_H 65 | #endif -------------------------------------------------------------------------------- /internal_hvh/misc/renderer/include/ren/bitfont.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef GUI_RENDERER_BITFONT_H 3 | #define GUI_RENDERER_BITFONT_H 4 | 5 | #include 6 | 7 | namespace gui 8 | { 9 | class bitfont; 10 | 11 | class bitglyph : public evo::ren::glyph_base 12 | { 13 | public: 14 | bitglyph() = default; 15 | bitglyph( const uint32_t g, const std::shared_ptr& f, ABC& abc ) : glyph_index( g ), owner( f ), abc( abc ) 16 | {} 17 | 18 | void create() override; 19 | void destroy() override; 20 | 21 | private: 22 | ABC abc{}; 23 | uint32_t glyph_index{}; 24 | std::shared_ptr owner{}; 25 | 26 | bool is_created{}; 27 | 28 | friend class bitfont; 29 | }; 30 | 31 | class bitfont : public evo::ren::font_base 32 | { 33 | public: 34 | /** 35 | * Creates font through GDI 36 | * @param name Name of the font 37 | * @param size Size in pixels 38 | * @param flags Font flags 39 | * @param from Starting codepoint 40 | * @param to Ending codepoint 41 | */ 42 | bitfont( const std::string& name, float size, uint32_t weight = 400, uint32_t flags = evo::ren::ff_none, uint32_t from = 0x00, uint32_t to = 0xFF ); 43 | ~bitfont(); 44 | 45 | void create() override; 46 | void destroy() override; 47 | 48 | const evo::ren::glyph_base& find( const uint32_t u ) const override 49 | { 50 | return glyphs.find( u ) != glyphs.end() ? glyphs.at( u ) : fallback_glyph; 51 | } 52 | 53 | float get_advance( uint32_t a, uint32_t b ) override; 54 | 55 | private: 56 | inline bool glyph_exits( uint32_t g ); 57 | 58 | std::string name; 59 | 60 | HDC device{}; 61 | HFONT win_font{}; 62 | HBITMAP dib{}; 63 | TEXTMETRICA metric{}; 64 | 65 | uint32_t bitmap_size[ 2 ]{}; 66 | void* buffer{}; 67 | 68 | bitglyph fallback_glyph{}; 69 | std::unordered_map glyphs{}; 70 | 71 | friend class bitglyph; 72 | }; 73 | } 74 | 75 | #endif // GUI_RENDERER_BITFONT_H 76 | -------------------------------------------------------------------------------- /internal_hvh/misc/renderer/include/ren/command.h: -------------------------------------------------------------------------------- 1 | #ifndef EV0LVE_RENDERER_COMMAND_H 2 | #define EV0LVE_RENDERER_COMMAND_H 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | namespace evo::ren 12 | { 13 | class layer; 14 | 15 | /** 16 | * Adapter command 17 | */ 18 | class command 19 | { 20 | public: 21 | /** 22 | * Command constructor 23 | * @param l Layer pointer 24 | */ 25 | command(layer* l, bool set_texture = true); 26 | 27 | /** 28 | * Adds vertex to layer 29 | * @param vtx Vertex info 30 | */ 31 | void add_vertex(const vertex& vtx); 32 | 33 | template 34 | void add_vertex(const vertex& vtx, const V... vtxs) 35 | { 36 | add_vertex(vtx); 37 | add_vertex(vtxs...); 38 | } 39 | 40 | /** 41 | * Adds index to layer 42 | * @param idx Index number 43 | */ 44 | void add_index(const uint16_t idx); 45 | 46 | template 47 | void add_index(uint16_t idx, const N... idxs) 48 | { 49 | add_index(idx); 50 | add_index(idxs...); 51 | } 52 | 53 | bool anti_alias{}; // Should enforce anti-aliasing 54 | uint32_t vertices{}; // Vertex count 55 | uint32_t indices{}; // Index count 56 | std::shared_ptr texture{}; // Texture to be applied 57 | rect clip{}; // Clip rect 58 | bool no_dpi{}; // Should prevent auto-scaling 59 | std::optional alpha_mod{}; // Alpha modification 60 | 61 | private: 62 | layer* buffer{}; 63 | }; 64 | } 65 | 66 | #endif //EV0LVE_RENDERER_COMMAND_H 67 | -------------------------------------------------------------------------------- /internal_hvh/misc/renderer/include/ren/texture.h: -------------------------------------------------------------------------------- 1 | #ifndef EV0LVE_RENDERER_TEXTURE_H 2 | #define EV0LVE_RENDERER_TEXTURE_H 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | namespace evo::ren 10 | { 11 | class adapter_base; 12 | 13 | class texture : public std::enable_shared_from_this 14 | { 15 | enum creation 16 | { 17 | c_none, 18 | c_file, 19 | c_mem, 20 | c_rgba 21 | }; 22 | 23 | creation way{}; 24 | 25 | struct 26 | { 27 | std::string str{}; 28 | void* raw{}; 29 | size_t a{}; 30 | size_t b{}; 31 | size_t c{}; 32 | } creation_data; 33 | 34 | public: 35 | texture( void* tex ) : object( tex ) {} // WARNING: only use as wrapper for raw pushed textures for renderer where dimensions are irrelevant 36 | texture( const std::string& f ); 37 | texture( void* tex, size_t sz ); 38 | texture( void* tex, uint32_t w, uint32_t h, uint32_t p ); 39 | 40 | ~texture() 41 | { 42 | destroy(); 43 | 44 | if ( creation_data.raw ) 45 | free( creation_data.raw ); 46 | } 47 | 48 | operator void* ( ) 49 | { 50 | return object; 51 | } 52 | operator bool() const 53 | { 54 | return is_valid(); 55 | } 56 | 57 | template 58 | inline T* as() 59 | { 60 | return reinterpret_cast< T* >( object ); 61 | } 62 | 63 | inline bool is_valid() const 64 | { 65 | return object != nullptr; 66 | } 67 | 68 | ren::vec2 size() const 69 | { 70 | return way == c_rgba ? vec2( creation_data.a, creation_data.b ) : vec2( creation_data.b, creation_data.c ); 71 | } 72 | 73 | void create(); 74 | void destroy(); 75 | 76 | private: 77 | void* object{}; 78 | std::shared_ptr adp{}; // might need you later m8 79 | }; 80 | } 81 | 82 | #endif //EV0LVE_RENDERER_TEXTURE_H 83 | -------------------------------------------------------------------------------- /internal_hvh/misc/renderer/include/ren/vertex.h: -------------------------------------------------------------------------------- 1 | #ifndef EV0LVE_RENDERER_VERTEX_H 2 | #define EV0LVE_RENDERER_VERTEX_H 3 | 4 | #include 5 | 6 | namespace evo::ren 7 | { 8 | class vertex 9 | { 10 | public: 11 | vertex(const vec2& p, const color& c, const vec2& uv = {0.f, 0.f}) : pos(p), col(c), uv(uv) 12 | {} 13 | 14 | vertex set_uv(const vec2& u) const 15 | { 16 | return vertex(pos, col, u); 17 | } 18 | vertex set_color(const color& c) const 19 | { 20 | return vertex(pos, c, uv); 21 | } 22 | vertex set_pos(const vec2& p) const 23 | { 24 | return vertex(p, col, uv); 25 | } 26 | 27 | inline vec2 get_uv() const 28 | { 29 | return uv; 30 | } 31 | inline color get_color() const 32 | { 33 | return col; 34 | } 35 | inline vec2 get_pos() const 36 | { 37 | return pos; 38 | } 39 | 40 | private: 41 | vec2 pos{}; 42 | vec2 uv{}; 43 | uint32_t col{}; 44 | }; 45 | 46 | class vertex_constant_buffer 47 | { 48 | public: 49 | float mvp[4][4]{}; 50 | }; 51 | } 52 | 53 | #endif //EV0LVE_RENDERER_VERTEX_H 54 | -------------------------------------------------------------------------------- /internal_hvh/misc/renderer/src/command.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace evo::ren; 5 | 6 | command::command( layer* l, bool set_texture ) : buffer( l ) 7 | { 8 | alpha_mod = buffer->get_alpha(); 9 | 10 | // we don't need to 11 | if ( alpha_mod.value_or( 1.f ) == 0.f ) 12 | { 13 | buffer = nullptr; 14 | return; 15 | } 16 | 17 | // pre-set everything 18 | no_dpi = buffer->get_no_dpi().value_or( false ); 19 | clip = buffer->get_clip().value_or( rect().size( adapter->display ) ); 20 | anti_alias = buffer->get_aa().value_or( false ); 21 | 22 | if ( set_texture ) 23 | texture = buffer->get_texture().value_or( nullptr ); 24 | } 25 | 26 | void command::add_vertex( const vertex& vtx ) 27 | { 28 | if ( !buffer ) 29 | return; 30 | 31 | vertices++; 32 | buffer->vertices.emplace_back( vertex( 33 | vtx.get_pos() * ( no_dpi ? 1.f : adapter->dpi ), 34 | vtx.get_color().mod_a( alpha_mod.value_or( vtx.get_color().value.w ) ), 35 | vtx.get_uv() ) 36 | ); 37 | } 38 | 39 | void command::add_index( const uint16_t idx ) 40 | { 41 | if ( !buffer ) 42 | return; 43 | 44 | indices++; 45 | buffer->indices.emplace_back( idx ); 46 | } 47 | -------------------------------------------------------------------------------- /internal_hvh/misc/renderer/src/renderer.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by panzerfaust on 9/16/2020. 3 | // 4 | 5 | #include 6 | #include 7 | 8 | using namespace evo::ren; 9 | 10 | size_t renderer::get_total_vertices() 11 | { 12 | size_t count{}; 13 | for ( auto& l : layers ) 14 | { 15 | if ( l.second.get_draw_mode() == layer::dm_custom ) 16 | continue; 17 | 18 | count += l.second.vertices.size(); 19 | } 20 | 21 | return count; 22 | } 23 | 24 | size_t renderer::get_total_indices() 25 | { 26 | size_t count{}; 27 | for ( auto& l : layers ) 28 | { 29 | if ( l.second.get_draw_mode() == layer::dm_custom ) 30 | continue; 31 | 32 | count += l.second.indices.size(); 33 | } 34 | 35 | return count; 36 | } 37 | 38 | void renderer::for_each_layer( const std::function& fn ) 39 | { 40 | std::lock_guard _lock( mtx ); 41 | for ( auto& layer : layers ) 42 | { 43 | if ( layer.second.get_draw_mode() == layer::dm_custom ) 44 | continue; 45 | 46 | fn( layer.second ); 47 | } 48 | } 49 | 50 | void renderer::for_each_font( const std::function& )>& fn ) 51 | { 52 | for ( auto& f : fonts ) 53 | fn( f.second ); 54 | } 55 | 56 | void renderer::for_each_texture( const std::function& )>& fn ) 57 | { 58 | for ( auto& t : textures ) 59 | fn( t.second ); 60 | } 61 | 62 | void renderer::for_each_anim( const std::function& )>& fn ) 63 | { 64 | for ( auto& a : anims ) 65 | fn( a.second ); 66 | } 67 | -------------------------------------------------------------------------------- /internal_hvh/misc/renderer/src/texture.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by panzerfaust on 9/19/2020. 3 | // 4 | 5 | #include "../include_cheat.h" 6 | 7 | #include 8 | #include 9 | 10 | #include 11 | 12 | using namespace evo::ren; 13 | 14 | texture::texture( void* tex, size_t sz ) : adp( adapter ), way( c_mem ) 15 | { 16 | creation_data.raw = malloc( sz ); 17 | creation_data.a = sz; 18 | 19 | memcpy( creation_data.raw, tex, sz ); 20 | 21 | create(); 22 | } 23 | 24 | texture::texture( const std::string& f ) : adp( adapter ), way( c_file ) 25 | { 26 | creation_data.str = f; 27 | 28 | create(); 29 | } 30 | 31 | texture::texture( void* tex, uint32_t w, uint32_t h, uint32_t p ) : adp( adapter ), way( c_rgba ) 32 | { 33 | creation_data.raw = malloc( h * p ); 34 | creation_data.a = w; 35 | creation_data.b = h; 36 | creation_data.c = p; 37 | 38 | memcpy( creation_data.raw, tex, h * p ); 39 | 40 | create(); 41 | } 42 | 43 | void texture::destroy() 44 | { 45 | if ( is_valid() && way != c_none ) 46 | adp->destroy_texture( object ); 47 | object = nullptr; 48 | } 49 | 50 | void texture::create() 51 | { 52 | if ( is_valid() || way == c_none ) 53 | return; 54 | 55 | uint8_t* data{}; int w{}, h{}, channels{}; uint32_t stride{}; 56 | if ( way == c_mem ) 57 | data = stbi_load_from_memory( reinterpret_cast< uint8_t* >( creation_data.raw ), creation_data.a, &w, &h, &channels, 4 ); 58 | if ( way == c_file ) 59 | data = stbi_load( creation_data.str.c_str(), &w, &h, &channels, 4 ); 60 | if ( way == c_rgba ) 61 | { 62 | data = reinterpret_cast< uint8_t* >( creation_data.raw ); 63 | w = creation_data.a; 64 | h = creation_data.b; 65 | stride = creation_data.c; 66 | channels = 4; 67 | } 68 | else 69 | stride = w * 4; 70 | 71 | // we don't want null or non-rgba images 72 | if ( !data || !channels ) 73 | { 74 | if ( way != c_rgba && data ) 75 | stbi_image_free( data ); 76 | 77 | return; 78 | } 79 | 80 | object = adp->create_texture( data, w, h, stride ); 81 | if ( way != c_rgba ) 82 | { 83 | stbi_image_free( data ); 84 | 85 | creation_data.b = w; 86 | creation_data.c = h; 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /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/CCSGameRulesProxy.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class C_CSGameRulesProxy 4 | { 5 | public: 6 | NETVAR( m_bFreezePeriod, bool, CCSGameRulesProxy_m_bFreezePeriod ) 7 | NETVAR( m_bIsValveDS, bool, CCSGameRulesProxy_m_bIsValveDS ) 8 | NETVAR( m_flSurvivalStartTime, float, CCSGameRulesProxy_m_flSurvivalStartTime ) 9 | NETVAR( get_play_all_step_sounds_on_server, bool, CCSGameRulesProxy_m_bPlayAllStepSoundsOnServer ) 10 | VFUNC( 28, ShouldCollide( int collisionGroup0, int collisionGroup1 ), bool( __thiscall* )( void*, int, int ) )( collisionGroup0, collisionGroup0 ) 11 | }; -------------------------------------------------------------------------------- /internal_hvh/sdk/ClientClass.h: -------------------------------------------------------------------------------- 1 | class IClientNetworkable; 2 | class ClientClass; 3 | struct 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 | ClassId m_ClassID; 17 | }; 18 | -------------------------------------------------------------------------------- /internal_hvh/sdk/ConVar.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "interfaces/ICVar.h" 3 | 4 | struct convar_value_t 5 | { 6 | char* string{}; 7 | int32_t string_length{}; 8 | float value{}; 9 | int32_t n_val{}; 10 | }; 11 | 12 | class ConVar 13 | { 14 | public: 15 | static inline bool cl_lagcompensation = true; 16 | static inline bool cl_predict = true; 17 | 18 | void enforce_sent_value( bool& current, bool val ); 19 | 20 | VFUNC( 5, get_name(), char* ( __thiscall* )( void* ) )( ); 21 | VFUNC( 14, set_value_internal( const char* value ), void( __thiscall* )( void*, const char* ) )( value ); 22 | VFUNC( 15, set_value_internal( float value ), void( __thiscall* )( void*, float ) )( value ); 23 | VFUNC( 16, set_value_internal( int value ), void( __thiscall* )( void*, int ) )( value ); 24 | VFUNC( 17, set_value_internal( Color value ), void( __thiscall* )( void*, Color ) )( value ); 25 | VFUNC( 12, get_float(), float( __thiscall* )( void* ) )( ); 26 | VFUNC( 13, get_int(), int( __thiscall* )( void* ) )( ); 27 | 28 | template 29 | inline void set_value( T v ) 30 | { 31 | set_value_internal( v ); 32 | orig_value = value; 33 | } 34 | 35 | bool get_bool() { return !!get_int(); } 36 | 37 | void unlock() 38 | { 39 | flags &= ~FCVAR_CHEAT; 40 | orig_flags = flags | 1; 41 | } 42 | 43 | void unarchive() 44 | { 45 | flags &= ~FCVAR_ARCHIVE; 46 | orig_flags = flags | 1; 47 | } 48 | 49 | void set_string( const char* value ) { set_value( value ); } 50 | void set_float( float value ) { set_value( value ); } 51 | void set_int( int value ) { set_value( value ); } 52 | void set_color( Color value ) { set_value( value ); } 53 | 54 | char pad0[ 0x4 ]{}; 55 | ConVar* next{}; 56 | int32_t orig_flags{}; 57 | char* name{}; 58 | char* help_string{}; 59 | int32_t flags{}; 60 | char pad1[ 0x4 ]{}; 61 | ConVar* parent{}; 62 | char* default_value{}; 63 | 64 | convar_value_t value{}; 65 | convar_value_t orig_value{}; 66 | 67 | int32_t has_min{}; 68 | float min_val{}; 69 | int32_t has_max{}; 70 | float max_val{}; 71 | void* change_callback{}; 72 | };//Size=0x0048 -------------------------------------------------------------------------------- /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 | VFUNC( 26, set_vec_component_calue( float value, int component ), void( __thiscall* )( void*, float, int ) ) ( value, component ) 13 | 14 | VFUNC( 6, set_string( const char* val ), void( __thiscall* )( void*, const char* ) )( val ) 15 | VFUNC( 7, get_string(), const char* ( __thiscall* )( void* ) )( ) 16 | VFUNC( 20, set_matrix( VMatrix& matrix ), void( __thiscall* )( void*, VMatrix& ) )( matrix ) 17 | VFUNC( 26, set_vector_component( const float val, const int comp ), void( __thiscall* )( void*, float, int ) )( val, comp ) 18 | VFUNC( 27, get_int(), int( __thiscall* )( void* ) )( ) 19 | VFUNC( 28, get_float(), float( __thiscall* )( void* ) )( ) 20 | VFUNC( 29, get_vector(), float* ( __thiscall* )( void* ) )( ) 21 | VFUNC( 31, get_vector_size(), int( __thiscall* )( void* ) )( ) 22 | }; 23 | -------------------------------------------------------------------------------- /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 INetMessage; 8 | class INetChannelInfo 9 | { 10 | public: 11 | 12 | enum 13 | { 14 | GENERIC = 0, // must be first and is default group 15 | LOCALPLAYER, // bytes for local player entity update 16 | OTHERPLAYERS, // bytes for other players update 17 | ENTITIES, // all other entity bytes 18 | SOUNDS, // game sounds 19 | EVENTS, // event messages 20 | USERMESSAGES, // user messages 21 | ENTMESSAGES, // entity messages 22 | VOICE, // voice data 23 | STRINGTABLE, // a stringtable update 24 | MOVE, // client move cmds 25 | STRINGCMD, // string command 26 | SIGNON, // various signondata 27 | TOTAL, // must be last and is not a real group 28 | }; 29 | 30 | virtual const char* GetName( void ) const = 0; // get channel name 31 | virtual const char* GetAddress( void ) const = 0; // get channel IP address as string 32 | virtual float GetTime( void ) const = 0; // current net time 33 | virtual float GetTimeConnected( void ) const = 0; // get connection time in seconds 34 | virtual int GetBufferSize( void ) const = 0; // netchannel packet history size 35 | virtual int GetDataRate( void ) const = 0; // send data rate in byte/sec 36 | 37 | virtual bool IsLoopback( void ) const = 0; // true if loopback channel 38 | virtual bool IsTimingOut( void ) const = 0; // true if timing out 39 | virtual bool IsPlayback( void ) const = 0; // true if demo playback 40 | 41 | virtual float GetLatency( int flow ) const = 0; // current latency (RTT), more accurate but jittering 42 | virtual float GetAvgLatency( int flow ) const = 0; // average packet latency in seconds 43 | virtual float GetAvgLoss( int flow ) const = 0; // avg packet loss[0..1] 44 | virtual float GetAvgChoke( int flow ) const = 0; // avg packet choke[0..1] 45 | virtual float GetAvgData( int flow ) const = 0; // data flow in bytes/sec 46 | virtual float GetAvgPackets( int flow ) const = 0; // avg packets/sec 47 | virtual int GetTotalData( int flow ) const = 0; // total flow in/out in bytes 48 | virtual int GetSequenceNr( int flow ) const = 0; // last send seq number 49 | virtual bool IsValidPacket( int flow, int frame_number ) const = 0; // true if packet default not lost/dropped/chocked/flushed 50 | virtual float GetPacketTime( int flow, int frame_number ) const = 0; // time when packet default send 51 | virtual int GetPacketBytes( int flow, int frame_number, int group ) const = 0; // group size of this packet 52 | virtual bool GetStreamProgress( int flow, int* received, int* total ) const = 0; // TCP progress if transmitting 53 | virtual float GetTimeSinceLastReceived( void ) const = 0; // get time since last recieved packet in seconds 54 | virtual float GetCommandInterpolationAmount( int flow, int frame_number ) const = 0; 55 | virtual void GetPacketResponseLatency( int flow, int frame_number, int* pnLatencyMsecs, int* pnChoke ) const = 0; 56 | virtual void GetRemoteFramerate( float* pflFrameTime, float* pflFrameTimeStdDeviation ) const = 0; 57 | 58 | virtual float GetTimeoutSeconds() const = 0; 59 | 60 | VFUNC( 40, SendNetMsg( INetMessage* msg, bool bForceReliable, bool bVoice = false ), bool( __thiscall* )( void*, INetMessage*, bool, bool ) )( msg, bForceReliable, bVoice ); 61 | }; -------------------------------------------------------------------------------- /internal_hvh/sdk/IRefCounted.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class IRefCounted 4 | { 5 | private: 6 | volatile long refCount{}; 7 | public: 8 | virtual int destruct( bool del ) = 0; 9 | virtual int Release() = 0; 10 | 11 | void unreference() 12 | { 13 | if ( InterlockedDecrement( &refCount ) == 0 && Release() ) 14 | destruct( true ); 15 | } 16 | }; -------------------------------------------------------------------------------- /internal_hvh/sdk/KeyValues.h: -------------------------------------------------------------------------------- 1 | class INetMessage; 2 | 3 | class KeyValuesSystem 4 | { 5 | public: 6 | VFUNC( 2, allocate_key_values_memory( int size ), void* ( __thiscall* )( void*, int ) )( size ); 7 | VFUNC( 3, free_key_values_memory( void* mem ), void ( __thiscall* )( void*, void* ) )( mem ); 8 | VFUNC( 4, get_symbol_for_string( const char* name, bool create ), int( __thiscall* )( void*, const char*, bool ) )( name, create ); 9 | VFUNC( 5, get_symbol_for_string( int symbol ), const char* ( __thiscall* )( void*, int ) )( symbol ); 10 | }; 11 | 12 | class KeyValues 13 | { 14 | public: 15 | void init( const char* name ); 16 | void set_string( const char* keyName, const char* value ); 17 | static bool load_from_buffer( KeyValues* kv, char const* name, const char* buffer ); 18 | 19 | enum types_t 20 | { 21 | TYPE_NONE = 0, 22 | TYPE_STRING, 23 | TYPE_INT, 24 | TYPE_FLOAT, 25 | TYPE_PTR, 26 | TYPE_WSTRING, 27 | TYPE_COLOR, 28 | TYPE_UINT64, 29 | TYPE_COMPILED_INT_BYTE, 30 | TYPE_COMPILED_INT_0, 31 | TYPE_COMPILED_INT_1, 32 | TYPE_NUMTYPES, 33 | }; 34 | 35 | public: 36 | static KeyValues* create( char const* name ); 37 | static KeyValues* from_netsmg( INetMessage* msg ); 38 | 39 | ~KeyValues(); 40 | 41 | KeyValues* find_key( const char* key_name ); 42 | 43 | const char* get_name() const; 44 | 45 | inline KeyValues* get_first_value() const 46 | { 47 | auto ret = sub; 48 | while ( ret && ret->data_type == TYPE_NONE ) 49 | ret = ret->peer; 50 | return ret; 51 | } 52 | 53 | inline KeyValues* get_next_value() const 54 | { 55 | auto ret = peer; 56 | while ( ret && ret->data_type == TYPE_NONE ) 57 | ret = ret->peer; 58 | return ret; 59 | } 60 | 61 | inline void* get_ptr( const char* key = nullptr, void* def = nullptr ) 62 | { 63 | if ( auto dat = find_key( key ); dat ) 64 | { 65 | switch ( dat->data_type ) 66 | { 67 | case TYPE_FLOAT: 68 | case TYPE_INT: 69 | case TYPE_PTR: 70 | return dat->p_value; 71 | case TYPE_WSTRING: 72 | return dat->ws_value; 73 | case TYPE_STRING: 74 | return dat->s_value; 75 | case TYPE_UINT64: 76 | default: 77 | break; 78 | }; 79 | } 80 | 81 | return def; 82 | } 83 | 84 | KeyValues() = delete; 85 | 86 | uint32_t key_name : 24; 87 | uint32_t key_name_case_sensitive1 : 8; 88 | 89 | char* s_value = nullptr; 90 | wchar_t* ws_value = nullptr; 91 | 92 | union 93 | { 94 | int i_value; 95 | float f_value; 96 | void* p_value; 97 | uint8_t color[ 4 ]; 98 | }; 99 | 100 | char data_type = 0; 101 | char has_escape_sequences = 0; 102 | uint16_t key_name_case_sensitive2 = 0; 103 | 104 | char pad[ 8 ]{}; 105 | KeyValues* peer = nullptr; 106 | KeyValues* sub = nullptr; 107 | KeyValues* chain = nullptr; 108 | 109 | uintptr_t expression_get_symbol_proc = 0; 110 | }; -------------------------------------------------------------------------------- /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 | VMatrix() = default; 6 | 7 | float m[ 4 ][ 4 ]; 8 | 9 | inline float* operator[]( int i ) 10 | { 11 | return m[ i ]; 12 | } 13 | 14 | inline const float* operator[]( int i ) const 15 | { 16 | return m[ i ]; 17 | } 18 | 19 | inline const matrix3x4_t& as_3x4() const 20 | { 21 | return *( ( const matrix3x4_t* ) this ); 22 | } 23 | }; -------------------------------------------------------------------------------- /internal_hvh/sdk/datatypes/Vector.cpp: -------------------------------------------------------------------------------- 1 | #include "../../include_cheat.h" 2 | 3 | bool Vector::to_screen() 4 | { 5 | static auto out = Vector(); 6 | const auto ret = math::world_to_screen( *this, out ); 7 | *this = out; 8 | return ret; 9 | } 10 | -------------------------------------------------------------------------------- /internal_hvh/sdk/datatypes/Vector4D.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class Vector4D 4 | { 5 | public: 6 | Vector4D() = default; 7 | Vector4D( float x, float y, float z, float w ) : x( x ), y( y ), z( z ), w( w ) {} 8 | 9 | // Members 10 | float x, y, z, w; 11 | 12 | inline float* Base(); 13 | inline float const* Base() const; 14 | 15 | float operator[]( int i ) const; 16 | float& operator[]( int i ); 17 | }; 18 | 19 | inline float* Vector4D::Base() 20 | { 21 | return ( float* ) this; 22 | } 23 | 24 | inline float const* Vector4D::Base() const 25 | { 26 | return ( float const* ) this; 27 | } 28 | 29 | inline float& Vector4D::operator[]( int i ) 30 | { 31 | Assert( ( i >= 0 ) && ( i < 4 ) ); 32 | return ( ( float* ) this )[ i ]; 33 | } 34 | 35 | inline float Vector4D::operator[]( int i ) const 36 | { 37 | Assert( ( i >= 0 ) && ( i < 4 ) ); 38 | return ( ( float* ) this )[ i ]; 39 | } -------------------------------------------------------------------------------- /internal_hvh/sdk/datatypes/include_datatypes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../interfaces/IMemAlloc.h" //GHETTOFIX MEMALLOC 4 | #include "Vector.h" 5 | #include "QAngle.h" 6 | #include "matrix3x4_t.h" 7 | #include "matrix3x3_t.h" 8 | #include "VMatrix.h" 9 | #include "CUtlVector.h" 10 | #include "Vector2D.h" 11 | #include "Vector4D.h" 12 | #include "Color.h" -------------------------------------------------------------------------------- /internal_hvh/sdk/datatypes/matrix3x3_t.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct matrix3x3_t 4 | { 5 | matrix3x3_t() = default; 6 | matrix3x3_t( 7 | float m00, float m01, float m02, 8 | float m10, float m11, float m12, 9 | float m20, float m21, float m22 ) 10 | { 11 | m_flMatVal[ 0 ][ 0 ] = m00; m_flMatVal[ 0 ][ 1 ] = m01; m_flMatVal[ 0 ][ 2 ] = m02; 12 | m_flMatVal[ 1 ][ 0 ] = m10; m_flMatVal[ 1 ][ 1 ] = m11; m_flMatVal[ 1 ][ 2 ] = m12; 13 | m_flMatVal[ 2 ][ 0 ] = m20; m_flMatVal[ 2 ][ 1 ] = m21; m_flMatVal[ 2 ][ 2 ] = m22; 14 | } 15 | 16 | matrix3x3_t( 17 | float* m0, 18 | float* m1, 19 | float* m2 ) 20 | { 21 | m_flMatVal[ 0 ][ 0 ] = m0[ 0 ]; m_flMatVal[ 0 ][ 1 ] = m0[ 1 ]; m_flMatVal[ 0 ][ 2 ] = m0[ 2 ]; 22 | m_flMatVal[ 1 ][ 0 ] = m1[ 0 ]; m_flMatVal[ 1 ][ 1 ] = m1[ 1 ]; m_flMatVal[ 1 ][ 2 ] = m1[ 2 ]; 23 | m_flMatVal[ 2 ][ 0 ] = m2[ 0 ]; m_flMatVal[ 2 ][ 1 ] = m2[ 1 ]; m_flMatVal[ 2 ][ 2 ] = m2[ 2 ]; 24 | } 25 | 26 | float *operator[]( int i ) { return m_flMatVal[ i ]; } 27 | const float *operator[]( int i ) const { return m_flMatVal[ i ]; } 28 | float *Base() { return &m_flMatVal[ 0 ][ 0 ]; } 29 | const float *Base() const { return &m_flMatVal[ 0 ][ 0 ]; } 30 | __forceinline matrix3x3_t transpose() const 31 | { 32 | return matrix3x3_t( m_flMatVal[ 0 ][ 0 ], m_flMatVal[ 1 ][ 0 ], m_flMatVal[ 2 ][ 0 ], 33 | m_flMatVal[ 0 ][ 1 ], m_flMatVal[ 1 ][ 1 ], m_flMatVal[ 2 ][ 1 ], 34 | m_flMatVal[ 0 ][ 2 ], m_flMatVal[ 1 ][ 2 ], m_flMatVal[ 2 ][ 2 ] ); 35 | } 36 | 37 | typedef double tfScalar; 38 | __forceinline static const matrix3x3_t &getIdentity() 39 | { 40 | static const matrix3x3_t identityMatrix( tfScalar( 1.0 ), tfScalar( 0.0 ), tfScalar( 0.0 ), 41 | tfScalar( 0.0 ), tfScalar( 1.0 ), tfScalar( 0.0 ), 42 | tfScalar( 0.0 ), tfScalar( 0.0 ), tfScalar( 1.0 ) ); 43 | return identityMatrix; 44 | } 45 | 46 | __forceinline tfScalar tdotx( const float* v ) const 47 | { 48 | return m_flMatVal[ 0 ][ 0 ] * v[ 0 ] + m_flMatVal[ 1 ][ 0 ] * v[ 1 ] + m_flMatVal[ 2 ][ 0 ] * v[ 2 ]; 49 | } 50 | __forceinline tfScalar tdoty( const float* v ) const 51 | { 52 | return m_flMatVal[ 0 ][ 1 ] * v[ 0 ] + m_flMatVal[ 1 ][ 1 ] * v[ 1 ] + m_flMatVal[ 2 ][ 1 ] * v[ 2 ]; 53 | } 54 | __forceinline tfScalar tdotz( const float* v ) const 55 | { 56 | return m_flMatVal[ 0 ][ 2 ] * v[ 0 ] + m_flMatVal[ 1 ][ 2 ] * v[ 1 ] + m_flMatVal[ 2 ][ 2 ] * v[ 2 ]; 57 | } 58 | 59 | __forceinline matrix3x3_t operator*( const matrix3x3_t& m2 ) const 60 | { 61 | return matrix3x3_t( 62 | m2.tdotx( m_flMatVal[ 0 ] ), m2.tdoty( m_flMatVal[ 0 ] ), m2.tdotz( m_flMatVal[ 0 ] ), 63 | m2.tdotx( m_flMatVal[ 1 ] ), m2.tdoty( m_flMatVal[ 1 ] ), m2.tdotz( m_flMatVal[ 1 ] ), 64 | m2.tdotx( m_flMatVal[ 2 ] ), m2.tdoty( m_flMatVal[ 2 ] ), m2.tdotz( m_flMatVal[ 2 ] ) ); 65 | } 66 | 67 | __forceinline Vector operator*( const Vector& v ) 68 | { 69 | return Vector( Vector( m_flMatVal[ 0 ] ).Dot( v ), Vector( m_flMatVal[ 1 ] ).Dot( v ), Vector( m_flMatVal[ 2 ] ).Dot( v ) ); 70 | } 71 | 72 | float m_flMatVal[ 3 ][ 3 ]{}; 73 | }; -------------------------------------------------------------------------------- /internal_hvh/sdk/datatypes/matrix3x4_t.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | struct matrix3x4_t 5 | { 6 | matrix3x4_t() = default; 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 void Invalidate( void ) 52 | { 53 | for ( int i = 0; i < 3; i++ ) 54 | { 55 | for ( int j = 0; j < 4; j++ ) 56 | { 57 | m_flMatVal[ i ][ j ] = VEC_T_NAN; 58 | } 59 | } 60 | } 61 | 62 | float *operator[]( int i ) { Assert( ( i >= 0 ) && ( i < 3 ) ); return m_flMatVal[ i ]; } 63 | const float *operator[]( int i ) const { Assert( ( i >= 0 ) && ( i < 3 ) ); return m_flMatVal[ i ]; } 64 | float *Base() { return &m_flMatVal[ 0 ][ 0 ]; } 65 | const float *Base() const { return &m_flMatVal[ 0 ][ 0 ]; } 66 | 67 | float m_flMatVal[ 3 ][ 4 ]{}; 68 | }; -------------------------------------------------------------------------------- /internal_hvh/sdk/include_sdk.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "misc.h" 4 | #include "structs.h" 5 | #include "ConVar.h" 6 | #include "ClientClass.h" 7 | #include "IClientEntity.h" 8 | #include "entity_classes.h" 9 | #include "IRefCounted.h" 10 | #include "IMaterial.h" 11 | #include "IMaterialVar.h" 12 | #include "trace_ray.h" 13 | #include "CCSGOPlayerAnimState.h" 14 | #include "INetChannelInfo.h" 15 | #include "CBoneChache.h" 16 | #include "CNetChannel.h" 17 | #include "CCSGameRulesProxy.h" 18 | #include "KeyValues.h" 19 | #include "../features/structs.h" 20 | #include "interfaces/interfaces.h" 21 | #include "CMergedMDL.h" 22 | #include "econ_item.h" 23 | #include "panorama.h" -------------------------------------------------------------------------------- /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 | int m_nNextFreeSlot; 13 | C_BaseEntity* m_pEntity; 14 | Vector m_vGlowColor; 15 | float m_flGlowAlpha; 16 | bool m_bGlowAlphaCappedByRenderAlpha; 17 | float m_flGlowAlphaFunctionOfMaxVelocity; 18 | float m_flGlowAlphaMax; 19 | float m_flGlowPulseOverdrive; 20 | bool m_bRenderWhenOccluded; 21 | bool m_bRenderWhenUnoccluded; 22 | bool m_bFullBloomRender; 23 | int m_nFullBloomStencilTestValue; 24 | int m_nRenderStyle; 25 | int m_nSplitScreenSlot; 26 | // Special values for GlowObjectDefinition_t::m_nNextFreeSlot 27 | static const int END_OF_FREE_LIST = -1; 28 | static const int ENTRY_IN_USE = -2; 29 | }; 30 | 31 | void RenderGlowEffects(); 32 | 33 | CUtlVector< GlowObjectDefinition_t > m_glObjectDefinitions; 34 | int m_nFirstFreeSlot; 35 | struct GlowBoxDefinition_t 36 | { 37 | Vector m_vPosition; 38 | QAngle m_angOrientation; 39 | Vector m_vMins; 40 | Vector m_vMaxs; 41 | float m_flBirthTimeIndex; 42 | float m_flTerminationTimeIndex; //when to die 43 | Color m_colColor; 44 | }; 45 | 46 | CUtlVector< GlowBoxDefinition_t > m_GlowBoxDefinitions; 47 | }; 48 | 49 | struct ShaderStencilState_t 50 | { 51 | bool m_bEnable; 52 | ShaderStencilOp_t m_FailOp; 53 | ShaderStencilOp_t m_ZFailOp; 54 | ShaderStencilOp_t m_PassOp; 55 | ShaderStencilFunc_t m_CompareFunc; 56 | int m_nReferenceValue; 57 | uint32 m_nTestMask; 58 | uint32 m_nWriteMask; 59 | 60 | ShaderStencilState_t() 61 | { 62 | m_bEnable = false; 63 | m_PassOp = m_FailOp = m_ZFailOp = SHADER_STENCILOP_KEEP; 64 | m_CompareFunc = SHADER_STENCILFUNC_ALWAYS; 65 | m_nReferenceValue = 0; 66 | m_nTestMask = m_nWriteMask = 0xFFFFFFFF; 67 | } 68 | }; 69 | -------------------------------------------------------------------------------- /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* ), make_offset( "client.dll", sig_find_element ) )( name ) 7 | }; 8 | -------------------------------------------------------------------------------- /internal_hvh/sdk/interfaces/CSPlayerResource.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class Color; 4 | class C_CSPlayerResource : C_BaseEntity 5 | { 6 | public: 7 | DATAMAPVARRS( get_ping, int, "m_iPing" ) 8 | NETVAR( get_c4_player, int, CCSPlayerResource_m_iPlayerC4 ) 9 | DATAMAPVARRS( get_kills, int, "m_iKills" ) 10 | DATAMAPVARRS( get_health, int, "m_iHealth" ) 11 | NETVARRS( get_clan, const char, CCSPlayerResource_m_szClan ) 12 | NETVARRS( get_crosshair_code, const char, CCSPlayerResource_m_szCrosshairCodes ) 13 | }; -------------------------------------------------------------------------------- /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 | VFUNC( 24, WriteUsercmdDeltaToBuffer( int nSlot, void* buf, int from, int to, bool isNewCmd ), bool( __thiscall* )( void*, int, void*, int, int, bool ) )( nSlot, buf, from, to, isNewCmd ) 11 | }; 12 | -------------------------------------------------------------------------------- /internal_hvh/sdk/interfaces/IBaseFileSystem.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | typedef void* ( *FSAllocFunc_t )( const char* pszFilename, unsigned nBytes ); 4 | 5 | enum FileSystemSeek_t 6 | { 7 | FILESYSTEM_SEEK_HEAD = SEEK_SET, 8 | FILESYSTEM_SEEK_CURRENT = SEEK_CUR, 9 | FILESYSTEM_SEEK_TAIL = SEEK_END, 10 | }; 11 | 12 | typedef void* FileHandle_t; 13 | class CUtlBuffer; 14 | class IBaseFileSystem 15 | { 16 | public: 17 | virtual int Read( void* pOutput, int size, FileHandle_t file ) = 0; 18 | virtual int Write( void const* pInput, int size, FileHandle_t file ) = 0; 19 | 20 | // if pathID is NULL, all paths will be searched for the file 21 | virtual FileHandle_t Open( const char* pFileName, const char* pOptions, const char* pathID = 0 ) = 0; 22 | virtual void Close( FileHandle_t file ) = 0; 23 | 24 | 25 | virtual void Seek( FileHandle_t file, int pos, FileSystemSeek_t seekType ) = 0; 26 | virtual unsigned int Tell( FileHandle_t file ) = 0; 27 | virtual unsigned int Size( FileHandle_t file ) = 0; 28 | virtual unsigned int Size( const char* pFileName, const char* pPathID = 0 ) = 0; 29 | 30 | virtual void Flush( FileHandle_t file ) = 0; 31 | virtual bool Precache( const char* pFileName, const char* pPathID = 0 ) = 0; 32 | 33 | virtual bool FileExists( const char* pFileName, const char* pPathID = 0 ) = 0; 34 | virtual bool IsFileWritable( char const* pFileName, const char* pPathID = 0 ) = 0; 35 | virtual bool SetFileWritable( char const* pFileName, bool writable, const char* pPathID = 0 ) = 0; 36 | 37 | virtual long GetFileTime( const char* pFileName, const char* pPathID = 0 ) = 0; 38 | 39 | //-------------------------------------------------------- 40 | // Reads/writes files to utlbuffers. Use this for optimal read performance when doing open/read/close 41 | //-------------------------------------------------------- 42 | virtual bool ReadFile( const char* pFileName, const char* pPath, CUtlBuffer& buf, int nMaxBytes = 0, int nStartingByte = 0, FSAllocFunc_t pfnAlloc = NULL ) = 0; 43 | virtual bool WriteFile( const char* pFileName, const char* pPath, CUtlBuffer& buf ) = 0; 44 | virtual bool UnzipFile( const char* pFileName, const char* pPath, const char* pDestination ) = 0; 45 | }; 46 | -------------------------------------------------------------------------------- /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 ConVar; 21 | class ICVar : public IAppSystem2 22 | { 23 | public: 24 | virtual void func10() = 0; 25 | virtual void RegisterConCommand( ConVar *pCommandBase ) = 0; 26 | virtual void UnregisterConCommand( ConVar *pCommandBase ) = 0; 27 | virtual void func13() = 0; 28 | virtual ConVar *FindVar( const char *var_name ) = 0; 29 | 30 | template 31 | void ConsoleColorPrintf( const Color& MsgColor, const char* szMsgFormat, Values... Parameters ) 32 | { 33 | typedef void( *oConsoleColorPrintf )( void*, const Color&, const char*, ... ); 34 | return util::get_vfunc( this, 25 )( this, MsgColor, szMsgFormat, Parameters... ); 35 | } 36 | }; 37 | 38 | class ConCommand 39 | { 40 | public: 41 | enum 42 | { 43 | COMMAND_MAX_ARGC = 64, 44 | COMMAND_MAX_LENGTH = 512, 45 | }; 46 | 47 | int m_nArgc; 48 | int m_nArgv0Size; 49 | char m_pArgSBuffer[ COMMAND_MAX_LENGTH ]{}; 50 | char m_pArgvBuffer[ COMMAND_MAX_LENGTH ]{}; 51 | const char* m_ppArgv[ COMMAND_MAX_ARGC ]{}; 52 | 53 | explicit ConCommand( const char* command ) 54 | { 55 | strcpy_s( m_pArgSBuffer, command ); 56 | strcpy_s( m_pArgvBuffer, command ); 57 | 58 | m_nArgc = 1; 59 | m_ppArgv[ 0 ] = m_pArgvBuffer; 60 | 61 | for ( size_t i = 0; i < strlen( m_pArgSBuffer ); i++ ) 62 | { 63 | if ( m_pArgvBuffer[ i ] == ' ' ) 64 | { 65 | m_pArgvBuffer[ i ] = 0; 66 | m_ppArgv[ m_nArgc ] = &m_pArgvBuffer[ i + 1 ]; //dont ever call that with a space at the end. 67 | m_nArgc++; 68 | } 69 | } 70 | m_nArgv0Size = strlen( m_pArgvBuffer ); 71 | } 72 | }; -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | bool get_bool( const char* name ) { return GetBool( name ); } 29 | int get_int( const char* name ) { return GetInt( name ); } 30 | float get_float( const char* name ) { return GetFloat( name ); } 31 | std::string get_string( const char* name ) { return GetString( name ); } 32 | 33 | void* descriptor; 34 | KeyValues* kv; 35 | }; 36 | 37 | 38 | class IGameEventListener2 39 | { 40 | public: 41 | virtual ~IGameEventListener2( void ) {}; 42 | 43 | virtual void FireGameEvent( IGameEvent *event ) = 0; 44 | virtual int GetEventDebugID( void ) = 0; 45 | }; 46 | 47 | #undef CreateEvent 48 | class IGameEventManager2 49 | { 50 | public: 51 | virtual ~IGameEventManager2( void ) {}; 52 | virtual int LoadEventsFromFile( const char* filename ) = 0; 53 | virtual void Reset() = 0; 54 | virtual bool AddListener( IGameEventListener2* listener, const char* name, bool bServerSide ) = 0; 55 | virtual bool FindListener( IGameEventListener2* listener, const char* name ) = 0; 56 | virtual void RemoveListener( IGameEventListener2* listener ) = 0; 57 | virtual void AddListenerGlobal( IGameEventListener2* listener, bool bIsServerSide ) = 0; 58 | virtual IGameEvent* CreateEvent( const char* name, bool bForce = false, int* pCookie = NULL ) = 0; 59 | virtual bool FireEvent( IGameEvent* event, bool bDontBroadcast = false ) = 0; 60 | virtual bool FireEventClientSide( IGameEvent* event ) = 0; 61 | virtual IGameEvent* DuplicateEvent( IGameEvent* event ) = 0; 62 | virtual void FreeEvent( IGameEvent* event ) = 0; 63 | virtual bool SerializeEvent( IGameEvent* event, int* buf ) = 0; 64 | virtual IGameEvent* UnserializeEvent( int* buf ) = 0; 65 | virtual void *GetEventDataTypes( IGameEvent* event ) = 0; 66 | }; 67 | -------------------------------------------------------------------------------- /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 | bool m_bClient; 20 | bool m_bRemoteClient; 21 | int nTimestampNetworkingBase; 22 | int nTimestampRandomizeWindow; 23 | 24 | float get_realtime() const { return realtime; } 25 | int get_framecount() const { return framecount; } 26 | float get_curtime() const { return curtime; } 27 | float get_frametime() const { if ( frametime <= 0.f ) return 0.0001f; return frametime; } 28 | int get_tickcount() const { return tickcount; } 29 | float get_ipt() const { return interval_per_tick; } 30 | }; -------------------------------------------------------------------------------- /internal_hvh/sdk/interfaces/IInput.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | typedef unsigned int CRC32_t; 4 | class IInput 5 | { 6 | private: 7 | uint8_t pad[ 0xA9 ]; 8 | public: 9 | bool m_fCameraInThirdPerson; //0x9D 10 | bool m_fCameraMovingWithMouse; //0x9E 11 | Vector m_vecCameraOffset; //0xA0 12 | bool m_fCameraDistanceMove; //0xAC 13 | int m_nCameraOldX; //0xB0 14 | int m_nCameraOldY; //0xB4 15 | int m_nCameraX; //0xB8 16 | int m_nCameraY; //0xBC 17 | bool m_CameraIsOrthographic; //0xC0 18 | Vector m_angPreviousViewAngles; //0xC4 19 | Vector m_angPreviousViewAnglesTilt; //0xD0 20 | float m_flLastForwardMove; //0xDC 21 | int m_nClearInputState; //0xE0 22 | CUserCmd* m_pCommands; //0xEC 23 | CVerifiedUserCmd* m_pVerifiedCommands; //0xF0 24 | VFUNC( 8, GetUserCmd( int slot, int seq ), CUserCmd*( __thiscall* )( void*, int, int ) )( slot, seq ) 25 | CUserCmd* get_user_cmd_vfunc( int slot, int sequence_number ) 26 | { 27 | return util::get_vfunc< CUserCmd*( __thiscall* )( void*, int, int )>( this, 8 )( this, slot, sequence_number ); 28 | } 29 | }; 30 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | virtual void _vpad2() = 0; 9 | void UnknownFunc() 10 | { 11 | auto funcaddr = util::get_vfunc( this, 4 ); 12 | auto thisptr = reinterpret_cast< DWORD >( this ); 13 | _asm 14 | { 15 | mov ecx, thisptr 16 | mov eax, [ ecx ] 17 | call funcaddr 18 | } 19 | } 20 | 21 | bool m_bFirstRunOfFunctions : 1; 22 | bool m_bGameCodeMovedPlayer : 1; 23 | int m_nPlayerHandle; // edict index on server, client entity handle on client= 24 | int m_nImpulseCommand; // Impulse command issued. 25 | QAngle m_vecViewAngles; // Command view angles (local space) 26 | QAngle m_vecAbsViewAngles; // Command view angles (world space) 27 | int m_nButtons; // Attack buttons. 28 | int m_nOldButtons; // From host_client->oldbuttons; 29 | float m_flForwardMove; 30 | float m_flSideMove; 31 | float m_flUpMove; 32 | float m_flMaxSpeed; 33 | float m_flClientMaxSpeed; 34 | Vector m_vecVelocity; // edict::velocity // Current movement direction. 35 | QAngle m_vecAngles; // edict::angles 36 | QAngle m_vecOldAngles; 37 | float m_outStepHeight; // how much you climbed this move 38 | Vector m_outWishVel; // This is where you tried 39 | Vector m_outJumpVel; // This is your jump velocity 40 | Vector m_vecConstraintCenter; 41 | float m_flConstraintRadius; 42 | float m_flConstraintWidth; 43 | float m_flConstraintSpeedFactor; 44 | float m_flUnknown[ 5 ]; 45 | Vector m_vecAbsOrigin; 46 | }; -------------------------------------------------------------------------------- /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 void _pad01() = 0; 66 | virtual int ParseSurfaceData( const char *pFilename, const char *pTextfile ) = 0; 67 | virtual int SurfacePropCount( void ) const = 0; 68 | virtual short GetSurfaceIndex( const char *pSurfacePropName ) const = 0; 69 | virtual void GetPhysicsProperties( int surfaceDataIndex, float *density, float *thickness, float *friction, float *elasticity ) const = 0; 70 | virtual surfacedata_t *GetSurfaceData( int surfaceDataIndex ) = 0; 71 | virtual const char *GetString( unsigned short stringTableIndex ) const = 0; 72 | virtual const char *GetPropName( int surfaceDataIndex ) const = 0; 73 | virtual void SetWorldMaterialIndexTable( int *pMapArray, int mapSize ) = 0; 74 | virtual void GetPhysicsParameters( int surfaceDataIndex, surfacephysicsparams_t *pParamsOut ) const = 0; 75 | }; 76 | -------------------------------------------------------------------------------- /internal_hvh/sdk/interfaces/IVEffects.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum emittype_t 4 | { 5 | emit_surface, // 90 degree spotlight 6 | emit_point, // simple point light source 7 | emit_spotlight, // spotlight with penumbra 8 | emit_skylight, // directional light with no falloff (surface must trace to SKY texture) 9 | emit_quakelight, // linear falloff, non-lambertian 10 | emit_skyambient, // spherical light source with no falloff (surface must trace to SKY texture) 11 | }; 12 | 13 | struct dworldlight_t 14 | { 15 | Vector origin; //0x0000 16 | Vector intensity; //0x000C 17 | Vector normal; //0x0018 18 | int cluster; //0x0024 19 | emittype_t type; //0x0028 20 | int style; //0x002C 21 | float stopdot; //0x0030 22 | float stopdot2; //0x0034 23 | float exponent; //0x0038 24 | float radius; //0x003C 25 | float constant_attn; //0x0040 26 | float linear_attn; //0x0044 27 | float quadratic_attn; //0x0048 28 | int flags; //0x004C 29 | int texinfo; //0x0050 30 | int owner; //0x0054 31 | char pad_0x0058[ 0xC ]; //0x0058 32 | }; 33 | 34 | class CHostState 35 | { 36 | public: 37 | char pad_0x0000[ 0xA8 ]; //0x0000 38 | int numworldlights; 39 | dworldlight_t *worldlights; 40 | 41 | }; //Size=0x00B0 42 | 43 | struct ColorRGBExp32 44 | { 45 | byte r, g, b; 46 | signed char exponent; 47 | }; 48 | 49 | struct dlight_t 50 | { 51 | int flags; 52 | Vector origin; 53 | float radius; 54 | ColorRGBExp32 color; 55 | float die; 56 | float decay; 57 | float minlight; 58 | int key; 59 | int style; 60 | Vector m_Direction; 61 | float m_InnerAngle; 62 | float m_OuterAngle; 63 | }; 64 | class IVEffects 65 | { 66 | public: 67 | VFUNC( 4, alloc_dlight( int key ), dlight_t*( __thiscall* )( void*, int ) )( key ) 68 | VFUNC( 5, alloc_elight( int key ), dlight_t*( __thiscall* )( void*, int ) )( key ) 69 | VFUNC( 8, get_elight( int key ), dlight_t*( __thiscall* )( void*, int ) )( key ) 70 | }; -------------------------------------------------------------------------------- /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 | }; -------------------------------------------------------------------------------- /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 | VFUNC( 13, GetViewSetup(), CViewSetup* const ( __thiscall* )( void* ) )( ) 35 | }; 36 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /internal_hvh/sdk/networkstringtable.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum ENetworkStringtableFlags 4 | { 5 | NSF_NONE = 0, 6 | NSF_DICTIONARY_ENABLED = ( 1 << 0 ), // Uses pre-calculated per map dictionaries to reduce bandwidth 7 | }; 8 | 9 | const unsigned short INVALID_STRING_INDEX = ( unsigned short ) -1; 10 | 11 | typedef int TABLEID; 12 | 13 | class INetworkStringTable 14 | { 15 | public: 16 | 17 | virtual ~INetworkStringTable( void ) {}; 18 | 19 | // Table Info 20 | virtual const char *GetTableName( void ) const = 0; 21 | virtual TABLEID GetTableId( void ) const = 0; 22 | virtual int GetNumStrings( void ) const = 0; 23 | virtual int GetMaxStrings( void ) const = 0; 24 | virtual int GetEntryBits( void ) const = 0; 25 | 26 | // Networking 27 | virtual void SetTick( int tick ) = 0; 28 | virtual bool ChangedSinceTick( int tick ) const = 0; 29 | 30 | // Accessors (length -1 means don't change user data if string already exits) 31 | virtual int AddString( bool bIsServer, const char *value, int length = -1, const void *userdata = 0 ) = 0; 32 | 33 | virtual const char *GetString( int stringNumber ) const = 0; 34 | virtual void SetStringUserData( int stringNumber, int length, const void *userdata ) = 0; 35 | virtual const void *GetStringUserData( int stringNumber, int *length ) const = 0; 36 | virtual int FindStringIndex( char const *string ) = 0; // returns INVALID_STRING_INDEX if not found 37 | 38 | // Callbacks 39 | virtual void SetStringChangedCallback( void *object, void* changeFunc ) = 0; 40 | }; 41 | 42 | 43 | class CNetworkStringTableContainer 44 | { 45 | public: 46 | virtual ~CNetworkStringTableContainer( void ) {}; 47 | // Implement INetworkStringTableContainer 48 | virtual INetworkStringTable *CreateStringTable( const char *tableName, int maxentries, int userdatafixedsize = 0, int userdatanetworkbits = 0, int flags = NSF_NONE ) const = 0; 49 | virtual void RemoveAllTables( void ) const = 0; 50 | 51 | // table infos 52 | virtual INetworkStringTable *FindTable( const char *tableName ) const = 0; 53 | virtual INetworkStringTable *GetTable( TABLEID stringTable ) const = 0; 54 | virtual int GetNumTables( void ) const = 0; 55 | 56 | bool m_bAllowCreation; // creat guard Guard 57 | int m_nTickCount; // current tick 58 | bool m_bLocked; // currently locked? 59 | bool m_bEnableRollback; // enables rollback feature 60 | 61 | CUtlVector < void* > m_Tables; 62 | }; -------------------------------------------------------------------------------- /internal_hvh/threadsafe_deque.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | template 4 | class msg_queue 5 | { 6 | public: 7 | // preventing implicit generation of move constructor 8 | ~msg_queue() {} 9 | 10 | void post( T&& msg ) 11 | { 12 | std::lock_guard lock( mtx ); 13 | queue.clear(); 14 | queue.push_front( std::move( msg ) ); 15 | } 16 | 17 | bool recv( T& msg ) 18 | { 19 | std::unique_lock lock( mtx ); 20 | if ( queue.empty() ) 21 | return false; 22 | 23 | msg = queue.back(); 24 | return true; 25 | } 26 | 27 | bool try_recv( T& msg ) 28 | { 29 | if ( !mtx.try_lock() ) 30 | return true; 31 | 32 | if ( queue.empty() ) 33 | { 34 | mtx.unlock(); 35 | msg = {}; 36 | return false; 37 | } 38 | 39 | msg = queue.back(); 40 | mtx.unlock(); 41 | return true; 42 | } 43 | 44 | unsigned int size() 45 | { 46 | std::lock_guard lock( mtx ); 47 | return queue.size(); 48 | } 49 | 50 | void clear() 51 | { 52 | std::lock_guard lock( mtx ); 53 | queue.clear(); 54 | } 55 | 56 | private: 57 | std::deque queue; 58 | std::mutex mtx; 59 | }; 60 | --------------------------------------------------------------------------------