├── .gitmodules ├── internal_hvh ├── features │ ├── thirdperson.h │ ├── autostrafer.h │ ├── shared_data.h │ ├── glow.h │ ├── knifebot.h │ ├── console_log.h │ ├── gamemovement.h │ ├── sound_esp.h │ ├── freestanding.h │ ├── lag_compensation.h │ ├── bone_setup.h │ ├── include_features.h │ ├── legit.h │ ├── flashlight.h │ ├── beams.h │ ├── hitmarker.h │ ├── misc.h │ ├── tickbase.h │ ├── playerperf.h │ ├── entity_rendering.h │ ├── shared_data.cpp │ ├── inventorychanger.h │ ├── player_log.h │ ├── antiaim.h │ ├── thirdperson.cpp │ ├── glow.cpp │ ├── mt.h │ ├── aimbot_helpers.h │ └── playerperf.cpp ├── misc │ ├── gzip │ │ ├── config.hpp │ │ ├── version.hpp │ │ └── utils.hpp │ ├── ipc.h │ ├── libMinHook-x86-v141-mt.lib │ ├── libMinHook-x86-v141-mtd.lib │ ├── networking │ │ ├── src │ │ │ └── crypto │ │ │ │ ├── helpers.h │ │ │ │ ├── ssl_context.h │ │ │ │ ├── ssl.h │ │ │ │ ├── ssl_context.cpp │ │ │ │ └── helpers.cpp │ │ ├── include │ │ │ └── session.h │ │ └── net_offsets.h │ ├── init.h │ ├── listeners.h │ ├── renderer │ │ ├── include │ │ │ └── ren │ │ │ │ ├── vertex.h │ │ │ │ ├── command.h │ │ │ │ ├── texture.h │ │ │ │ ├── adapter_gl2.h │ │ │ │ ├── adapter_dx11.h │ │ │ │ └── bitfont.h │ │ └── src │ │ │ ├── command.cpp │ │ │ ├── renderer.cpp │ │ │ └── texture.cpp │ ├── input.h │ ├── listeners.cpp │ ├── StackTracer.h │ ├── profiler.h │ ├── globals.h │ └── d3dfont.h ├── lua_new │ ├── compile │ │ ├── src │ │ │ ├── buildvm.exp │ │ │ ├── buildvm.lib │ │ │ ├── lua51.exp │ │ │ ├── lua51.lib │ │ │ ├── luajit.exp │ │ │ ├── luajit.lib │ │ │ ├── minilua.exp │ │ │ ├── minilua.lib │ │ │ ├── lua.hpp │ │ │ ├── host │ │ │ │ └── README │ │ │ ├── lj_bc.c │ │ │ ├── lj_udata.h │ │ │ ├── lj_alloc.h │ │ │ ├── lj_asm.h │ │ │ ├── lj_ff.h │ │ │ ├── lj_parse.h │ │ │ ├── lj_profile.h │ │ │ ├── lj_gdbjit.h │ │ │ ├── jit │ │ │ │ ├── dis_arm64be.lua │ │ │ │ ├── dis_mips64.lua │ │ │ │ ├── dis_x64.lua │ │ │ │ ├── dis_mipsel.lua │ │ │ │ ├── dis_mips64el.lua │ │ │ │ └── zone.lua │ │ │ ├── lj_ccallback.h │ │ │ ├── lj_ffrecord.h │ │ │ ├── lj.supp │ │ │ ├── lj_mcode.h │ │ │ ├── lj_str.h │ │ │ ├── lj_clib.h │ │ │ ├── lj_func.h │ │ │ ├── lj_udata.c │ │ │ ├── lj_snap.h │ │ │ ├── lj_strscan.h │ │ │ ├── lj_state.h │ │ │ ├── lj_carith.h │ │ │ ├── lualib.h │ │ │ ├── lj_obj.c │ │ │ ├── lib_init.c │ │ │ ├── lj_char.h │ │ │ ├── lj_err.h │ │ │ ├── lj_meta.h │ │ │ ├── lj_vmevent.c │ │ │ ├── lj_vmevent.h │ │ │ ├── lj_record.h │ │ │ ├── lj_trace.h │ │ │ ├── lj_crecord.h │ │ │ ├── lj_char.c │ │ │ ├── lj_debug.h │ │ │ ├── lj_bcdump.h │ │ │ ├── lj_cconv.h │ │ │ ├── lj_traceerr.h │ │ │ └── lj_opt_dce.c │ │ ├── dynasm │ │ │ ├── dasm_x64.lua │ │ │ ├── dasm_mips64.lua │ │ │ └── dasm_proto.h │ │ └── etc │ │ │ └── luajit.pc │ └── lua │ │ ├── api │ │ ├── input.cpp │ │ └── database.cpp │ │ └── runtime_state.cpp ├── sdk │ ├── CBoneChache.h │ ├── interfaces │ │ ├── IVPanel.h │ │ ├── CHud.h │ │ ├── IWeaponSystem.h │ │ ├── IMemAlloc.h │ │ ├── IClientModeShared.h │ │ ├── CSPlayerResource.h │ │ ├── IBaseClientDll.h │ │ ├── IGlobalVarsBase.h │ │ ├── IViewRender.h │ │ ├── IInput.h │ │ ├── IMoveHelper.h │ │ ├── IVEffects.h │ │ ├── CGlowObjectManager.h │ │ ├── ICVar.h │ │ ├── IBaseFileSystem.h │ │ └── ILocalize.h │ ├── datatypes │ │ ├── Vector.cpp │ │ ├── include_datatypes.h │ │ ├── VMatrix.h │ │ └── Vector4D.h │ ├── IRefCounted.h │ ├── ClientClass.h │ ├── CCSGameRulesProxy.h │ ├── checksum_md5.h │ ├── include_sdk.h │ ├── IMaterialVar.h │ ├── ConVar.h │ └── networkstringtable.h ├── menu │ ├── elements │ │ ├── glitch_text.h │ │ ├── weapon_tab.h │ │ ├── pad.h │ │ ├── hue_slider.h │ │ ├── checkbox.h │ │ ├── alpha_slider.h │ │ ├── text_box.h │ │ ├── button.h │ │ ├── slider.h │ │ ├── window.h │ │ ├── glitch_text.cpp │ │ ├── child.h │ │ ├── tab.h │ │ ├── sub_controls │ │ │ └── key_bind.h │ │ ├── sub_tab.h │ │ └── combobox.h │ ├── menu_include.h │ └── effects.h ├── hooks │ ├── level_shutdown.cpp │ ├── is_box_visible.cpp │ ├── is_connected.cpp │ ├── reset.cpp │ ├── do_post_screen_space_effects.cpp │ ├── lua.cpp │ ├── find_material.cpp │ ├── paint_traverse.cpp │ ├── process_input.cpp │ ├── estimate_abs_velocity.cpp │ ├── render_view.cpp │ ├── override_view.cpp │ ├── misc.cpp │ ├── packet_start.cpp │ ├── wnd_proc.cpp │ └── present.cpp ├── include_cheat.h ├── threadsafe_deque.h └── DLLMain.cpp ├── README.md ├── CMakeLists.txt └── internal_hvh.sln /.gitmodules: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /internal_hvh/features/thirdperson.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace thirdperson 4 | { 5 | void run(); 6 | }; -------------------------------------------------------------------------------- /internal_hvh/misc/gzip/config.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef ZLIB_CONST 4 | #define ZLIB_CONST 5 | #endif -------------------------------------------------------------------------------- /internal_hvh/misc/ipc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace ipc 7 | { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # fatality source code 2 | you prob need to fix it 3 | # fixing 4 | [#1](https://github.com/BulletGG/fatality-source-code/issues/1) 5 | -------------------------------------------------------------------------------- /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/lua_new/compile/src/buildvm.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BulletGG/fatality-source-code/HEAD/internal_hvh/lua_new/compile/src/buildvm.exp -------------------------------------------------------------------------------- /internal_hvh/lua_new/compile/src/buildvm.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BulletGG/fatality-source-code/HEAD/internal_hvh/lua_new/compile/src/buildvm.lib -------------------------------------------------------------------------------- /internal_hvh/lua_new/compile/src/lua51.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BulletGG/fatality-source-code/HEAD/internal_hvh/lua_new/compile/src/lua51.exp -------------------------------------------------------------------------------- /internal_hvh/lua_new/compile/src/lua51.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BulletGG/fatality-source-code/HEAD/internal_hvh/lua_new/compile/src/lua51.lib -------------------------------------------------------------------------------- /internal_hvh/lua_new/compile/src/luajit.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BulletGG/fatality-source-code/HEAD/internal_hvh/lua_new/compile/src/luajit.exp -------------------------------------------------------------------------------- /internal_hvh/lua_new/compile/src/luajit.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BulletGG/fatality-source-code/HEAD/internal_hvh/lua_new/compile/src/luajit.lib -------------------------------------------------------------------------------- /internal_hvh/lua_new/compile/src/minilua.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BulletGG/fatality-source-code/HEAD/internal_hvh/lua_new/compile/src/minilua.exp -------------------------------------------------------------------------------- /internal_hvh/lua_new/compile/src/minilua.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BulletGG/fatality-source-code/HEAD/internal_hvh/lua_new/compile/src/minilua.lib -------------------------------------------------------------------------------- /internal_hvh/misc/libMinHook-x86-v141-mt.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BulletGG/fatality-source-code/HEAD/internal_hvh/misc/libMinHook-x86-v141-mt.lib -------------------------------------------------------------------------------- /internal_hvh/misc/libMinHook-x86-v141-mtd.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BulletGG/fatality-source-code/HEAD/internal_hvh/misc/libMinHook-x86-v141-mtd.lib -------------------------------------------------------------------------------- /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/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/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/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/lua_new/compile/src/lua.hpp: -------------------------------------------------------------------------------- 1 | // C++ wrapper for LuaJIT header files. 2 | 3 | extern "C" { 4 | #include "lua.h" 5 | #include "lauxlib.h" 6 | #include "lualib.h" 7 | #include "luajit.h" 8 | } 9 | 10 | -------------------------------------------------------------------------------- /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/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/lua_new/compile/src/host/README: -------------------------------------------------------------------------------- 1 | The files in this directory are only used during the build process of LuaJIT. 2 | For cross-compilation, they must be executed on the host, not on the target. 3 | 4 | These files should NOT be installed! 5 | -------------------------------------------------------------------------------- /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/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/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/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/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/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/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/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/lua_new/compile/src/lj_bc.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** Bytecode instruction modes. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #define lj_bc_c 7 | #define LUA_CORE 8 | 9 | #include "lj_obj.h" 10 | #include "lj_bc.h" 11 | 12 | /* Bytecode offsets and bytecode instruction modes. */ 13 | #include "lj_bcdef.h" 14 | 15 | -------------------------------------------------------------------------------- /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/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/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/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/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/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/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/lua_new/compile/src/lj_udata.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Userdata handling. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_UDATA_H 7 | #define _LJ_UDATA_H 8 | 9 | #include "lj_obj.h" 10 | 11 | LJ_FUNC GCudata *lj_udata_new(lua_State *L, MSize sz, GCtab *env); 12 | LJ_FUNC void LJ_FASTCALL lj_udata_free(global_State *g, GCudata *ud); 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /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/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/lua_new/compile/src/lj_alloc.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Bundled memory allocator. 3 | ** Donated to the public domain. 4 | */ 5 | 6 | #ifndef _LJ_ALLOC_H 7 | #define _LJ_ALLOC_H 8 | 9 | #include "lj_def.h" 10 | 11 | #ifndef LUAJIT_USE_SYSMALLOC 12 | LJ_FUNC void *lj_alloc_create(void); 13 | LJ_FUNC void lj_alloc_destroy(void *msp); 14 | LJ_FUNC void *lj_alloc_f(void *msp, void *ptr, size_t osize, size_t nsize); 15 | #endif 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /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/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/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/lua_new/compile/src/lj_asm.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** IR assembler (SSA IR -> machine code). 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_ASM_H 7 | #define _LJ_ASM_H 8 | 9 | #include "lj_jit.h" 10 | 11 | #if LJ_HASJIT 12 | LJ_FUNC void lj_asm_trace(jit_State *J, GCtrace *T); 13 | LJ_FUNC void lj_asm_patchexit(jit_State *J, GCtrace *T, ExitNo exitno, 14 | MCode *target); 15 | #endif 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /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/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/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/lua_new/compile/src/lj_ff.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Fast function IDs. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_FF_H 7 | #define _LJ_FF_H 8 | 9 | /* Fast function ID. */ 10 | typedef enum { 11 | FF_LUA_ = FF_LUA, /* Lua function (must be 0). */ 12 | FF_C_ = FF_C, /* Regular C function (must be 1). */ 13 | #define FFDEF(name) FF_##name, 14 | #include "lj_ffdef.h" 15 | FF__MAX 16 | } FastFunc; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /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/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/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/lua_new/compile/src/lj_parse.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Lua parser (source code -> bytecode). 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_PARSE_H 7 | #define _LJ_PARSE_H 8 | 9 | #include "lj_obj.h" 10 | #include "lj_lex.h" 11 | 12 | LJ_FUNC GCproto *lj_parse(LexState *ls); 13 | LJ_FUNC GCstr *lj_parse_keepstr(LexState *ls, const char *str, size_t l); 14 | #if LJ_HASFFI 15 | LJ_FUNC void lj_parse_keepcdata(LexState *ls, TValue *tv, GCcdata *cd); 16 | #endif 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /internal_hvh/lua_new/compile/src/lj_profile.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Low-overhead profiling. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_PROFILE_H 7 | #define _LJ_PROFILE_H 8 | 9 | #include "lj_obj.h" 10 | 11 | #if LJ_HASPROFILE 12 | 13 | LJ_FUNC void LJ_FASTCALL lj_profile_interpreter(lua_State *L); 14 | #if !LJ_PROFILE_SIGPROF 15 | LJ_FUNC void LJ_FASTCALL lj_profile_hook_enter(global_State *g); 16 | LJ_FUNC void LJ_FASTCALL lj_profile_hook_leave(global_State *g); 17 | #endif 18 | 19 | #endif 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /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/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/lua_new/compile/src/lj_gdbjit.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Client for the GDB JIT API. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_GDBJIT_H 7 | #define _LJ_GDBJIT_H 8 | 9 | #include "lj_obj.h" 10 | #include "lj_jit.h" 11 | 12 | #if LJ_HASJIT && defined(LUAJIT_USE_GDBJIT) 13 | 14 | LJ_FUNC void lj_gdbjit_addtrace(jit_State *J, GCtrace *T); 15 | LJ_FUNC void lj_gdbjit_deltrace(jit_State *J, GCtrace *T); 16 | 17 | #else 18 | #define lj_gdbjit_addtrace(J, T) UNUSED(T) 19 | #define lj_gdbjit_deltrace(J, T) UNUSED(T) 20 | #endif 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /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/lua_new/compile/dynasm/dasm_x64.lua: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- DynASM x64 module. 3 | -- 4 | -- Copyright (C) 2005-2017 Mike Pall. All rights reserved. 5 | -- See dynasm.lua for full copyright notice. 6 | ------------------------------------------------------------------------------ 7 | -- This module just sets 64 bit mode for the combined x86/x64 module. 8 | -- All the interesting stuff is there. 9 | ------------------------------------------------------------------------------ 10 | 11 | x64 = true -- Using a global is an ugly, but effective solution. 12 | return require("dasm_x86") 13 | -------------------------------------------------------------------------------- /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/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/lua_new/compile/dynasm/dasm_mips64.lua: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- DynASM MIPS64 module. 3 | -- 4 | -- Copyright (C) 2005-2017 Mike Pall. All rights reserved. 5 | -- See dynasm.lua for full copyright notice. 6 | ------------------------------------------------------------------------------ 7 | -- This module just sets 64 bit mode for the combined MIPS/MIPS64 module. 8 | -- All the interesting stuff is there. 9 | ------------------------------------------------------------------------------ 10 | 11 | mips64 = true -- Using a global is an ugly, but effective solution. 12 | return require("dasm_mips") 13 | -------------------------------------------------------------------------------- /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/lua_new/compile/src/jit/dis_arm64be.lua: -------------------------------------------------------------------------------- 1 | ---------------------------------------------------------------------------- 2 | -- LuaJIT ARM64BE disassembler wrapper module. 3 | -- 4 | -- Copyright (C) 2005-2017 Mike Pall. All rights reserved. 5 | -- Released under the MIT license. See Copyright Notice in luajit.h 6 | ---------------------------------------------------------------------------- 7 | -- ARM64 instructions are always little-endian. So just forward to the 8 | -- common ARM64 disassembler module. All the interesting stuff is there. 9 | ------------------------------------------------------------------------------ 10 | 11 | return require((string.match(..., ".*%.") or "").."dis_arm64") 12 | 13 | -------------------------------------------------------------------------------- /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/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/lua_new/compile/etc/luajit.pc: -------------------------------------------------------------------------------- 1 | # Package information for LuaJIT to be used by pkg-config. 2 | majver=2 3 | minver=1 4 | relver=0 5 | version=${majver}.${minver}.${relver}-beta3 6 | abiver=5.1 7 | 8 | prefix=/usr/local 9 | multilib=lib 10 | exec_prefix=${prefix} 11 | libdir=${exec_prefix}/${multilib} 12 | libname=luajit-${abiver} 13 | includedir=${prefix}/include/luajit-${majver}.${minver} 14 | 15 | INSTALL_LMOD=${prefix}/share/lua/${abiver} 16 | INSTALL_CMOD=${prefix}/${multilib}/lua/${abiver} 17 | 18 | Name: LuaJIT 19 | Description: Just-in-time compiler for Lua 20 | URL: http://luajit.org 21 | Version: ${version} 22 | Requires: 23 | Libs: -L${libdir} -l${libname} 24 | Libs.private: -Wl,-E -lm -ldl 25 | Cflags: -I${includedir} 26 | -------------------------------------------------------------------------------- /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/lua_new/lua/api/input.cpp: -------------------------------------------------------------------------------- 1 | #include "../include_cheat.h" 2 | 3 | int lua::api_def::input::is_key_down( lua_State* l ) 4 | { 5 | runtime_state s( l ); 6 | 7 | const auto r = s.check_arguments( { 8 | { ltd::number } 9 | } ); 10 | 11 | if ( !r ) 12 | { 13 | s.error( XOR_STR( "usage: is_key_down(key)" ) ); 14 | return 0; 15 | } 16 | 17 | s.push( g_input->get_key( s.get_integer( 1 ) ).pressed || g_input->get_key( s.get_integer( 1 ) ).held ); 18 | return 1; 19 | } 20 | 21 | int lua::api_def::input::get_cursor_pos( lua_State* l ) 22 | { 23 | runtime_state s( l ); 24 | 25 | const auto pos = g_input->get_mouse().pos; 26 | s.push( static_cast< int >( pos.x ) ); 27 | s.push( static_cast< int >( pos.y ) ); 28 | 29 | return 2; 30 | } -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.15.0 FATAL_ERROR) 2 | 3 | set(CMAKE_SYSTEM_VERSION 10.0 CACHE STRING "" FORCE) 4 | 5 | project(internal_hvh CXX) 6 | 7 | set(CMAKE_VS_PLATFORM_NAME "x86") 8 | 9 | ################################################################################ 10 | # Global configuration types 11 | ################################################################################ 12 | set(CMAKE_CONFIGURATION_TYPES 13 | "Debug" 14 | "Release" 15 | "RelWithDebInfo" 16 | CACHE STRING "" FORCE 17 | ) 18 | 19 | ################################################################################ 20 | # Sub-projects 21 | ################################################################################ 22 | add_subdirectory(internal_hvh) 23 | -------------------------------------------------------------------------------- /internal_hvh/lua_new/compile/src/lj_ccallback.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** FFI C callback handling. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_CCALLBACK_H 7 | #define _LJ_CCALLBACK_H 8 | 9 | #include "lj_obj.h" 10 | #include "lj_ctype.h" 11 | 12 | #if LJ_HASFFI 13 | 14 | /* Really belongs to lj_vm.h. */ 15 | LJ_ASMF void lj_vm_ffi_callback(void); 16 | 17 | LJ_FUNC MSize lj_ccallback_ptr2slot(CTState *cts, void *p); 18 | LJ_FUNCA lua_State * LJ_FASTCALL lj_ccallback_enter(CTState *cts, void *cf); 19 | LJ_FUNCA void LJ_FASTCALL lj_ccallback_leave(CTState *cts, TValue *o); 20 | LJ_FUNC void *lj_ccallback_new(CTState *cts, CType *ct, GCfunc *fn); 21 | LJ_FUNC void lj_ccallback_mcode_free(CTState *cts); 22 | 23 | #endif 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /internal_hvh/lua_new/compile/src/lj_ffrecord.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Fast function call recorder. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_FFRECORD_H 7 | #define _LJ_FFRECORD_H 8 | 9 | #include "lj_obj.h" 10 | #include "lj_jit.h" 11 | 12 | #if LJ_HASJIT 13 | /* Data used by handlers to record a fast function. */ 14 | typedef struct RecordFFData { 15 | TValue *argv; /* Runtime argument values. */ 16 | ptrdiff_t nres; /* Number of returned results (defaults to 1). */ 17 | uint32_t data; /* Per-ffid auxiliary data (opcode, literal etc.). */ 18 | } RecordFFData; 19 | 20 | LJ_FUNC int32_t lj_ffrecord_select_mode(jit_State *J, TRef tr, TValue *tv); 21 | LJ_FUNC void lj_ffrecord_func(jit_State *J); 22 | #endif 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /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/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/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/lua_new/compile/src/lj.supp: -------------------------------------------------------------------------------- 1 | # Valgrind suppression file for LuaJIT 2.0. 2 | { 3 | Optimized string compare 4 | Memcheck:Addr4 5 | fun:lj_str_cmp 6 | } 7 | { 8 | Optimized string compare 9 | Memcheck:Addr1 10 | fun:lj_str_cmp 11 | } 12 | { 13 | Optimized string compare 14 | Memcheck:Addr4 15 | fun:lj_str_new 16 | } 17 | { 18 | Optimized string compare 19 | Memcheck:Addr1 20 | fun:lj_str_new 21 | } 22 | { 23 | Optimized string compare 24 | Memcheck:Cond 25 | fun:lj_str_new 26 | } 27 | { 28 | Optimized string compare 29 | Memcheck:Addr4 30 | fun:str_fastcmp 31 | } 32 | { 33 | Optimized string compare 34 | Memcheck:Addr1 35 | fun:str_fastcmp 36 | } 37 | { 38 | Optimized string compare 39 | Memcheck:Cond 40 | fun:str_fastcmp 41 | } 42 | -------------------------------------------------------------------------------- /internal_hvh/lua_new/compile/src/jit/dis_mips64.lua: -------------------------------------------------------------------------------- 1 | ---------------------------------------------------------------------------- 2 | -- LuaJIT MIPS64 disassembler wrapper module. 3 | -- 4 | -- Copyright (C) 2005-2017 Mike Pall. All rights reserved. 5 | -- Released under the MIT license. See Copyright Notice in luajit.h 6 | ---------------------------------------------------------------------------- 7 | -- This module just exports the big-endian functions from the 8 | -- MIPS disassembler module. All the interesting stuff is there. 9 | ------------------------------------------------------------------------------ 10 | 11 | local dis_mips = require((string.match(..., ".*%.") or "").."dis_mips") 12 | return { 13 | create = dis_mips.create, 14 | disass = dis_mips.disass, 15 | regname = dis_mips.regname 16 | } 17 | 18 | -------------------------------------------------------------------------------- /internal_hvh/lua_new/compile/src/jit/dis_x64.lua: -------------------------------------------------------------------------------- 1 | ---------------------------------------------------------------------------- 2 | -- LuaJIT x64 disassembler wrapper module. 3 | -- 4 | -- Copyright (C) 2005-2017 Mike Pall. All rights reserved. 5 | -- Released under the MIT license. See Copyright Notice in luajit.h 6 | ---------------------------------------------------------------------------- 7 | -- This module just exports the 64 bit functions from the combined 8 | -- x86/x64 disassembler module. All the interesting stuff is there. 9 | ------------------------------------------------------------------------------ 10 | 11 | local dis_x86 = require((string.match(..., ".*%.") or "").."dis_x86") 12 | return { 13 | create = dis_x86.create64, 14 | disass = dis_x86.disass64, 15 | regname = dis_x86.regname64 16 | } 17 | 18 | -------------------------------------------------------------------------------- /internal_hvh/lua_new/compile/src/jit/dis_mipsel.lua: -------------------------------------------------------------------------------- 1 | ---------------------------------------------------------------------------- 2 | -- LuaJIT MIPSEL disassembler wrapper module. 3 | -- 4 | -- Copyright (C) 2005-2017 Mike Pall. All rights reserved. 5 | -- Released under the MIT license. See Copyright Notice in luajit.h 6 | ---------------------------------------------------------------------------- 7 | -- This module just exports the little-endian functions from the 8 | -- MIPS disassembler module. All the interesting stuff is there. 9 | ------------------------------------------------------------------------------ 10 | 11 | local dis_mips = require((string.match(..., ".*%.") or "").."dis_mips") 12 | return { 13 | create = dis_mips.create_el, 14 | disass = dis_mips.disass_el, 15 | regname = dis_mips.regname 16 | } 17 | 18 | -------------------------------------------------------------------------------- /internal_hvh/lua_new/compile/src/jit/dis_mips64el.lua: -------------------------------------------------------------------------------- 1 | ---------------------------------------------------------------------------- 2 | -- LuaJIT MIPS64EL disassembler wrapper module. 3 | -- 4 | -- Copyright (C) 2005-2017 Mike Pall. All rights reserved. 5 | -- Released under the MIT license. See Copyright Notice in luajit.h 6 | ---------------------------------------------------------------------------- 7 | -- This module just exports the little-endian functions from the 8 | -- MIPS disassembler module. All the interesting stuff is there. 9 | ------------------------------------------------------------------------------ 10 | 11 | local dis_mips = require((string.match(..., ".*%.") or "").."dis_mips") 12 | return { 13 | create = dis_mips.create_el, 14 | disass = dis_mips.disass_el, 15 | regname = dis_mips.regname 16 | } 17 | 18 | -------------------------------------------------------------------------------- /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/lua_new/compile/src/lj_mcode.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Machine code management. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_MCODE_H 7 | #define _LJ_MCODE_H 8 | 9 | #include "lj_obj.h" 10 | 11 | #if LJ_HASJIT || LJ_HASFFI 12 | LJ_FUNC void lj_mcode_sync(void *start, void *end); 13 | #endif 14 | 15 | #if LJ_HASJIT 16 | 17 | #include "lj_jit.h" 18 | 19 | LJ_FUNC void lj_mcode_free(jit_State *J); 20 | LJ_FUNC MCode *lj_mcode_reserve(jit_State *J, MCode **lim); 21 | LJ_FUNC void lj_mcode_commit(jit_State *J, MCode *m); 22 | LJ_FUNC void lj_mcode_abort(jit_State *J); 23 | LJ_FUNC MCode *lj_mcode_patch(jit_State *J, MCode *ptr, int finish); 24 | LJ_FUNC_NORET void lj_mcode_limiterr(jit_State *J, size_t need); 25 | 26 | #define lj_mcode_commitbot(J, m) (J->mcbot = (m)) 27 | 28 | #endif 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /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/lua_new/compile/src/lj_str.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** String handling. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_STR_H 7 | #define _LJ_STR_H 8 | 9 | #include 10 | 11 | #include "lj_obj.h" 12 | 13 | /* String helpers. */ 14 | LJ_FUNC int32_t LJ_FASTCALL lj_str_cmp(GCstr *a, GCstr *b); 15 | LJ_FUNC const char *lj_str_find(const char *s, const char *f, 16 | MSize slen, MSize flen); 17 | LJ_FUNC int lj_str_haspattern(GCstr *s); 18 | 19 | /* String interning. */ 20 | LJ_FUNC void lj_str_resize(lua_State *L, MSize newmask); 21 | LJ_FUNCA GCstr *lj_str_new(lua_State *L, const char *str, size_t len); 22 | LJ_FUNC void LJ_FASTCALL lj_str_free(global_State *g, GCstr *s); 23 | 24 | #define lj_str_newz(L, s) (lj_str_new(L, s, strlen(s))) 25 | #define lj_str_newlit(L, s) (lj_str_new(L, "" s, sizeof(s)-1)) 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /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/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/lua_new/compile/src/lj_clib.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** FFI C library loader. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_CLIB_H 7 | #define _LJ_CLIB_H 8 | 9 | #include "lj_obj.h" 10 | 11 | #if LJ_HASFFI 12 | 13 | /* Namespace for C library indexing. */ 14 | #define CLNS_INDEX ((1u<env. */ 20 | } CLibrary; 21 | 22 | LJ_FUNC TValue *lj_clib_index(lua_State *L, CLibrary *cl, GCstr *name); 23 | LJ_FUNC void lj_clib_load(lua_State *L, GCtab *mt, GCstr *name, int global); 24 | LJ_FUNC void lj_clib_unload(CLibrary *cl); 25 | LJ_FUNC void lj_clib_default(lua_State *L, GCtab *mt); 26 | 27 | #endif 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /internal_hvh/lua_new/compile/src/lj_func.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Function handling (prototypes, functions and upvalues). 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_FUNC_H 7 | #define _LJ_FUNC_H 8 | 9 | #include "lj_obj.h" 10 | 11 | /* Prototypes. */ 12 | LJ_FUNC void LJ_FASTCALL lj_func_freeproto(global_State *g, GCproto *pt); 13 | 14 | /* Upvalues. */ 15 | LJ_FUNCA void LJ_FASTCALL lj_func_closeuv(lua_State *L, TValue *level); 16 | LJ_FUNC void LJ_FASTCALL lj_func_freeuv(global_State *g, GCupval *uv); 17 | 18 | /* Functions (closures). */ 19 | LJ_FUNC GCfunc *lj_func_newC(lua_State *L, MSize nelems, GCtab *env); 20 | LJ_FUNC GCfunc *lj_func_newL_empty(lua_State *L, GCproto *pt, GCtab *env); 21 | LJ_FUNCA GCfunc *lj_func_newL_gc(lua_State *L, GCproto *pt, GCfuncL *parent); 22 | LJ_FUNC void LJ_FASTCALL lj_func_free(global_State *g, GCfunc *c); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /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/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/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/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/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/lua_new/compile/src/lj_udata.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** Userdata handling. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #define lj_udata_c 7 | #define LUA_CORE 8 | 9 | #include "lj_obj.h" 10 | #include "lj_gc.h" 11 | #include "lj_udata.h" 12 | 13 | GCudata *lj_udata_new(lua_State *L, MSize sz, GCtab *env) 14 | { 15 | GCudata *ud = lj_mem_newt(L, sizeof(GCudata) + sz, GCudata); 16 | global_State *g = G(L); 17 | newwhite(g, ud); /* Not finalized. */ 18 | ud->gct = ~LJ_TUDATA; 19 | ud->udtype = UDTYPE_USERDATA; 20 | ud->len = sz; 21 | /* NOBARRIER: The GCudata is new (marked white). */ 22 | setgcrefnull(ud->metatable); 23 | setgcref(ud->env, obj2gco(env)); 24 | /* Chain to userdata list (after main thread). */ 25 | setgcrefr(ud->nextgc, mainthread(g)->nextgc); 26 | setgcref(mainthread(g)->nextgc, obj2gco(ud)); 27 | return ud; 28 | } 29 | 30 | void LJ_FASTCALL lj_udata_free(global_State *g, GCudata *ud) 31 | { 32 | lj_mem_free(g, ud, sizeudata(ud)); 33 | } 34 | 35 | -------------------------------------------------------------------------------- /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/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/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/lua_new/compile/src/lj_snap.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Snapshot handling. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_SNAP_H 7 | #define _LJ_SNAP_H 8 | 9 | #include "lj_obj.h" 10 | #include "lj_jit.h" 11 | 12 | #if LJ_HASJIT 13 | LJ_FUNC void lj_snap_add(jit_State *J); 14 | LJ_FUNC void lj_snap_purge(jit_State *J); 15 | LJ_FUNC void lj_snap_shrink(jit_State *J); 16 | LJ_FUNC IRIns *lj_snap_regspmap(GCtrace *T, SnapNo snapno, IRIns *ir); 17 | LJ_FUNC void lj_snap_replay(jit_State *J, GCtrace *T); 18 | LJ_FUNC const BCIns *lj_snap_restore(jit_State *J, void *exptr); 19 | LJ_FUNC void lj_snap_grow_buf_(jit_State *J, MSize need); 20 | LJ_FUNC void lj_snap_grow_map_(jit_State *J, MSize need); 21 | 22 | static LJ_AINLINE void lj_snap_grow_buf(jit_State *J, MSize need) 23 | { 24 | if (LJ_UNLIKELY(need > J->sizesnap)) lj_snap_grow_buf_(J, need); 25 | } 26 | 27 | static LJ_AINLINE void lj_snap_grow_map(jit_State *J, MSize need) 28 | { 29 | if (LJ_UNLIKELY(need > J->sizesnapmap)) lj_snap_grow_map_(J, need); 30 | } 31 | 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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/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/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/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/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/lua_new/compile/src/jit/zone.lua: -------------------------------------------------------------------------------- 1 | ---------------------------------------------------------------------------- 2 | -- LuaJIT profiler zones. 3 | -- 4 | -- Copyright (C) 2005-2017 Mike Pall. All rights reserved. 5 | -- Released under the MIT license. See Copyright Notice in luajit.h 6 | ---------------------------------------------------------------------------- 7 | -- 8 | -- This module implements a simple hierarchical zone model. 9 | -- 10 | -- Example usage: 11 | -- 12 | -- local zone = require("jit.zone") 13 | -- zone("AI") 14 | -- ... 15 | -- zone("A*") 16 | -- ... 17 | -- print(zone:get()) --> "A*" 18 | -- ... 19 | -- zone() 20 | -- ... 21 | -- print(zone:get()) --> "AI" 22 | -- ... 23 | -- zone() 24 | -- 25 | ---------------------------------------------------------------------------- 26 | 27 | local remove = table.remove 28 | 29 | return setmetatable({ 30 | flush = function(t) 31 | for i=#t,1,-1 do t[i] = nil end 32 | end, 33 | get = function(t) 34 | return t[#t] 35 | end 36 | }, { 37 | __call = function(t, zone) 38 | if zone then 39 | t[#t+1] = zone 40 | else 41 | return (assert(remove(t), "empty zone stack")) 42 | end 43 | end 44 | }) 45 | 46 | -------------------------------------------------------------------------------- /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/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/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/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/lua_new/compile/src/lj_strscan.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** String scanning. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_STRSCAN_H 7 | #define _LJ_STRSCAN_H 8 | 9 | #include "lj_obj.h" 10 | 11 | /* Options for accepted/returned formats. */ 12 | #define STRSCAN_OPT_TOINT 0x01 /* Convert to int32_t, if possible. */ 13 | #define STRSCAN_OPT_TONUM 0x02 /* Always convert to double. */ 14 | #define STRSCAN_OPT_IMAG 0x04 15 | #define STRSCAN_OPT_LL 0x08 16 | #define STRSCAN_OPT_C 0x10 17 | 18 | /* Returned format. */ 19 | typedef enum { 20 | STRSCAN_ERROR, 21 | STRSCAN_NUM, STRSCAN_IMAG, 22 | STRSCAN_INT, STRSCAN_U32, STRSCAN_I64, STRSCAN_U64, 23 | } StrScanFmt; 24 | 25 | LJ_FUNC StrScanFmt lj_strscan_scan(const uint8_t *p, TValue *o, uint32_t opt); 26 | LJ_FUNC int LJ_FASTCALL lj_strscan_num(GCstr *str, TValue *o); 27 | #if LJ_DUALNUM 28 | LJ_FUNC int LJ_FASTCALL lj_strscan_number(GCstr *str, TValue *o); 29 | #else 30 | #define lj_strscan_number(s, o) lj_strscan_num((s), (o)) 31 | #endif 32 | 33 | /* Check for number or convert string to number/int in-place (!). */ 34 | static LJ_AINLINE int lj_strscan_numberobj(TValue *o) 35 | { 36 | return tvisnumber(o) || (tvisstr(o) && lj_strscan_number(strV(o), o)); 37 | } 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /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/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/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/lua_new/compile/src/lj_state.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** State and stack handling. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_STATE_H 7 | #define _LJ_STATE_H 8 | 9 | #include "lj_obj.h" 10 | 11 | #define incr_top(L) \ 12 | (++L->top >= tvref(L->maxstack) && (lj_state_growstack1(L), 0)) 13 | 14 | #define savestack(L, p) ((char *)(p) - mref(L->stack, char)) 15 | #define restorestack(L, n) ((TValue *)(mref(L->stack, char) + (n))) 16 | 17 | LJ_FUNC void lj_state_relimitstack(lua_State *L); 18 | LJ_FUNC void lj_state_shrinkstack(lua_State *L, MSize used); 19 | LJ_FUNCA void LJ_FASTCALL lj_state_growstack(lua_State *L, MSize need); 20 | LJ_FUNC void LJ_FASTCALL lj_state_growstack1(lua_State *L); 21 | 22 | static LJ_AINLINE void lj_state_checkstack(lua_State *L, MSize need) 23 | { 24 | if ((mref(L->maxstack, char) - (char *)L->top) <= 25 | (ptrdiff_t)need*(ptrdiff_t)sizeof(TValue)) 26 | lj_state_growstack(L, need); 27 | } 28 | 29 | LJ_FUNC lua_State *lj_state_new(lua_State *L); 30 | LJ_FUNC void LJ_FASTCALL lj_state_free(global_State *g, lua_State *L); 31 | #if LJ_64 && !LJ_GC64 && !(defined(LUAJIT_USE_VALGRIND) && defined(LUAJIT_USE_SYSMALLOC)) 32 | LJ_FUNC lua_State *lj_state_newstate(lua_Alloc f, void *ud); 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /internal_hvh/lua_new/compile/src/lj_carith.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** C data arithmetic. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_CARITH_H 7 | #define _LJ_CARITH_H 8 | 9 | #include "lj_obj.h" 10 | 11 | #if LJ_HASFFI 12 | 13 | LJ_FUNC int lj_carith_op(lua_State *L, MMS mm); 14 | 15 | #if LJ_32 16 | LJ_FUNC uint64_t lj_carith_shl64(uint64_t x, int32_t sh); 17 | LJ_FUNC uint64_t lj_carith_shr64(uint64_t x, int32_t sh); 18 | LJ_FUNC uint64_t lj_carith_sar64(uint64_t x, int32_t sh); 19 | LJ_FUNC uint64_t lj_carith_rol64(uint64_t x, int32_t sh); 20 | LJ_FUNC uint64_t lj_carith_ror64(uint64_t x, int32_t sh); 21 | #endif 22 | LJ_FUNC uint64_t lj_carith_shift64(uint64_t x, int32_t sh, int op); 23 | LJ_FUNC uint64_t lj_carith_check64(lua_State *L, int narg, CTypeID *id); 24 | 25 | #if LJ_32 && LJ_HASJIT 26 | LJ_FUNC int64_t lj_carith_mul64(int64_t x, int64_t k); 27 | #endif 28 | LJ_FUNC uint64_t lj_carith_divu64(uint64_t a, uint64_t b); 29 | LJ_FUNC int64_t lj_carith_divi64(int64_t a, int64_t b); 30 | LJ_FUNC uint64_t lj_carith_modu64(uint64_t a, uint64_t b); 31 | LJ_FUNC int64_t lj_carith_modi64(int64_t a, int64_t b); 32 | LJ_FUNC uint64_t lj_carith_powu64(uint64_t x, uint64_t k); 33 | LJ_FUNC int64_t lj_carith_powi64(int64_t x, int64_t k); 34 | 35 | #endif 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /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/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/lua_new/compile/src/lualib.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Standard library header. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LUALIB_H 7 | #define _LUALIB_H 8 | 9 | #include "lua.h" 10 | 11 | #define LUA_FILEHANDLE "FILE*" 12 | 13 | #define LUA_COLIBNAME "coroutine" 14 | #define LUA_MATHLIBNAME "math" 15 | #define LUA_STRLIBNAME "string" 16 | #define LUA_TABLIBNAME "table" 17 | #define LUA_IOLIBNAME "io" 18 | #define LUA_OSLIBNAME "os" 19 | #define LUA_LOADLIBNAME "package" 20 | #define LUA_DBLIBNAME "debug" 21 | #define LUA_BITLIBNAME "bit" 22 | #define LUA_JITLIBNAME "jit" 23 | #define LUA_FFILIBNAME "ffi" 24 | 25 | LUALIB_API int luaopen_base(lua_State *L); 26 | LUALIB_API int luaopen_math(lua_State *L); 27 | LUALIB_API int luaopen_string(lua_State *L); 28 | LUALIB_API int luaopen_table(lua_State *L); 29 | LUALIB_API int luaopen_io(lua_State *L); 30 | LUALIB_API int luaopen_os(lua_State *L); 31 | LUALIB_API int luaopen_package(lua_State *L); 32 | LUALIB_API int luaopen_debug(lua_State *L); 33 | LUALIB_API int luaopen_bit(lua_State *L); 34 | LUALIB_API int luaopen_jit(lua_State *L); 35 | LUALIB_API int luaopen_ffi(lua_State *L); 36 | 37 | LUALIB_API void luaL_openlibs(lua_State *L); 38 | 39 | #ifndef lua_assert 40 | #define lua_assert(x) ((void)0) 41 | #endif 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /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/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/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/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/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/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/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/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/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/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/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/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/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/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/lua_new/compile/src/lj_obj.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** Miscellaneous object handling. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #define lj_obj_c 7 | #define LUA_CORE 8 | 9 | #include "lj_obj.h" 10 | 11 | /* Object type names. */ 12 | LJ_DATADEF const char *const lj_obj_typename[] = { /* ORDER LUA_T */ 13 | "no value", "nil", "boolean", "userdata", "number", "string", 14 | "table", "function", "userdata", "thread", "proto", "cdata" 15 | }; 16 | 17 | LJ_DATADEF const char *const lj_obj_itypename[] = { /* ORDER LJ_T */ 18 | "nil", "boolean", "boolean", "userdata", "string", "upval", "thread", 19 | "proto", "function", "trace", "cdata", "table", "userdata", "number" 20 | }; 21 | 22 | /* Compare two objects without calling metamethods. */ 23 | int LJ_FASTCALL lj_obj_equal(cTValue *o1, cTValue *o2) 24 | { 25 | if (itype(o1) == itype(o2)) { 26 | if (tvispri(o1)) 27 | return 1; 28 | if (!tvisnum(o1)) 29 | return gcrefeq(o1->gcr, o2->gcr); 30 | } else if (!tvisnumber(o1) || !tvisnumber(o2)) { 31 | return 0; 32 | } 33 | return numberVnum(o1) == numberVnum(o2); 34 | } 35 | 36 | /* Return pointer to object or its object data. */ 37 | const void * LJ_FASTCALL lj_obj_ptr(cTValue *o) 38 | { 39 | if (tvisudata(o)) 40 | return uddata(udataV(o)); 41 | else if (tvislightud(o)) 42 | return lightudV(o); 43 | else if (LJ_HASFFI && tviscdata(o)) 44 | return cdataptr(cdataV(o)); 45 | else if (tvisgcv(o)) 46 | return gcV(o); 47 | else 48 | return NULL; 49 | } 50 | 51 | -------------------------------------------------------------------------------- /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/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/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/lua_new/compile/src/lib_init.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** Library initialization. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | ** 5 | ** Major parts taken verbatim from the Lua interpreter. 6 | ** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h 7 | */ 8 | 9 | #define lib_init_c 10 | #define LUA_LIB 11 | 12 | #include "lua.h" 13 | #include "lauxlib.h" 14 | #include "lualib.h" 15 | 16 | #include "lj_arch.h" 17 | 18 | static const luaL_Reg lj_lib_load[] = { 19 | { "", luaopen_base }, 20 | { LUA_LOADLIBNAME, luaopen_package }, 21 | { LUA_TABLIBNAME, luaopen_table }, 22 | { LUA_IOLIBNAME, luaopen_io }, 23 | { LUA_OSLIBNAME, luaopen_os }, 24 | { LUA_STRLIBNAME, luaopen_string }, 25 | { LUA_MATHLIBNAME, luaopen_math }, 26 | { LUA_DBLIBNAME, luaopen_debug }, 27 | { LUA_BITLIBNAME, luaopen_bit }, 28 | { LUA_JITLIBNAME, luaopen_jit }, 29 | { NULL, NULL } 30 | }; 31 | 32 | static const luaL_Reg lj_lib_preload[] = { 33 | #if LJ_HASFFI 34 | { LUA_FFILIBNAME, luaopen_ffi }, 35 | #endif 36 | { NULL, NULL } 37 | }; 38 | 39 | LUALIB_API void luaL_openlibs(lua_State *L) 40 | { 41 | const luaL_Reg *lib; 42 | for (lib = lj_lib_load; lib->func; lib++) { 43 | lua_pushcfunction(L, lib->func); 44 | lua_pushstring(L, lib->name); 45 | lua_call(L, 1, 0); 46 | } 47 | luaL_findtable(L, LUA_REGISTRYINDEX, "_PRELOAD", 48 | sizeof(lj_lib_preload)/sizeof(lj_lib_preload[0])-1); 49 | for (lib = lj_lib_preload; lib->func; lib++) { 50 | lua_pushcfunction(L, lib->func); 51 | lua_setfield(L, -2, lib->name); 52 | } 53 | lua_pop(L, 1); 54 | } 55 | 56 | -------------------------------------------------------------------------------- /internal_hvh/lua_new/compile/src/lj_char.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Character types. 3 | ** Donated to the public domain. 4 | */ 5 | 6 | #ifndef _LJ_CHAR_H 7 | #define _LJ_CHAR_H 8 | 9 | #include "lj_def.h" 10 | 11 | #define LJ_CHAR_CNTRL 0x01 12 | #define LJ_CHAR_SPACE 0x02 13 | #define LJ_CHAR_PUNCT 0x04 14 | #define LJ_CHAR_DIGIT 0x08 15 | #define LJ_CHAR_XDIGIT 0x10 16 | #define LJ_CHAR_UPPER 0x20 17 | #define LJ_CHAR_LOWER 0x40 18 | #define LJ_CHAR_IDENT 0x80 19 | #define LJ_CHAR_ALPHA (LJ_CHAR_LOWER|LJ_CHAR_UPPER) 20 | #define LJ_CHAR_ALNUM (LJ_CHAR_ALPHA|LJ_CHAR_DIGIT) 21 | #define LJ_CHAR_GRAPH (LJ_CHAR_ALNUM|LJ_CHAR_PUNCT) 22 | 23 | /* Only pass -1 or 0..255 to these macros. Never pass a signed char! */ 24 | #define lj_char_isa(c, t) ((lj_char_bits+1)[(c)] & t) 25 | #define lj_char_iscntrl(c) lj_char_isa((c), LJ_CHAR_CNTRL) 26 | #define lj_char_isspace(c) lj_char_isa((c), LJ_CHAR_SPACE) 27 | #define lj_char_ispunct(c) lj_char_isa((c), LJ_CHAR_PUNCT) 28 | #define lj_char_isdigit(c) lj_char_isa((c), LJ_CHAR_DIGIT) 29 | #define lj_char_isxdigit(c) lj_char_isa((c), LJ_CHAR_XDIGIT) 30 | #define lj_char_isupper(c) lj_char_isa((c), LJ_CHAR_UPPER) 31 | #define lj_char_islower(c) lj_char_isa((c), LJ_CHAR_LOWER) 32 | #define lj_char_isident(c) lj_char_isa((c), LJ_CHAR_IDENT) 33 | #define lj_char_isalpha(c) lj_char_isa((c), LJ_CHAR_ALPHA) 34 | #define lj_char_isalnum(c) lj_char_isa((c), LJ_CHAR_ALNUM) 35 | #define lj_char_isgraph(c) lj_char_isa((c), LJ_CHAR_GRAPH) 36 | 37 | #define lj_char_toupper(c) ((c) - (lj_char_islower(c) >> 1)) 38 | #define lj_char_tolower(c) ((c) + lj_char_isupper(c)) 39 | 40 | LJ_DATA const uint8_t lj_char_bits[257]; 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /internal_hvh/lua_new/compile/src/lj_err.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Error handling. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_ERR_H 7 | #define _LJ_ERR_H 8 | 9 | #include 10 | 11 | #include "lj_obj.h" 12 | 13 | typedef enum { 14 | #define ERRDEF(name, msg) \ 15 | LJ_ERR_##name, LJ_ERR_##name##_ = LJ_ERR_##name + sizeof(msg)-1, 16 | #include "lj_errmsg.h" 17 | LJ_ERR__MAX 18 | } ErrMsg; 19 | 20 | LJ_DATA const char *lj_err_allmsg; 21 | #define err2msg(em) (lj_err_allmsg+(int)(em)) 22 | 23 | LJ_FUNC GCstr *lj_err_str(lua_State *L, ErrMsg em); 24 | LJ_FUNCA_NORET void LJ_FASTCALL lj_err_throw(lua_State *L, int errcode); 25 | LJ_FUNC_NORET void lj_err_mem(lua_State *L); 26 | LJ_FUNC_NORET void lj_err_run(lua_State *L); 27 | LJ_FUNC_NORET void lj_err_msg(lua_State *L, ErrMsg em); 28 | LJ_FUNC_NORET void lj_err_lex(lua_State *L, GCstr *src, const char *tok, 29 | BCLine line, ErrMsg em, va_list argp); 30 | LJ_FUNC_NORET void lj_err_optype(lua_State *L, cTValue *o, ErrMsg opm); 31 | LJ_FUNC_NORET void lj_err_comp(lua_State *L, cTValue *o1, cTValue *o2); 32 | LJ_FUNC_NORET void lj_err_optype_call(lua_State *L, TValue *o); 33 | LJ_FUNC_NORET void lj_err_callermsg(lua_State *L, const char *msg); 34 | LJ_FUNC_NORET void lj_err_callerv(lua_State *L, ErrMsg em, ...); 35 | LJ_FUNC_NORET void lj_err_caller(lua_State *L, ErrMsg em); 36 | LJ_FUNC_NORET void lj_err_arg(lua_State *L, int narg, ErrMsg em); 37 | LJ_FUNC_NORET void lj_err_argv(lua_State *L, int narg, ErrMsg em, ...); 38 | LJ_FUNC_NORET void lj_err_argtype(lua_State *L, int narg, const char *xname); 39 | LJ_FUNC_NORET void lj_err_argt(lua_State *L, int narg, int tt); 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /internal_hvh/lua_new/compile/src/lj_meta.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Metamethod handling. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_META_H 7 | #define _LJ_META_H 8 | 9 | #include "lj_obj.h" 10 | 11 | /* Metamethod handling */ 12 | LJ_FUNC void lj_meta_init(lua_State *L); 13 | LJ_FUNC cTValue *lj_meta_cache(GCtab *mt, MMS mm, GCstr *name); 14 | LJ_FUNC cTValue *lj_meta_lookup(lua_State *L, cTValue *o, MMS mm); 15 | #if LJ_HASFFI 16 | LJ_FUNC int lj_meta_tailcall(lua_State *L, cTValue *tv); 17 | #endif 18 | 19 | #define lj_meta_fastg(g, mt, mm) \ 20 | ((mt) == NULL ? NULL : ((mt)->nomm & (1u<<(mm))) ? NULL : \ 21 | lj_meta_cache(mt, mm, mmname_str(g, mm))) 22 | #define lj_meta_fast(L, mt, mm) lj_meta_fastg(G(L), mt, mm) 23 | 24 | /* C helpers for some instructions, called from assembler VM. */ 25 | LJ_FUNCA cTValue *lj_meta_tget(lua_State *L, cTValue *o, cTValue *k); 26 | LJ_FUNCA TValue *lj_meta_tset(lua_State *L, cTValue *o, cTValue *k); 27 | LJ_FUNCA TValue *lj_meta_arith(lua_State *L, TValue *ra, cTValue *rb, 28 | cTValue *rc, BCReg op); 29 | LJ_FUNCA TValue *lj_meta_cat(lua_State *L, TValue *top, int left); 30 | LJ_FUNCA TValue * LJ_FASTCALL lj_meta_len(lua_State *L, cTValue *o); 31 | LJ_FUNCA TValue *lj_meta_equal(lua_State *L, GCobj *o1, GCobj *o2, int ne); 32 | LJ_FUNCA TValue * LJ_FASTCALL lj_meta_equal_cd(lua_State *L, BCIns ins); 33 | LJ_FUNCA TValue *lj_meta_comp(lua_State *L, cTValue *o1, cTValue *o2, int op); 34 | LJ_FUNCA void lj_meta_istype(lua_State *L, BCReg ra, BCReg tp); 35 | LJ_FUNCA void lj_meta_call(lua_State *L, TValue *func, TValue *top); 36 | LJ_FUNCA void LJ_FASTCALL lj_meta_for(lua_State *L, TValue *o); 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /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/lua_new/compile/src/lj_vmevent.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** VM event handling. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #include 7 | 8 | #define lj_vmevent_c 9 | #define LUA_CORE 10 | 11 | #include "lj_obj.h" 12 | #include "lj_str.h" 13 | #include "lj_tab.h" 14 | #include "lj_state.h" 15 | #include "lj_dispatch.h" 16 | #include "lj_vm.h" 17 | #include "lj_vmevent.h" 18 | 19 | ptrdiff_t lj_vmevent_prepare(lua_State *L, VMEvent ev) 20 | { 21 | global_State *g = G(L); 22 | GCstr *s = lj_str_newlit(L, LJ_VMEVENTS_REGKEY); 23 | cTValue *tv = lj_tab_getstr(tabV(registry(L)), s); 24 | if (tvistab(tv)) { 25 | int hash = VMEVENT_HASH(ev); 26 | tv = lj_tab_getint(tabV(tv), hash); 27 | if (tv && tvisfunc(tv)) { 28 | lj_state_checkstack(L, LUA_MINSTACK); 29 | setfuncV(L, L->top++, funcV(tv)); 30 | if (LJ_FR2) setnilV(L->top++); 31 | return savestack(L, L->top); 32 | } 33 | } 34 | g->vmevmask &= ~VMEVENT_MASK(ev); /* No handler: cache this fact. */ 35 | return 0; 36 | } 37 | 38 | void lj_vmevent_call(lua_State *L, ptrdiff_t argbase) 39 | { 40 | global_State *g = G(L); 41 | uint8_t oldmask = g->vmevmask; 42 | uint8_t oldh = hook_save(g); 43 | int status; 44 | g->vmevmask = 0; /* Disable all events. */ 45 | hook_vmevent(g); 46 | status = lj_vm_pcall(L, restorestack(L, argbase), 0+1, 0); 47 | if (LJ_UNLIKELY(status)) { 48 | /* Really shouldn't use stderr here, but where else to complain? */ 49 | L->top--; 50 | fputs("VM handler failed: ", stderr); 51 | fputs(tvisstr(L->top) ? strVdata(L->top) : "?", stderr); 52 | fputc('\n', stderr); 53 | } 54 | hook_restore(g, oldh); 55 | if (g->vmevmask != VMEVENT_NOCACHE) 56 | g->vmevmask = oldmask; /* Restore event mask, but not if not modified. */ 57 | } 58 | 59 | -------------------------------------------------------------------------------- /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/lua_new/compile/src/lj_vmevent.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** VM event handling. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_VMEVENT_H 7 | #define _LJ_VMEVENT_H 8 | 9 | #include "lj_obj.h" 10 | 11 | /* Registry key for VM event handler table. */ 12 | #define LJ_VMEVENTS_REGKEY "_VMEVENTS" 13 | #define LJ_VMEVENTS_HSIZE 4 14 | 15 | #define VMEVENT_MASK(ev) ((uint8_t)1 << ((int)(ev) & 7)) 16 | #define VMEVENT_HASH(ev) ((int)(ev) & ~7) 17 | #define VMEVENT_HASHIDX(h) ((int)(h) << 3) 18 | #define VMEVENT_NOCACHE 255 19 | 20 | #define VMEVENT_DEF(name, hash) \ 21 | LJ_VMEVENT_##name##_, \ 22 | LJ_VMEVENT_##name = ((LJ_VMEVENT_##name##_) & 7)|((hash) << 3) 23 | 24 | /* VM event IDs. */ 25 | typedef enum { 26 | VMEVENT_DEF(BC, 0x00003883), 27 | VMEVENT_DEF(TRACE, 0xb2d91467), 28 | VMEVENT_DEF(RECORD, 0x9284bf4f), 29 | VMEVENT_DEF(TEXIT, 0xb29df2b0), 30 | LJ_VMEVENT__MAX 31 | } VMEvent; 32 | 33 | #ifdef LUAJIT_DISABLE_VMEVENT 34 | #define lj_vmevent_send(L, ev, args) UNUSED(L) 35 | #define lj_vmevent_send_(L, ev, args, post) UNUSED(L) 36 | #else 37 | #define lj_vmevent_send(L, ev, args) \ 38 | if (G(L)->vmevmask & VMEVENT_MASK(LJ_VMEVENT_##ev)) { \ 39 | ptrdiff_t argbase = lj_vmevent_prepare(L, LJ_VMEVENT_##ev); \ 40 | if (argbase) { \ 41 | args \ 42 | lj_vmevent_call(L, argbase); \ 43 | } \ 44 | } 45 | #define lj_vmevent_send_(L, ev, args, post) \ 46 | if (G(L)->vmevmask & VMEVENT_MASK(LJ_VMEVENT_##ev)) { \ 47 | ptrdiff_t argbase = lj_vmevent_prepare(L, LJ_VMEVENT_##ev); \ 48 | if (argbase) { \ 49 | args \ 50 | lj_vmevent_call(L, argbase); \ 51 | post \ 52 | } \ 53 | } 54 | 55 | LJ_FUNC ptrdiff_t lj_vmevent_prepare(lua_State *L, VMEvent ev); 56 | LJ_FUNC void lj_vmevent_call(lua_State *L, ptrdiff_t argbase); 57 | #endif 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /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/lua_new/compile/src/lj_record.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Trace recorder (bytecode -> SSA IR). 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_RECORD_H 7 | #define _LJ_RECORD_H 8 | 9 | #include "lj_obj.h" 10 | #include "lj_jit.h" 11 | 12 | #if LJ_HASJIT 13 | /* Context for recording an indexed load/store. */ 14 | typedef struct RecordIndex { 15 | TValue tabv; /* Runtime value of table (or indexed object). */ 16 | TValue keyv; /* Runtime value of key. */ 17 | TValue valv; /* Runtime value of stored value. */ 18 | TValue mobjv; /* Runtime value of metamethod object. */ 19 | GCtab *mtv; /* Runtime value of metatable object. */ 20 | cTValue *oldv; /* Runtime value of previously stored value. */ 21 | TRef tab; /* Table (or indexed object) reference. */ 22 | TRef key; /* Key reference. */ 23 | TRef val; /* Value reference for a store or 0 for a load. */ 24 | TRef mt; /* Metatable reference. */ 25 | TRef mobj; /* Metamethod object reference. */ 26 | int idxchain; /* Index indirections left or 0 for raw lookup. */ 27 | } RecordIndex; 28 | 29 | LJ_FUNC int lj_record_objcmp(jit_State *J, TRef a, TRef b, 30 | cTValue *av, cTValue *bv); 31 | LJ_FUNC void lj_record_stop(jit_State *J, TraceLink linktype, TraceNo lnk); 32 | LJ_FUNC TRef lj_record_constify(jit_State *J, cTValue *o); 33 | 34 | LJ_FUNC void lj_record_call(jit_State *J, BCReg func, ptrdiff_t nargs); 35 | LJ_FUNC void lj_record_tailcall(jit_State *J, BCReg func, ptrdiff_t nargs); 36 | LJ_FUNC void lj_record_ret(jit_State *J, BCReg rbase, ptrdiff_t gotresults); 37 | 38 | LJ_FUNC int lj_record_mm_lookup(jit_State *J, RecordIndex *ix, MMS mm); 39 | LJ_FUNC TRef lj_record_idx(jit_State *J, RecordIndex *ix); 40 | 41 | LJ_FUNC void lj_record_ins(jit_State *J); 42 | LJ_FUNC void lj_record_setup(jit_State *J); 43 | #endif 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /internal_hvh/lua_new/lua/runtime_state.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | bool lua::runtime_state::check_argument_type( int pos, lua_type_def expected_type ) 4 | { 5 | auto result = false; 6 | switch ( expected_type ) 7 | { 8 | case lua_type_def::nil: 9 | result = lua_isnil( l, pos ); 10 | break; 11 | case lua_type_def::boolean: 12 | result = lua_isboolean( l, pos ); 13 | break; 14 | case lua_type_def::light_user_data: 15 | result = lua_islightuserdata( l, pos ); 16 | break; 17 | case lua_type_def::number: 18 | result = lua_isnumber( l, pos ); 19 | break; 20 | case lua_type_def::string: 21 | result = lua_isstring( l, pos ); 22 | break; 23 | case lua_type_def::table: 24 | result = lua_istable( l, pos ); 25 | break; 26 | case lua_type_def::function: 27 | result = lua_isfunction( l, pos ); 28 | break; 29 | case lua_type_def::user_data: 30 | result = lua_isuserdata( l, pos ); 31 | break; 32 | case lua_type_def::thread: 33 | result = lua_isthread( l, pos ); 34 | break; 35 | default: break; 36 | } 37 | 38 | return result; 39 | } 40 | 41 | bool lua::runtime_state::check_arguments( const std::vector& desc, bool relaxed ) 42 | { 43 | const auto arg_count = get_stack_top(); 44 | 45 | // we don't want more arguments than needed 46 | if ( !relaxed && arg_count > desc.size() ) 47 | return false; 48 | 49 | int i{}; 50 | for ( const auto& arg : desc ) 51 | { 52 | // increment stack counter 53 | ++i; 54 | 55 | // check if we have enough args 56 | if ( arg_count < i ) 57 | { 58 | // check if it's a required argument or skip optional arguments if they are not present 59 | if ( !arg.is_optional ) return false; 60 | else continue; 61 | } 62 | 63 | // check corresponding type 64 | if ( !check_argument_type( i, arg.expected_type ) ) 65 | return false; 66 | } 67 | 68 | return true; 69 | } 70 | -------------------------------------------------------------------------------- /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/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/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/lua_new/compile/src/lj_trace.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Trace management. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_TRACE_H 7 | #define _LJ_TRACE_H 8 | 9 | #include "lj_obj.h" 10 | 11 | #if LJ_HASJIT 12 | #include "lj_jit.h" 13 | #include "lj_dispatch.h" 14 | 15 | /* Trace errors. */ 16 | typedef enum { 17 | #define TREDEF(name, msg) LJ_TRERR_##name, 18 | #include "lj_traceerr.h" 19 | LJ_TRERR__MAX 20 | } TraceError; 21 | 22 | LJ_FUNC_NORET void lj_trace_err(jit_State *J, TraceError e); 23 | LJ_FUNC_NORET void lj_trace_err_info(jit_State *J, TraceError e); 24 | 25 | /* Trace management. */ 26 | LJ_FUNC GCtrace * LJ_FASTCALL lj_trace_alloc(lua_State *L, GCtrace *T); 27 | LJ_FUNC void LJ_FASTCALL lj_trace_free(global_State *g, GCtrace *T); 28 | LJ_FUNC void lj_trace_reenableproto(GCproto *pt); 29 | LJ_FUNC void lj_trace_flushproto(global_State *g, GCproto *pt); 30 | LJ_FUNC void lj_trace_flush(jit_State *J, TraceNo traceno); 31 | LJ_FUNC int lj_trace_flushall(lua_State *L); 32 | LJ_FUNC void lj_trace_initstate(global_State *g); 33 | LJ_FUNC void lj_trace_freestate(global_State *g); 34 | 35 | /* Event handling. */ 36 | LJ_FUNC void lj_trace_ins(jit_State *J, const BCIns *pc); 37 | LJ_FUNCA void LJ_FASTCALL lj_trace_hot(jit_State *J, const BCIns *pc); 38 | LJ_FUNCA void LJ_FASTCALL lj_trace_stitch(jit_State *J, const BCIns *pc); 39 | LJ_FUNCA int LJ_FASTCALL lj_trace_exit(jit_State *J, void *exptr); 40 | 41 | /* Signal asynchronous abort of trace or end of trace. */ 42 | #define lj_trace_abort(g) (G2J(g)->state &= ~LJ_TRACE_ACTIVE) 43 | #define lj_trace_end(J) (J->state = LJ_TRACE_END) 44 | 45 | #else 46 | 47 | #define lj_trace_flushall(L) (UNUSED(L), 0) 48 | #define lj_trace_initstate(g) UNUSED(g) 49 | #define lj_trace_freestate(g) UNUSED(g) 50 | #define lj_trace_abort(g) UNUSED(g) 51 | #define lj_trace_end(J) UNUSED(J) 52 | 53 | #endif 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /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/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/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/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/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/lua_new/compile/src/lj_crecord.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Trace recorder for C data operations. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_CRECORD_H 7 | #define _LJ_CRECORD_H 8 | 9 | #include "lj_obj.h" 10 | #include "lj_jit.h" 11 | #include "lj_ffrecord.h" 12 | 13 | #if LJ_HASJIT && LJ_HASFFI 14 | LJ_FUNC void LJ_FASTCALL recff_cdata_index(jit_State *J, RecordFFData *rd); 15 | LJ_FUNC void LJ_FASTCALL recff_cdata_call(jit_State *J, RecordFFData *rd); 16 | LJ_FUNC void LJ_FASTCALL recff_cdata_arith(jit_State *J, RecordFFData *rd); 17 | LJ_FUNC void LJ_FASTCALL recff_clib_index(jit_State *J, RecordFFData *rd); 18 | LJ_FUNC void LJ_FASTCALL recff_ffi_new(jit_State *J, RecordFFData *rd); 19 | LJ_FUNC void LJ_FASTCALL recff_ffi_errno(jit_State *J, RecordFFData *rd); 20 | LJ_FUNC void LJ_FASTCALL recff_ffi_string(jit_State *J, RecordFFData *rd); 21 | LJ_FUNC void LJ_FASTCALL recff_ffi_copy(jit_State *J, RecordFFData *rd); 22 | LJ_FUNC void LJ_FASTCALL recff_ffi_fill(jit_State *J, RecordFFData *rd); 23 | LJ_FUNC void LJ_FASTCALL recff_ffi_typeof(jit_State *J, RecordFFData *rd); 24 | LJ_FUNC void LJ_FASTCALL recff_ffi_istype(jit_State *J, RecordFFData *rd); 25 | LJ_FUNC void LJ_FASTCALL recff_ffi_abi(jit_State *J, RecordFFData *rd); 26 | LJ_FUNC void LJ_FASTCALL recff_ffi_xof(jit_State *J, RecordFFData *rd); 27 | LJ_FUNC void LJ_FASTCALL recff_ffi_gc(jit_State *J, RecordFFData *rd); 28 | 29 | LJ_FUNC void LJ_FASTCALL recff_bit64_tobit(jit_State *J, RecordFFData *rd); 30 | LJ_FUNC int LJ_FASTCALL recff_bit64_unary(jit_State *J, RecordFFData *rd); 31 | LJ_FUNC int LJ_FASTCALL recff_bit64_nary(jit_State *J, RecordFFData *rd); 32 | LJ_FUNC int LJ_FASTCALL recff_bit64_shift(jit_State *J, RecordFFData *rd); 33 | LJ_FUNC TRef recff_bit64_tohex(jit_State *J, RecordFFData *rd, TRef hdr); 34 | 35 | LJ_FUNC void LJ_FASTCALL lj_crecord_tonumber(jit_State *J, RecordFFData *rd); 36 | #endif 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /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/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/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/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/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/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/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/lua_new/compile/src/lj_char.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** Character types. 3 | ** Donated to the public domain. 4 | ** 5 | ** This is intended to replace the problematic libc single-byte NLS functions. 6 | ** These just don't make sense anymore with UTF-8 locales becoming the norm 7 | ** on POSIX systems. It never worked too well on Windows systems since hardly 8 | ** anyone bothered to call setlocale(). 9 | ** 10 | ** This table is hardcoded for ASCII. Identifiers include the characters 11 | ** 128-255, too. This allows for the use of all non-ASCII chars as identifiers 12 | ** in the lexer. This is a broad definition, but works well in practice 13 | ** for both UTF-8 locales and most single-byte locales (such as ISO-8859-*). 14 | ** 15 | ** If you really need proper character types for UTF-8 strings, please use 16 | ** an add-on library such as slnunicode: http://luaforge.net/projects/sln/ 17 | */ 18 | 19 | #define lj_char_c 20 | #define LUA_CORE 21 | 22 | #include "lj_char.h" 23 | 24 | LJ_DATADEF const uint8_t lj_char_bits[257] = { 25 | 0, 26 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 1, 1, 27 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 28 | 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 29 | 152,152,152,152,152,152,152,152,152,152, 4, 4, 4, 4, 4, 4, 30 | 4,176,176,176,176,176,176,160,160,160,160,160,160,160,160,160, 31 | 160,160,160,160,160,160,160,160,160,160,160, 4, 4, 4, 4,132, 32 | 4,208,208,208,208,208,208,192,192,192,192,192,192,192,192,192, 33 | 192,192,192,192,192,192,192,192,192,192,192, 4, 4, 4, 4, 1, 34 | 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, 35 | 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, 36 | 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, 37 | 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, 38 | 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, 39 | 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, 40 | 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, 41 | 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128 42 | }; 43 | 44 | -------------------------------------------------------------------------------- /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/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/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/lua_new/compile/src/lj_debug.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Debugging and introspection. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_DEBUG_H 7 | #define _LJ_DEBUG_H 8 | 9 | #include "lj_obj.h" 10 | 11 | typedef struct lj_Debug { 12 | /* Common fields. Must be in the same order as in lua.h. */ 13 | int event; 14 | const char *name; 15 | const char *namewhat; 16 | const char *what; 17 | const char *source; 18 | int currentline; 19 | int nups; 20 | int linedefined; 21 | int lastlinedefined; 22 | char short_src[LUA_IDSIZE]; 23 | int i_ci; 24 | /* Extended fields. Only valid if lj_debug_getinfo() is called with ext = 1.*/ 25 | int nparams; 26 | int isvararg; 27 | } lj_Debug; 28 | 29 | LJ_FUNC cTValue *lj_debug_frame(lua_State *L, int level, int *size); 30 | LJ_FUNC BCLine LJ_FASTCALL lj_debug_line(GCproto *pt, BCPos pc); 31 | LJ_FUNC const char *lj_debug_uvname(GCproto *pt, uint32_t idx); 32 | LJ_FUNC const char *lj_debug_uvnamev(cTValue *o, uint32_t idx, TValue **tvp); 33 | LJ_FUNC const char *lj_debug_slotname(GCproto *pt, const BCIns *pc, 34 | BCReg slot, const char **name); 35 | LJ_FUNC const char *lj_debug_funcname(lua_State *L, cTValue *frame, 36 | const char **name); 37 | LJ_FUNC void lj_debug_shortname(char *out, GCstr *str, BCLine line); 38 | LJ_FUNC void lj_debug_addloc(lua_State *L, const char *msg, 39 | cTValue *frame, cTValue *nextframe); 40 | LJ_FUNC void lj_debug_pushloc(lua_State *L, GCproto *pt, BCPos pc); 41 | LJ_FUNC int lj_debug_getinfo(lua_State *L, const char *what, lj_Debug *ar, 42 | int ext); 43 | #if LJ_HASPROFILE 44 | LJ_FUNC void lj_debug_dumpstack(lua_State *L, SBuf *sb, const char *fmt, 45 | int depth); 46 | #endif 47 | 48 | /* Fixed internal variable names. */ 49 | #define VARNAMEDEF(_) \ 50 | _(FOR_IDX, "(for index)") \ 51 | _(FOR_STOP, "(for limit)") \ 52 | _(FOR_STEP, "(for step)") \ 53 | _(FOR_GEN, "(for generator)") \ 54 | _(FOR_STATE, "(for state)") \ 55 | _(FOR_CTL, "(for control)") 56 | 57 | enum { 58 | VARNAME_END, 59 | #define VARNAMEENUM(name, str) VARNAME_##name, 60 | VARNAMEDEF(VARNAMEENUM) 61 | #undef VARNAMEENUM 62 | VARNAME__MAX 63 | }; 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /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/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/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/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/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/lua_new/compile/src/lj_bcdump.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Bytecode dump definitions. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_BCDUMP_H 7 | #define _LJ_BCDUMP_H 8 | 9 | #include "lj_obj.h" 10 | #include "lj_lex.h" 11 | 12 | /* -- Bytecode dump format ------------------------------------------------ */ 13 | 14 | /* 15 | ** dump = header proto+ 0U 16 | ** header = ESC 'L' 'J' versionB flagsU [namelenU nameB*] 17 | ** proto = lengthU pdata 18 | ** pdata = phead bcinsW* uvdataH* kgc* knum* [debugB*] 19 | ** phead = flagsB numparamsB framesizeB numuvB numkgcU numknU numbcU 20 | ** [debuglenU [firstlineU numlineU]] 21 | ** kgc = kgctypeU { ktab | (loU hiU) | (rloU rhiU iloU ihiU) | strB* } 22 | ** knum = intU0 | (loU1 hiU) 23 | ** ktab = narrayU nhashU karray* khash* 24 | ** karray = ktabk 25 | ** khash = ktabk ktabk 26 | ** ktabk = ktabtypeU { intU | (loU hiU) | strB* } 27 | ** 28 | ** B = 8 bit, H = 16 bit, W = 32 bit, U = ULEB128 of W, U0/U1 = ULEB128 of W+1 29 | */ 30 | 31 | /* Bytecode dump header. */ 32 | #define BCDUMP_HEAD1 0x1b 33 | #define BCDUMP_HEAD2 0x4c 34 | #define BCDUMP_HEAD3 0x4a 35 | 36 | /* If you perform *any* kind of private modifications to the bytecode itself 37 | ** or to the dump format, you *must* set BCDUMP_VERSION to 0x80 or higher. 38 | */ 39 | #define BCDUMP_VERSION 2 40 | 41 | /* Compatibility flags. */ 42 | #define BCDUMP_F_BE 0x01 43 | #define BCDUMP_F_STRIP 0x02 44 | #define BCDUMP_F_FFI 0x04 45 | #define BCDUMP_F_FR2 0x08 46 | 47 | #define BCDUMP_F_KNOWN (BCDUMP_F_FR2*2-1) 48 | 49 | /* Type codes for the GC constants of a prototype. Plus length for strings. */ 50 | enum { 51 | BCDUMP_KGC_CHILD, BCDUMP_KGC_TAB, BCDUMP_KGC_I64, BCDUMP_KGC_U64, 52 | BCDUMP_KGC_COMPLEX, BCDUMP_KGC_STR 53 | }; 54 | 55 | /* Type codes for the keys/values of a constant table. */ 56 | enum { 57 | BCDUMP_KTAB_NIL, BCDUMP_KTAB_FALSE, BCDUMP_KTAB_TRUE, 58 | BCDUMP_KTAB_INT, BCDUMP_KTAB_NUM, BCDUMP_KTAB_STR 59 | }; 60 | 61 | /* -- Bytecode reader/writer ---------------------------------------------- */ 62 | 63 | LJ_FUNC int lj_bcwrite(lua_State *L, GCproto *pt, lua_Writer writer, 64 | void *data, int strip); 65 | LJ_FUNC GCproto *lj_bcread_proto(LexState *ls); 66 | LJ_FUNC GCproto *lj_bcread(LexState *ls); 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /internal_hvh/lua_new/lua/api/database.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "../include_cheat.h" 3 | #include 4 | 5 | int lua::api_def::database::save( lua_State* l ) 6 | { 7 | runtime_state s( l ); 8 | 9 | if ( !s.is_string( 1 ) || ( !s.is_string( 2 ) && !s.is_table( 2 ) ) ) 10 | { 11 | s.error( XOR_STR( "usage: database.save(filename, string/table)" ) ); 12 | return 0; 13 | } 14 | 15 | auto filename = std::string( s.get_string( 1 ) ); 16 | if ( filename.find( ".." ) != std::string::npos || filename.find( ':' ) != std::string::npos || filename.find( '/' ) != std::string::npos || filename.find( '\\' ) != std::string::npos ) 17 | { 18 | s.error( XOR_STR( "usage: database.save(filename, string/table): filename can not be an absolute path" ) ); 19 | return 0; 20 | } 21 | 22 | if ( !std::filesystem::exists( XOR_STR( "fatality/database" ) ) ) 23 | std::filesystem::create_directories( XOR_STR( "fatality/database" ) ); 24 | 25 | std::ofstream o( XOR_STR( "fatality/database/" ) + filename ); 26 | 27 | if ( s.is_table( 2 ) ) 28 | { 29 | auto parsed = helpers::parse_table( l, 2 ); 30 | o << std::setw( 4 ) << parsed << std::endl; 31 | } 32 | else 33 | o << s.get_string( 2 ); 34 | 35 | o.close(); 36 | 37 | return 0; 38 | } 39 | 40 | int lua::api_def::database::load( lua_State* l ) 41 | { 42 | runtime_state s( l ); 43 | 44 | if ( !s.is_string( 1 ) ) 45 | { 46 | s.error( XOR_STR( "usage: database.load(filename)" ) ); 47 | return 0; 48 | } 49 | 50 | auto filename = std::string( s.get_string( 1 ) ); 51 | if ( filename.find( ".." ) != std::string::npos || filename.find( ':' ) != std::string::npos || filename.find( '/' ) != std::string::npos || filename.find( '\\' ) != std::string::npos ) 52 | { 53 | s.error( XOR_STR( "database.load(filename): filename can not be an absolute path" ) ); 54 | return 0; 55 | } 56 | 57 | std::ifstream i( XOR_STR( "fatality/database/" ) + filename ); 58 | 59 | if ( !i.good() ) 60 | return 0; 61 | 62 | std::string content( ( std::istreambuf_iterator( i ) ), 63 | std::istreambuf_iterator() ); 64 | 65 | if ( content.length() == 0 ) 66 | return 0; 67 | 68 | json j = json::parse( content, nullptr, false ); 69 | if ( j.is_discarded() ) 70 | { 71 | s.push( content.c_str() ); 72 | return 1; 73 | } 74 | 75 | return helpers::load_table( l, j ); 76 | } -------------------------------------------------------------------------------- /internal_hvh/lua_new/compile/src/lj_cconv.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** C type conversions. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_CCONV_H 7 | #define _LJ_CCONV_H 8 | 9 | #include "lj_obj.h" 10 | #include "lj_ctype.h" 11 | 12 | #if LJ_HASFFI 13 | 14 | /* Compressed C type index. ORDER CCX. */ 15 | enum { 16 | CCX_B, /* Bool. */ 17 | CCX_I, /* Integer. */ 18 | CCX_F, /* Floating-point number. */ 19 | CCX_C, /* Complex. */ 20 | CCX_V, /* Vector. */ 21 | CCX_P, /* Pointer. */ 22 | CCX_A, /* Refarray. */ 23 | CCX_S /* Struct/union. */ 24 | }; 25 | 26 | /* Convert C type info to compressed C type index. ORDER CT. ORDER CCX. */ 27 | static LJ_AINLINE uint32_t cconv_idx(CTInfo info) 28 | { 29 | uint32_t idx = ((info >> 26) & 15u); /* Dispatch bits. */ 30 | lua_assert(ctype_type(info) <= CT_MAYCONVERT); 31 | #if LJ_64 32 | idx = ((uint32_t)(U64x(f436fff5,fff7f021) >> 4*idx) & 15u); 33 | #else 34 | idx = (((idx < 8 ? 0xfff7f021u : 0xf436fff5) >> 4*(idx & 7u)) & 15u); 35 | #endif 36 | lua_assert(idx < 8); 37 | return idx; 38 | } 39 | 40 | #define cconv_idx2(dinfo, sinfo) \ 41 | ((cconv_idx((dinfo)) << 3) + cconv_idx((sinfo))) 42 | 43 | #define CCX(dst, src) ((CCX_##dst << 3) + CCX_##src) 44 | 45 | /* Conversion flags. */ 46 | #define CCF_CAST 0x00000001u 47 | #define CCF_FROMTV 0x00000002u 48 | #define CCF_SAME 0x00000004u 49 | #define CCF_IGNQUAL 0x00000008u 50 | 51 | #define CCF_ARG_SHIFT 8 52 | #define CCF_ARG(n) ((n) << CCF_ARG_SHIFT) 53 | #define CCF_GETARG(f) ((f) >> CCF_ARG_SHIFT) 54 | 55 | LJ_FUNC int lj_cconv_compatptr(CTState *cts, CType *d, CType *s, CTInfo flags); 56 | LJ_FUNC void lj_cconv_ct_ct(CTState *cts, CType *d, CType *s, 57 | uint8_t *dp, uint8_t *sp, CTInfo flags); 58 | LJ_FUNC int lj_cconv_tv_ct(CTState *cts, CType *s, CTypeID sid, 59 | TValue *o, uint8_t *sp); 60 | LJ_FUNC int lj_cconv_tv_bf(CTState *cts, CType *s, TValue *o, uint8_t *sp); 61 | LJ_FUNC void lj_cconv_ct_tv(CTState *cts, CType *d, 62 | uint8_t *dp, TValue *o, CTInfo flags); 63 | LJ_FUNC void lj_cconv_bf_tv(CTState *cts, CType *d, uint8_t *dp, TValue *o); 64 | LJ_FUNC int lj_cconv_multi_init(CTState *cts, CType *d, TValue *o); 65 | LJ_FUNC void lj_cconv_ct_init(CTState *cts, CType *d, CTSize sz, 66 | uint8_t *dp, TValue *o, MSize len); 67 | 68 | #endif 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /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/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/lua_new/compile/src/lj_traceerr.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Trace compiler error messages. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | /* This file may be included multiple times with different TREDEF macros. */ 7 | 8 | /* Recording. */ 9 | TREDEF(RECERR, "error thrown or hook called during recording") 10 | TREDEF(TRACEUV, "trace too short") 11 | TREDEF(TRACEOV, "trace too long") 12 | TREDEF(STACKOV, "trace too deep") 13 | TREDEF(SNAPOV, "too many snapshots") 14 | TREDEF(BLACKL, "blacklisted") 15 | TREDEF(RETRY, "retry recording") 16 | TREDEF(NYIBC, "NYI: bytecode %d") 17 | 18 | /* Recording loop ops. */ 19 | TREDEF(LLEAVE, "leaving loop in root trace") 20 | TREDEF(LINNER, "inner loop in root trace") 21 | TREDEF(LUNROLL, "loop unroll limit reached") 22 | 23 | /* Recording calls/returns. */ 24 | TREDEF(BADTYPE, "bad argument type") 25 | TREDEF(CJITOFF, "JIT compilation disabled for function") 26 | TREDEF(CUNROLL, "call unroll limit reached") 27 | TREDEF(DOWNREC, "down-recursion, restarting") 28 | TREDEF(NYIFFU, "NYI: unsupported variant of FastFunc %s") 29 | TREDEF(NYIRETL, "NYI: return to lower frame") 30 | 31 | /* Recording indexed load/store. */ 32 | TREDEF(STORENN, "store with nil or NaN key") 33 | TREDEF(NOMM, "missing metamethod") 34 | TREDEF(IDXLOOP, "looping index lookup") 35 | TREDEF(NYITMIX, "NYI: mixed sparse/dense table") 36 | 37 | /* Recording C data operations. */ 38 | TREDEF(NOCACHE, "symbol not in cache") 39 | TREDEF(NYICONV, "NYI: unsupported C type conversion") 40 | TREDEF(NYICALL, "NYI: unsupported C function type") 41 | 42 | /* Optimizations. */ 43 | TREDEF(GFAIL, "guard would always fail") 44 | TREDEF(PHIOV, "too many PHIs") 45 | TREDEF(TYPEINS, "persistent type instability") 46 | 47 | /* Assembler. */ 48 | TREDEF(MCODEAL, "failed to allocate mcode memory") 49 | TREDEF(MCODEOV, "machine code too long") 50 | TREDEF(MCODELM, "hit mcode limit (retrying)") 51 | TREDEF(SPILLOV, "too many spill slots") 52 | TREDEF(BADRA, "inconsistent register allocation") 53 | TREDEF(NYIIR, "NYI: cannot assemble IR instruction %d") 54 | TREDEF(NYIPHI, "NYI: PHI shuffling too complex") 55 | TREDEF(NYICOAL, "NYI: register coalescing too complex") 56 | 57 | #undef TREDEF 58 | 59 | /* Detecting unused error messages: 60 | awk -F, '/^TREDEF/ { gsub(/TREDEF./, ""); printf "grep -q LJ_TRERR_%s *.[ch] || echo %s\n", $1, $1}' lj_traceerr.h | sh 61 | */ 62 | -------------------------------------------------------------------------------- /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/lua_new/compile/src/lj_opt_dce.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** DCE: Dead Code Elimination. Pre-LOOP only -- ASM already performs DCE. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #define lj_opt_dce_c 7 | #define LUA_CORE 8 | 9 | #include "lj_obj.h" 10 | 11 | #if LJ_HASJIT 12 | 13 | #include "lj_ir.h" 14 | #include "lj_jit.h" 15 | #include "lj_iropt.h" 16 | 17 | /* Some local macros to save typing. Undef'd at the end. */ 18 | #define IR(ref) (&J->cur.ir[(ref)]) 19 | 20 | /* Scan through all snapshots and mark all referenced instructions. */ 21 | static void dce_marksnap(jit_State *J) 22 | { 23 | SnapNo i, nsnap = J->cur.nsnap; 24 | for (i = 0; i < nsnap; i++) { 25 | SnapShot *snap = &J->cur.snap[i]; 26 | SnapEntry *map = &J->cur.snapmap[snap->mapofs]; 27 | MSize n, nent = snap->nent; 28 | for (n = 0; n < nent; n++) { 29 | IRRef ref = snap_ref(map[n]); 30 | if (ref >= REF_FIRST) 31 | irt_setmark(IR(ref)->t); 32 | } 33 | } 34 | } 35 | 36 | /* Backwards propagate marks. Replace unused instructions with NOPs. */ 37 | static void dce_propagate(jit_State *J) 38 | { 39 | IRRef1 *pchain[IR__MAX]; 40 | IRRef ins; 41 | uint32_t i; 42 | for (i = 0; i < IR__MAX; i++) pchain[i] = &J->chain[i]; 43 | for (ins = J->cur.nins-1; ins >= REF_FIRST; ins--) { 44 | IRIns *ir = IR(ins); 45 | if (irt_ismarked(ir->t)) { 46 | irt_clearmark(ir->t); 47 | pchain[ir->o] = &ir->prev; 48 | } else if (!ir_sideeff(ir)) { 49 | *pchain[ir->o] = ir->prev; /* Reroute original instruction chain. */ 50 | ir->t.irt = IRT_NIL; 51 | ir->o = IR_NOP; /* Replace instruction with NOP. */ 52 | ir->op1 = ir->op2 = 0; 53 | ir->prev = 0; 54 | continue; 55 | } 56 | if (ir->op1 >= REF_FIRST) irt_setmark(IR(ir->op1)->t); 57 | if (ir->op2 >= REF_FIRST) irt_setmark(IR(ir->op2)->t); 58 | } 59 | } 60 | 61 | /* Dead Code Elimination. 62 | ** 63 | ** First backpropagate marks for all used instructions. Then replace 64 | ** the unused ones with a NOP. Note that compressing the IR to eliminate 65 | ** the NOPs does not pay off. 66 | */ 67 | void lj_opt_dce(jit_State *J) 68 | { 69 | if ((J->flags & JIT_F_OPT_DCE)) { 70 | dce_marksnap(J); 71 | dce_propagate(J); 72 | memset(J->bpropcache, 0, sizeof(J->bpropcache)); /* Invalidate cache. */ 73 | } 74 | } 75 | 76 | #undef IR 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /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/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/lua_new/compile/dynasm/dasm_proto.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** DynASM encoding engine prototypes. 3 | ** Copyright (C) 2005-2017 Mike Pall. All rights reserved. 4 | ** Released under the MIT license. See dynasm.lua for full copyright notice. 5 | */ 6 | 7 | #ifndef _DASM_PROTO_H 8 | #define _DASM_PROTO_H 9 | 10 | #include 11 | #include 12 | 13 | #define DASM_IDENT "DynASM 1.4.0" 14 | #define DASM_VERSION 10400 /* 1.4.0 */ 15 | 16 | #ifndef Dst_DECL 17 | #define Dst_DECL dasm_State **Dst 18 | #endif 19 | 20 | #ifndef Dst_REF 21 | #define Dst_REF (*Dst) 22 | #endif 23 | 24 | #ifndef DASM_FDEF 25 | #define DASM_FDEF extern 26 | #endif 27 | 28 | #ifndef DASM_M_GROW 29 | #define DASM_M_GROW(ctx, t, p, sz, need) \ 30 | do { \ 31 | size_t _sz = (sz), _need = (need); \ 32 | if (_sz < _need) { \ 33 | if (_sz < 16) _sz = 16; \ 34 | while (_sz < _need) _sz += _sz; \ 35 | (p) = (t *)realloc((p), _sz); \ 36 | if ((p) == NULL) exit(1); \ 37 | (sz) = _sz; \ 38 | } \ 39 | } while(0) 40 | #endif 41 | 42 | #ifndef DASM_M_FREE 43 | #define DASM_M_FREE(ctx, p, sz) free(p) 44 | #endif 45 | 46 | /* Internal DynASM encoder state. */ 47 | typedef struct dasm_State dasm_State; 48 | 49 | 50 | /* Initialize and free DynASM state. */ 51 | DASM_FDEF void dasm_init(Dst_DECL, int maxsection); 52 | DASM_FDEF void dasm_free(Dst_DECL); 53 | 54 | /* Setup global array. Must be called before dasm_setup(). */ 55 | DASM_FDEF void dasm_setupglobal(Dst_DECL, void **gl, unsigned int maxgl); 56 | 57 | /* Grow PC label array. Can be called after dasm_setup(), too. */ 58 | DASM_FDEF void dasm_growpc(Dst_DECL, unsigned int maxpc); 59 | 60 | /* Setup encoder. */ 61 | DASM_FDEF void dasm_setup(Dst_DECL, const void *actionlist); 62 | 63 | /* Feed encoder with actions. Calls are generated by pre-processor. */ 64 | DASM_FDEF void dasm_put(Dst_DECL, int start, ...); 65 | 66 | /* Link sections and return the resulting size. */ 67 | DASM_FDEF int dasm_link(Dst_DECL, size_t *szp); 68 | 69 | /* Encode sections into buffer. */ 70 | DASM_FDEF int dasm_encode(Dst_DECL, void *buffer); 71 | 72 | /* Get PC label offset. */ 73 | DASM_FDEF int dasm_getpclabel(Dst_DECL, unsigned int pc); 74 | 75 | #ifdef DASM_CHECKS 76 | /* Optional sanity checker to call between isolated encoding steps. */ 77 | DASM_FDEF int dasm_checkstep(Dst_DECL, int secmatch); 78 | #else 79 | #define dasm_checkstep(a, b) 0 80 | #endif 81 | 82 | 83 | #endif /* _DASM_PROTO_H */ 84 | --------------------------------------------------------------------------------