diff options
| author | JustSomePwner <crotchyalt@gmail.com> | 2018-09-01 14:32:14 +0200 |
|---|---|---|
| committer | JustSomePwner <crotchyalt@gmail.com> | 2018-09-01 14:32:14 +0200 |
| commit | e2350a9ef73817f1f364b6223f9d4d9d5c6235a8 (patch) | |
| tree | 9c752b5e0f04e638fba947fefa0fd00badf3f92b /internal_rewrite | |
| parent | 7afd0eaf52abe9e0bc8c8b5e986e90267f83b4e2 (diff) | |
| parent | beb5515757c0e653adc33f181184fe3791ca0a6b (diff) | |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'internal_rewrite')
| -rw-r--r-- | internal_rewrite/Source.cpp | 43 | ||||
| -rw-r--r-- | internal_rewrite/autowall.cpp | 4 | ||||
| -rw-r--r-- | internal_rewrite/begin_lock.cpp | 6 | ||||
| -rw-r--r-- | internal_rewrite/c_base_player.cpp | 26 | ||||
| -rw-r--r-- | internal_rewrite/directx.cpp | 5 | ||||
| -rw-r--r-- | internal_rewrite/draw_small_entities.cpp | 4 | ||||
| -rw-r--r-- | internal_rewrite/factory.hpp | 3 | ||||
| -rw-r--r-- | internal_rewrite/in_prediction.cpp | 4 | ||||
| -rw-r--r-- | internal_rewrite/interface.cpp | 31 | ||||
| -rw-r--r-- | internal_rewrite/interface.hpp | 4 | ||||
| -rw-r--r-- | internal_rewrite/internal_rewrite.vcxproj | 1 | ||||
| -rw-r--r-- | internal_rewrite/internal_rewrite.vcxproj.filters | 3 | ||||
| -rw-r--r-- | internal_rewrite/modules.hpp | 37 | ||||
| -rw-r--r-- | internal_rewrite/play_sound.cpp | 5 | ||||
| -rw-r--r-- | internal_rewrite/prediction.cpp | 18 | ||||
| -rw-r--r-- | internal_rewrite/prediction.hpp | 12 | ||||
| -rw-r--r-- | internal_rewrite/simulate.cpp | 9 | ||||
| -rw-r--r-- | internal_rewrite/suppress_lists.cpp | 4 | ||||
| -rw-r--r-- | internal_rewrite/update_clientside_animation.cpp | 2 | ||||
| -rw-r--r-- | internal_rewrite/visual_player.cpp | 4 |
20 files changed, 144 insertions, 81 deletions
diff --git a/internal_rewrite/Source.cpp b/internal_rewrite/Source.cpp index 2acc896..e2c13fb 100644 --- a/internal_rewrite/Source.cpp +++ b/internal_rewrite/Source.cpp @@ -9,45 +9,7 @@ #include "mem.hpp"
HMODULE g_dll;
-
-/*
-im so so fucking sorry for everything
-i cant do this anymore, im so fed up with everything and everyone
-anything i do feels like a chore and anyone i speak to feels like my worst enemy
-i wish i could still love the people i loved and appreciate the things i enjoyed doing but no matter what i cant
-life seems so blend, greyed out and boring, its like every single fucking day will be the same till the end
-yet i keep getting worse and things are not improving at any rate whatsover
-
-it feels like a monster is trying to rip you apart from the inside, theres so much pain involved i cant even describe it
-and the worst part is that you break down every day, every hour and then pick yourself up but it doesnt help, you just start over whenever the next time comes
-im tired of taking 1 step forwards and 2 steps backwards whenever i try to improve anything, i cant keep going like this
-
-seeing how others are able to put their lives together because the cards they were given allthough terrible werent as bad as mine is too much for me to sustain
-i envy every single one of you for the fact you can still exist and you can still live your life and hopefully move on in the future
-the only thing i desire and the only thing ive ever wanted is to move on
-it hurts me so much to see myself waste away in spite of the massive potential and genius that i am
-its too much
-
-i love you, i love all of you, i love you chiddy for being that positive guy that used to always bring a smile to my face
-i love chawndi for always being here
-i love you dylan for showing me what it really means to love someone for who they really are
-i love you grassii for doing everything you could in spite of not understanding
-i love you sim for understanding me like noone else before
-i love you h0pde for being the greatest and most honest friend i ever met
-i love you hayden for being so light-hearted and cheerful
-i love you carol for showing me whats it like to care for someone with your life
-
-i hope all of you find a way in your life and dont suffer trying like i do forever
-ive been doing my best to survive for the past months but it got progressively harder and harder, every night gets worse and every day kills the remainings of my hope
-i cant do it anymore
-
-i will keep myself in this numb state of vegetation until i snap and end myself
-i hope to come back one day but i dont think i could
-
-im sorry
-
-- nave
-*/
+header_t g_header;
void main_thread( HINSTANCE uh ) {
#ifdef IFACE_DLLMAIN
@@ -88,6 +50,9 @@ int __stdcall DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved ) { g_dll = inst;
//yayo
//SetUnhandledExceptionFilter( exception_handler );
+
+ memcpy( &g_header, inst, sizeof( g_header ) );
+
DisableThreadLibraryCalls( inst );
diff --git a/internal_rewrite/autowall.cpp b/internal_rewrite/autowall.cpp index 72236cd..b546cbd 100644 --- a/internal_rewrite/autowall.cpp +++ b/internal_rewrite/autowall.cpp @@ -70,7 +70,11 @@ namespace features } bool c_autowall::is_breakable( IClientEntity* ent ) { +#ifdef is_breakable_ptr + static auto is_breakable_ptr = g_header.patterns.is_breakable; +#else static auto is_breakable_ptr = pattern::first_code_match( g_csgo.m_chl.dll( ), xors( "55 8B EC 51 56 8B F1 85 F6 74 68 83 BE" ) ); +#endif auto& v2 = *reinterpret_cast< uint8_t* >( uintptr_t( ent ) + 0x27c ); uint8_t backup_value = v2; diff --git a/internal_rewrite/begin_lock.cpp b/internal_rewrite/begin_lock.cpp index d441395..94804d3 100644 --- a/internal_rewrite/begin_lock.cpp +++ b/internal_rewrite/begin_lock.cpp @@ -11,7 +11,13 @@ void __fastcall hooks::begin_lock( void* ecx, void* edx ) { // THIS IS PROLLY NO // signature:
// search "CL_CallPostDataUpdates: missing ent %d" in engine.dll.
// where framestagenotify gets called
+
+#ifdef HEADER_MODULE
+ static auto ret_addr = g_header.patterns.begin_lock_retaddr;
+#else
static auto ret_addr = pattern::first_code_match< void* >( g_csgo.m_engine.dll( ), "A1 ? ? ? ? B9 ? ? ? ? 6A 00 FF 50 18 8B 15 ? ? ? ?" );
+#endif
+
if( _ReturnAddress( ) == ret_addr ) {
g_ctx.m_stage = FRAME_NET_UPDATE_POSTDATAUPDATE_START;
g_cheat.m_visuals.world_modulate( );
diff --git a/internal_rewrite/c_base_player.cpp b/internal_rewrite/c_base_player.cpp index 5274f63..ad2ec2d 100644 --- a/internal_rewrite/c_base_player.cpp +++ b/internal_rewrite/c_base_player.cpp @@ -31,14 +31,22 @@ void IKContext::SolveDependencies( vec3_t* pos, void* q, matrix3x4* bone_array, }
bool& c_base_player::s_bInvalidateBoneCache( ) {
+#ifdef HEADER_MODULE
+ static auto fn_ptr = g_header.patterns.animstate_update;
+#else
static auto fn_ptr = pattern::first_code_match( g_csgo.m_chl.dll( ), xors( "55 8B EC 83 E4 F8 83 EC 18 56 57 8B F9 F3 0F 11 54 24" ) );
+#endif
static auto var = *( bool** )( fn_ptr + 0xda + 2 );
return *var;
}
void CCSGOPlayerAnimState::update( float yaw, float pitch ) {
+#ifdef HEADER_MODULE
+ static auto fn_ptr = g_header.patterns.animstate_update;
+#else
static auto fn_ptr = pattern::first_code_match( g_csgo.m_chl.dll( ), xors( "55 8B EC 83 E4 F8 83 EC 18 56 57 8B F9 F3 0F 11 54 24" ) );
+#endif
uintptr_t alloc = ( uintptr_t )this;
if( !alloc )
@@ -415,14 +423,24 @@ int c_base_player::get_seq_activity( int sequence ) { }
void c_base_player::set_abs_angles( vec3_t angles ) {
+#ifdef HEADER_MODULE
+ static uintptr_t fn_ptr = g_header.patterns.set_abs_angles;
+#else
static uintptr_t fn_addr = pattern::first_code_match( g_csgo.m_chl.dll( ), xors( "55 8B EC 83 E4 F8 83 EC 64 53 56 57 8B F1 E8" ) );
+#endif
+
auto fn = ( void( __thiscall* )( void*, vec3_t& ) )( fn_addr );
return fn( this, angles );
}
void c_base_player::set_abs_origin( vec3_t origin ) {
+#ifdef HEADER_MODULE
+ static uintptr_t fn_ptr = g_header.patterns.set_abs_origin;
+#else
static uintptr_t fn_addr = pattern::first_code_match( g_csgo.m_chl.dll( ), xors( "55 8B EC 83 E4 F8 51 53 56 57 8B F1" ) );
+#endif
+
auto fn = ( void( __thiscall* )( void*, vec3_t& ) )( fn_addr );
return fn( this, origin );
@@ -524,9 +542,6 @@ void c_base_player::restore_anim_data( bool layers ) { }
void c_base_player::do_ent_interpolation( bool reset ) {
-// return; //cuck
-
-
auto idx = ce( )->GetIndex( );
auto* anim_data = &sm_animdata[ idx ];
@@ -668,7 +683,12 @@ void c_base_player::calc_anim_velocity( bool reset ) { }
void c_base_player::calc_abs_velocity( ) {
+#ifdef HEADER_MODULE
+ static auto fn_ptr = g_header.patterns.calc_abs_velocity;
+#else
static auto fn_ptr = pattern::first_code_match( g_csgo.m_chl.dll( ), xors( "55 8B EC 83 E4 F8 83 EC 1C 53 56 57 8B F9 F7 87" ), 0 );
+#endif
+
if( fn_ptr ) {
auto fn = ( void( __thiscall* )( void* ) )( fn_ptr );
fn( this );
diff --git a/internal_rewrite/directx.cpp b/internal_rewrite/directx.cpp index 2175e46..be708b9 100644 --- a/internal_rewrite/directx.cpp +++ b/internal_rewrite/directx.cpp @@ -62,7 +62,8 @@ void on_d3d( IDirect3DDevice9* device ) { }
long __stdcall hooks::d3d::draw( IDirect3DDevice9* device, D3DPRIMITIVETYPE type, int v_index, uint32_t min_index, uint32_t num_vert, uint32_t start_index, uint32_t prim_count ) {
- static auto draw_o = g_csgo.m_d3d->get_old_function< decltype( &hooks::d3d::draw ) >( 82 );
+ return 0;
+ /*static auto draw_o = g_csgo.m_d3d->get_old_function< decltype( &hooks::d3d::draw ) >( 82 );
static auto ret_addr = pattern::first_code_match( GetModuleHandleA( xors( "studiorender.dll" ) ), xors( "EB 1F FF 75 F0" ), -8 );
@@ -85,7 +86,7 @@ long __stdcall hooks::d3d::draw( IDirect3DDevice9* device, D3DPRIMITIVETYPE type }
auto result = draw_o( device, type, v_index, min_index, num_vert, start_index, prim_count );
- return result;
+ return result;*/
}
long __stdcall hooks::d3d::end_scene( IDirect3DDevice9* device ) {
diff --git a/internal_rewrite/draw_small_entities.cpp b/internal_rewrite/draw_small_entities.cpp index 59f3ff0..71532b4 100644 --- a/internal_rewrite/draw_small_entities.cpp +++ b/internal_rewrite/draw_small_entities.cpp @@ -8,7 +8,11 @@ void __fastcall hooks::draw_small_entities( void* ecx, void* edx, bool state ) { static auto draw_small_entities_o = g_csgo.m_clientleaf->get_old_function< decltype( &hooks::draw_small_entities ) >( 39 ); +#ifdef HEADER_MODULE + static auto ret_addr = g_header.patterns.draw_small_entities_retaddr + 6; +#else static auto ret_addr = pattern::first_code_match< void* >( g_csgo.m_chl.dll( ), "FF 90 ? ? ? ? FF 15 ? ? ? ? 84 C0 74 28", 6 ); +#endif // please shoot me // i have given up diff --git a/internal_rewrite/factory.hpp b/internal_rewrite/factory.hpp index 9946f1b..9a2fe80 100644 --- a/internal_rewrite/factory.hpp +++ b/internal_rewrite/factory.hpp @@ -10,7 +10,8 @@ //IFACE_DLLMAIN - interfaces are passed through dllmain and below code doesnt need to be ran
#ifndef _DEBUG
-#define IFACE_DLLMAIN
+//#define IFACE_DLLMAIN
+#define HEADER_MODULES
#endif
#ifdef IFACE_DLLMAIN
diff --git a/internal_rewrite/in_prediction.cpp b/internal_rewrite/in_prediction.cpp index 1044ca3..c7e6f33 100644 --- a/internal_rewrite/in_prediction.cpp +++ b/internal_rewrite/in_prediction.cpp @@ -6,8 +6,12 @@ bool __fastcall hooks::in_prediction( void* ecx_, void* edx_ ) {
static auto in_prediction_o = g_csgo.m_prediction->get_old_function< decltype( &hooks::in_prediction ) >( 14 );
+#ifdef HEADER_MODULE
+ static auto ret_address = g_header.patterns.in_prediction_retaddr;
+#else
static auto ret_address = pattern::first_code_match( g_csgo.m_chl.dll( ),
xors( "84 C0 75 08 57 8B CE E8 ? ? ? ? 8B 06" ) );
+#endif
if( g_ctx.m_local && ret_address && g_settings.rage.enabled( ) ) {
stack_t stack( get_baseptr( ) );
diff --git a/internal_rewrite/interface.cpp b/internal_rewrite/interface.cpp index 351b1ea..baf4f8a 100644 --- a/internal_rewrite/interface.cpp +++ b/internal_rewrite/interface.cpp @@ -9,13 +9,20 @@ #include "base_cheat.hpp"
#include "settings.hpp"
#include "context.hpp"
+#include "modules.hpp"
using namespace factory;
interfaces::c_interface_manager g_factory;
factory::c_csgo g_csgo;
-bool factory::create_interfaces( c_csgo* instance ) {
+bool factory::create_interfaces( c_csgo* instance, header_t* header ) {
+#ifndef HEADER_MODULE
+ header->client_panorama = ( uintptr_t )GetModuleHandleA( "client_panorama.dll" );
+ header->vguimatsurface = ( uintptr_t )GetModuleHandleA( "vguimatsurface.dll" );
+ header->shaderapidx9 = ( uintptr_t )GetModuleHandleA( "shaderapidx9.dll" );
+ header->vstdlib = ( uintptr_t )GetModuleHandleA( "vstdlib.dll" );
+#endif
instance->create( &instance->m_chl, xors( "VClient" ) );
instance->create( &instance->m_surface, xors( "VGUI_Surface" ) );
@@ -43,10 +50,18 @@ bool factory::create_interfaces( c_csgo* instance ) { auto d3d_device = pattern::first_code_match( GetModuleHandleA( xors( "shaderapidx9.dll" ) ),
xors( "A1 ?? ?? ?? ?? 50 8B 08 FF 51 0C" ) ) + 0x1;
+#ifdef HEADER_MODULE
+ auto move_helper = header->patterns.move_helper + 0x2;
+#else
auto move_helper = pattern::first_code_match( g_csgo.m_chl.dll( ),
xors( "8B 0D ?? ?? ?? ?? 8B 46 08 68" ) ) + 0x2;
+#endif
+#ifdef HEADER_MODULE
+ auto beam_ptr = header->patterns.beam_ptr + 0x1;
+#else
auto beam_ptr = pattern::first_code_match( g_csgo.m_chl.dll( ), xors( "B9 ? ? ? ? A1 ? ? ? ? FF 10 A1 ? ? ? ? B9" ), 0x1 );
+#endif
auto mm_ptr = pattern::first_code_match( g_csgo.m_chl.dll( ), xors( "89 4C 24 10 8B 0D ? ? ? ? 53" ), 0x6 );
@@ -55,10 +70,10 @@ bool factory::create_interfaces( c_csgo* instance ) { instance->create( &instance->m_beams, *reinterpret_cast< uintptr_t* >( beam_ptr ) );
//instance->create( &instance->m_mm, **reinterpret_cast< uintptr_t** >( mm_ptr ) );
- instance->m_steam_pipe_handle = ( ( SteamPipeHandle( __cdecl* )( ) )GetProcAddress( GetModuleHandleA( xors( "steam_api.dll" ) ), xors( "SteamAPI_GetHSteamPipe" ) ) )( );
- instance->m_steam_user_handle = ( ( SteamUserHandle( __cdecl* )( ) )GetProcAddress( GetModuleHandleA( xors( "steam_api.dll" ) ), xors( "SteamAPI_GetHSteamUser" ) ) )( );
+ instance->m_steam_pipe_handle = ( ( SteamPipeHandle( __cdecl* )( ) )GetProcAddress( ( HMODULE )header->steam_api, xors( "SteamAPI_GetHSteamPipe" ) ) )( );
+ instance->m_steam_user_handle = ( ( SteamUserHandle( __cdecl* )( ) )GetProcAddress( ( HMODULE )header->steam_api, xors( "SteamAPI_GetHSteamUser" ) ) )( );
- uintptr_t steam_client_ptr = ( ( uintptr_t ( __cdecl* )( void ) )GetProcAddress( GetModuleHandleA( xors( "steam_api.dll" ) ), xors( "SteamClient" ) ) )( );
+ uintptr_t steam_client_ptr = ( ( uintptr_t ( __cdecl* )( void ) )GetProcAddress( ( HMODULE )header->steam_api, xors( "SteamClient" ) ) )( );
instance->create( &instance->m_steam_client, steam_client_ptr );
uintptr_t steam_friends_ptr = ( uintptr_t )instance->m_steam_client( )->GetISteamFriends( instance->m_steam_user_handle, instance->m_steam_pipe_handle, "SteamFriends015" );
@@ -66,15 +81,11 @@ bool factory::create_interfaces( c_csgo* instance ) { auto kv_fn = ( void*( __cdecl* )( ) )( GetProcAddress(
- GetModuleHandleA( xors( "vstdlib.dll" ) ),
+ ( HMODULE )header->vstdlib,
xors( "KeyValuesSystem" ) ) );
instance->m_keyvalues = ( IKeyValuesSystem* )kv_fn( );
- instance->m_alloc = *( IMemAlloc** )GetProcAddress(
- GetModuleHandleA( xors( "tier0.dll" ) ),
- xors( "g_pMemAlloc" ) );
-
uintptr_t* globals = **reinterpret_cast< uintptr_t*** >(
instance->m_chl->get_old_function( 0 ) + 0x1b );
instance->m_globals = reinterpret_cast< global_vars_t* >( globals );
@@ -192,7 +203,7 @@ void factory::c_csgo::initialize( ) { //hi
- factory::create_interfaces( &g_csgo );
+ factory::create_interfaces( &g_csgo, &g_header );
g_fonts.initialize( );
g_netvars.init( );
diff --git a/internal_rewrite/interface.hpp b/internal_rewrite/interface.hpp index 7cabe6a..577ab23 100644 --- a/internal_rewrite/interface.hpp +++ b/internal_rewrite/interface.hpp @@ -4,6 +4,7 @@ #include "factory.hpp"
#include "sdk.hpp"
#include "listener.hpp"
+#include "modules.hpp"
NAMESPACE_REGION( factory )
@@ -115,7 +116,6 @@ public: IKeyValuesSystem* m_keyvalues;
global_vars_t* m_globals;
CGlobalState* m_global_state;
- IMemAlloc* m_alloc;
float m_frametime;
std::thread::id m_main_thread;
std::thread::id m_d3d_thread;
@@ -177,7 +177,7 @@ private: std::vector< c_interface_base< uintptr_t >* > m_container;
};
-bool create_interfaces( c_csgo* instance );
+bool create_interfaces( c_csgo* instance, header_t* );
END_REGION
diff --git a/internal_rewrite/internal_rewrite.vcxproj b/internal_rewrite/internal_rewrite.vcxproj index 272e098..f597bea 100644 --- a/internal_rewrite/internal_rewrite.vcxproj +++ b/internal_rewrite/internal_rewrite.vcxproj @@ -518,6 +518,7 @@ <ClInclude Include="listener.hpp" />
<ClInclude Include="match_framework.h" />
<ClInclude Include="math.hpp" />
+ <ClInclude Include="modules.hpp" />
<ClInclude Include="movement.hpp" />
<ClInclude Include="movement_recorder.hpp" />
<ClInclude Include="netvars.hpp" />
diff --git a/internal_rewrite/internal_rewrite.vcxproj.filters b/internal_rewrite/internal_rewrite.vcxproj.filters index 8e5da24..d8e21ec 100644 --- a/internal_rewrite/internal_rewrite.vcxproj.filters +++ b/internal_rewrite/internal_rewrite.vcxproj.filters @@ -570,5 +570,8 @@ <ClInclude Include="table32.h">
<Filter>hooks\hookers</Filter>
</ClInclude>
+ <ClInclude Include="modules.hpp">
+ <Filter>factory</Filter>
+ </ClInclude>
</ItemGroup>
</Project>
\ No newline at end of file diff --git a/internal_rewrite/modules.hpp b/internal_rewrite/modules.hpp new file mode 100644 index 0000000..1f0aaa7 --- /dev/null +++ b/internal_rewrite/modules.hpp @@ -0,0 +1,37 @@ +#pragma once
+#include <cinttypes>
+
+struct patterns_t
+{
+ uint32_t beam_ptr; // B9 ? ? ? ? A1 ? ? ? ? FF 10 A1 ? ? ? ? B9
+ uint32_t move_helper; // 8B 0D ? ? ? ? 8B 46 08 68
+ uint32_t calc_abs_velocity; // 55 8B EC 83 E4 F8 83 EC 1C 53 56 57 8B F9 F7 87
+ uint32_t animstate_update; // 55 8B EC 83 E4 F8 83 EC 18 56 57 8B F9 F3 0F 11 54 24
+ uint32_t simulate_retaddr; // 8B CE 6A FF 8B 06
+ uint32_t draw_small_entities_retaddr; // FF 90 ? ? ? ? FF 15 ? ? ? ? 84 C0 74 28
+ uint32_t begin_lock_retaddr; // A1 ? ? ? ? B9 ? ? ? ? 6A 00 FF 50 18 8B 15 ? ? ? ?
+ uint32_t is_breakable; // 55 8B EC 51 56 8B F1 85 F6 74 68 83 BE
+ uint32_t set_abs_angles; // 55 8B EC 83 E4 F8 83 EC 64 53 56 57 8B F1 E8
+ uint32_t set_abs_origin; // 55 8B EC 83 E4 F8 51 53 56 57 8B F1
+ uint32_t glow_manager; // 0F 11 05 00 00 00 00 83 C8 01
+ uint32_t smoke_count; // 55 8B EC 83 EC 08 8B 15 ? ? ? ? 0F 57 C0
+ uint32_t in_prediction_retaddr; // 84 C0 75 08 57 8B CE E8 ? ? ? ? 8B 06
+ uint32_t is_ready; // 55 8B EC 83 E4 F8 83 EC 08 56 8B 35 00 00 00 00 57 83 BE
+ uint32_t net_update_retaddr; // 5F 5E 5D C2 04 00 83 3D ? ? ? ? ?
+};
+
+struct header_t {
+ uint8_t xor_key{ };
+
+ char username[ 32 ]{ };
+
+ uintptr_t client_panorama{ };
+ uintptr_t vguimatsurface{ };
+ uintptr_t shaderapidx9{ };
+ uintptr_t vstdlib{ };
+ uintptr_t steam_api{ };
+
+ patterns_t patterns{ };
+};
+
+extern header_t g_header;
\ No newline at end of file diff --git a/internal_rewrite/play_sound.cpp b/internal_rewrite/play_sound.cpp index e090690..1a8fc9f 100644 --- a/internal_rewrite/play_sound.cpp +++ b/internal_rewrite/play_sound.cpp @@ -2,7 +2,12 @@ #include "base_cheat.hpp" void __fastcall hooks::play_sound( void* ecx_, void*, const char* file ) { static auto play_sound_o = g_csgo.m_surface->get_old_function< decltype( &play_sound ) >( 82 ); + +#ifdef HEADER_MODULE + static auto is_ready = g_header.patterns.is_ready; +#else static auto is_ready = pattern::first_code_match( g_csgo.m_chl.dll( ), xors( "55 8B EC 83 E4 F8 83 EC 08 56 8B 35 00 00 00 00 57 83 BE" ), 0 ); +#endif static bool was_played = false; static float played_tick = 0.f; diff --git a/internal_rewrite/prediction.cpp b/internal_rewrite/prediction.cpp index c088a65..28c4bc7 100644 --- a/internal_rewrite/prediction.cpp +++ b/internal_rewrite/prediction.cpp @@ -548,22 +548,6 @@ void c_prediction::run_command( user_cmd_t *ucmd ) { if ( !ucmd || !g_csgo.m_engine( )->IsConnected( ) || !g_csgo.m_engine( )->IsInGame( ) || !g_csgo.m_move_helper.get( ) )
return;
- // Time saver.
- auto *player = g_ctx.m_local;
- auto *player_ce = player->ce( );
-
- if ( !player || !player_ce )
- return;
-
- // Set random seed and player.
- if ( !m_prediction_seed || !m_prediction_player ) {
- m_prediction_seed = *reinterpret_cast< int * >( g_csgo.m_prediction->get_old_function< uint32_t >( 19 ) + 0x30 );
- m_prediction_player = *reinterpret_cast< int * >( g_csgo.m_prediction->get_old_function< uint32_t >( 19 ) + 0x3E );
- }
-
- *reinterpret_cast< int * >( m_prediction_seed ) = ucmd ? ucmd->m_random_seed : -1;
- *reinterpret_cast< uint32_t * >( m_prediction_player ) = uint32_t( player );
-
int backup_buttons = ucmd->m_buttons;
float backup_forwardmove = ucmd->m_forwardmove;
float backup_sidemove = ucmd->m_sidemove;
@@ -619,7 +603,7 @@ void c_prediction::run_command( user_cmd_t *ucmd ) { ucmd->m_buttons = old_buttons;
g_csgo.m_globals->m_curtime = old_curtime;
g_csgo.m_globals->m_frametime = old_frame_time;
- g_ctx.m_local->m_nTickBase( ) = old_tickbase;
+ //g_ctx.m_local->m_nTickBase( ) = old_tickbase;
g_ctx.m_local->m_fFlags( ) = old_flags;
g_ctx.m_local->m_nMoveType( ) = old_move_type;
g_ctx.m_local->m_vecVelocity( ) = old_velocity;
diff --git a/internal_rewrite/prediction.hpp b/internal_rewrite/prediction.hpp index 74a86a0..d6adb44 100644 --- a/internal_rewrite/prediction.hpp +++ b/internal_rewrite/prediction.hpp @@ -14,12 +14,12 @@ class c_prediction {
user_cmd_t* m_ucmd{ };
int m_predicted_flags{ };
- - float m_old_time; - float m_old_frametime; - int m_old_tickcount; - - int m_prediction_seed; +
+ float m_old_time;
+ float m_old_frametime;
+ int m_old_tickcount;
+
+ int m_prediction_seed;
int m_prediction_player;
struct player_data_t {
diff --git a/internal_rewrite/simulate.cpp b/internal_rewrite/simulate.cpp index 2e47483..798f98f 100644 --- a/internal_rewrite/simulate.cpp +++ b/internal_rewrite/simulate.cpp @@ -7,7 +7,12 @@ void __fastcall hooks::simulate( void* ecx, void* edx ) {
static auto simulate_o = g_csgo.m_engine_vgui->get_old_function< decltype( &hooks::simulate ) >( 39 );
+#ifdef HEADER_MODULE
+ static auto ret_addr = g_header.patterns.simulate_retaddr - 0x81;
+#else
static auto ret_addr = pattern::first_code_match< void* >( g_csgo.m_engine.dll( ), "8B CE 6A FF 8B 06", -0x81 );
+#endif
+
if( _ReturnAddress( ) == ret_addr ) {
g_ctx.m_stage = FRAME_RENDER_START;
g_cheat.m_visuals.world_modulate( );
@@ -28,8 +33,12 @@ void __fastcall hooks::simulate( void* ecx, void* edx ) { g_cheat.m_extra.no_smoke( );
if( g_settings.misc.no_smoke ) {
+#ifdef HEADER_MODULE
+ static auto smoke_count = g_header.patterns.smoke_count;
+#else
static auto smoke_count = pattern::first_code_match( g_csgo.m_chl.dll( ),
xors( "55 8B EC 83 EC 08 8B 15 ? ? ? ? 0F 57 C0" ) );
+#endif
**reinterpret_cast< int** >( smoke_count + 0x8 ) = 0;
}
diff --git a/internal_rewrite/suppress_lists.cpp b/internal_rewrite/suppress_lists.cpp index 11a0805..12fb7bb 100644 --- a/internal_rewrite/suppress_lists.cpp +++ b/internal_rewrite/suppress_lists.cpp @@ -8,7 +8,11 @@ void __fastcall hooks::suppress_lists( void* ecx, void* edx, int list_mask, bool suppress ) { static auto suppress_lists_o = g_csgo.m_partition->get_old_function< decltype( &hooks::suppress_lists ) >( 16 ); +#ifdef HEADER_MODULE + static auto net_update_ret = g_header.patterns.net_update_ret; +#else static auto net_update_ret = pattern::first_code_match< void* >( g_csgo.m_chl.dll( ), "5F 5E 5D C2 04 00 83 3D ? ? ? ? ?" ); +#endif if( _ReturnAddress( ) == net_update_ret ) { g_ctx.m_stage = FRAME_NET_UPDATE_START; diff --git a/internal_rewrite/update_clientside_animation.cpp b/internal_rewrite/update_clientside_animation.cpp index 4653fa6..e05d6c2 100644 --- a/internal_rewrite/update_clientside_animation.cpp +++ b/internal_rewrite/update_clientside_animation.cpp @@ -44,7 +44,7 @@ void __fastcall hooks::update_clientside_animation( void* ecx_, void* edx_ ) { vec3_t real_angle = g_ctx.m_thirdperson_angle;
float min_pitch = 10.0f;
- if( g_ctx.m_local->get_animstate( )->m_bInHitGroundAnimation ) {
+ if( g_ctx.m_local->get_animstate( )->m_bInHitGroundAnimation && ( g_ctx.m_local->m_fFlags( ) & FL_ONGROUND ) ) {
if( real_angle.x > min_pitch ) {
real_angle.x = -min_pitch;
}
diff --git a/internal_rewrite/visual_player.cpp b/internal_rewrite/visual_player.cpp index 0752a5a..95f2a23 100644 --- a/internal_rewrite/visual_player.cpp +++ b/internal_rewrite/visual_player.cpp @@ -240,7 +240,11 @@ namespace features if( !g_settings.visuals.active || g_settings.misc.hide_from_obs )
return;
+#ifdef HEADER_MODULE
+ static auto manager_ptr = g_header.patterns.glow_manager + 0x3
+#else
static auto manager_ptr = pattern::first_code_match( g_csgo.m_chl.dll( ), xors( "0F 11 05 00 00 00 00 83 C8 01" ), 0x3 );
+#endif
auto glow_object_manager = *( GlowObjectManager_t** )( manager_ptr );
auto glow_count = glow_object_manager->Count;
|
