summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorboris <wzn@moneybot.cc>2018-12-24 20:39:16 +1300
committerboris <wzn@moneybot.cc>2018-12-24 20:39:16 +1300
commitcac146640ad99309329119ceb264542de12bc9aa (patch)
treec853c09991593b60b0249e4a237bb898432c220c
parentace9ae2117175dfe5e14b259db2e0536f8ec7a8a (diff)
parentf41bf6509390f12a4252f40daf0209e7a7d64666 (diff)
Merge remote-tracking branch 'origin/master'
-rw-r--r--cheat/internal_rewrite/begin_lock.cpp2
-rw-r--r--cheat/internal_rewrite/c_base_player.cpp18
-rw-r--r--cheat/internal_rewrite/c_base_player.hpp16
-rw-r--r--cheat/internal_rewrite/context.cpp4
-rw-r--r--cheat/internal_rewrite/lag_mgr.cpp26
-rw-r--r--cheat/internal_rewrite/ragebot.hpp1
-rw-r--r--cheat/internal_rewrite/ragebot_antiaim.cpp63
-rw-r--r--cheat/internal_rewrite/ui.h7
-rw-r--r--cheat/internal_rewrite/update_clientside_animation.cpp15
9 files changed, 88 insertions, 64 deletions
diff --git a/cheat/internal_rewrite/begin_lock.cpp b/cheat/internal_rewrite/begin_lock.cpp
index 5312eec..fb4bdf1 100644
--- a/cheat/internal_rewrite/begin_lock.cpp
+++ b/cheat/internal_rewrite/begin_lock.cpp
@@ -58,7 +58,7 @@ void __fastcall hooks::begin_lock( void* ecx, void* edx ) { // THIS IS PROLLY NO
g_cheat.m_player_mgr.frame_stage_notify( );
g_cheat.m_prediction.frame_stage_notify( );
- g_cheat.m_ragebot.m_resolver->frame_stage_notify( );
+ //g_cheat.m_ragebot.m_resolver->frame_stage_notify( );
g_cheat.m_ragebot.m_lagcomp->fsn_render_start( );
g_cheat.m_skins( );
}
diff --git a/cheat/internal_rewrite/c_base_player.cpp b/cheat/internal_rewrite/c_base_player.cpp
index 30044db..d0c8272 100644
--- a/cheat/internal_rewrite/c_base_player.cpp
+++ b/cheat/internal_rewrite/c_base_player.cpp
@@ -614,8 +614,8 @@ void c_base_player::do_ent_interpolation( bool reset ) {
if( !isfinite( vec_lerp[ i ] ) )
return;
- byte backup = *( byte* )( uintptr_t( this ) + 0x270 );
- *( byte* )( uintptr_t( this ) + 0x270 ) = 0;
+ byte backup = *( byte* )( uintptr_t( this ) + 0x274 );
+ *( byte* )( uintptr_t( this ) + 0x274 ) = 0;
restore_anim_data( true );
@@ -627,14 +627,14 @@ void c_base_player::do_ent_interpolation( bool reset ) {
ce( )->SetupBones( nullptr, -1, BONE_USED_BY_ANYTHING, g_csgo.m_globals->m_curtime );
this->m_iMostRecentModelBoneCounter( )++;
- *( byte* )( uintptr_t( this ) + 0x270 ) = backup;
+ *( byte* )( uintptr_t( this ) + 0x274 ) = backup;
}
void c_base_player::validate_animation_layers( ) {
for( size_t i{ }; i < m_AnimOverlay( ).GetSize( ); ++i ) {
auto& layer = m_AnimOverlay( ).GetElements( )[ i ];
layer.m_flCycle = std::clamp( layer.m_flCycle, 0.f, 1.f );
- layer.m_flWeight = std::clamp( layer.m_flWeight, 0.f, 1.f );
+ //layer.m_flWeight = std::clamp( layer.m_flWeight, 0.f, 1.f );
layer.m_player = this;
}
@@ -864,7 +864,7 @@ void c_base_player::fix_animations( bool reset, bool resolver_change ) {
get_animstate( )->m_flGoalFeetYaw = get_animstate( )->m_flCurrentFeetYaw = feet_yaw;
}*/
- get_animstate( )->m_flFeetYawRate = 0.f;
+ //get_animstate( )->m_flFeetYawRate = 0.f;
//why?
//because this calls pAttachmentHelper->CalcAbsVelocity
@@ -1001,13 +1001,13 @@ void c_base_player::fix_animations( bool reset, bool resolver_change ) {
m_angEyeAngles( ) = eye_angles;
m_flDuckAmount( ) = original_duck;
- get_animstate( )->m_flUnknownFraction = 0.f;
+ //get_animstate( )->m_flUnknownFraction = 0.f;
//clear occlusion for setupbones (pvs fix)
*( int* )( uintptr_t( this ) + 0xa30 ) = 0;
- byte backup = get< byte >( 0x270 );
- get< byte >( 0x270 ) = 0;
+ byte backup = get< byte >( 0x274 );
+ get< byte >( 0x274 ) = 0;
invalidate_bone_cache( );
ce( )->SetupBones( nullptr, -1, BONE_USED_BY_ANYTHING, anim_time );
@@ -1022,7 +1022,7 @@ void c_base_player::fix_animations( bool reset, bool resolver_change ) {
//disable animations again
m_bClientSideAnimation( ) = false;
- get< byte >( 0x270 ) = backup;
+ get< byte >( 0x274 ) = backup;
}
player_info_t c_base_player::get_info( ) {
diff --git a/cheat/internal_rewrite/c_base_player.hpp b/cheat/internal_rewrite/c_base_player.hpp
index 690f55c..7eeb9d3 100644
--- a/cheat/internal_rewrite/c_base_player.hpp
+++ b/cheat/internal_rewrite/c_base_player.hpp
@@ -263,7 +263,7 @@ public:
NETVAR( m_vecOrigin, "m_vecOrigin", "DT_BaseEntity", 0, vec3_t );
NETVAR( m_vecViewOffset, "m_vecViewOffset[0]", "DT_BasePlayer", 0, vec3_t );
NETVAR( m_hActiveWeapon, "m_hActiveWeapon", "DT_BaseCombatCharacter", 0, ulong_t );
- NETVAR( m_iTeamNum, "m_iTeamNum", "DT_BaseEntity", 0, int );
+
NETVAR( m_bHasHelmet, "m_bHasHelmet", "DT_CSPlayer", 0, bool );
NETVAR( m_bHasDefuser, "m_bHasDefuser", "DT_CSPlayer", 0, bool );
NETVAR( m_ArmorValue, "m_ArmorValue", "DT_CSPlayer", 0, int );
@@ -347,6 +347,20 @@ public:
return util::get_vfunc< 187, void >( this, curtime );
}
+ __forceinline int& m_iTeamNum( ) {
+ static auto team_num = g_netvars.get_netvar( fnv( "DT_BaseEntity" ), fnv( "m_iTeamNum" ) );
+ static auto survival_team = g_netvars.get_netvar( fnv( "DT_CSPlayer" ), fnv( "m_nSurvivalTeam" ) );
+
+ //char name[ 32 ];
+ //get_name_safe( name );
+
+ //printf( "%s: %d (%08x)\n", name, get< int >( survival_team ), survival_team );
+ if( get< int >( survival_team ) != -1 )
+ return get< int >( survival_team );
+
+ return get< int >( team_num );
+ }
+
__forceinline void standard_blending_rules( void* hdr, vec3_t* pos, void* q, float curtime, int bone_mask ) {
return util::get_vfunc< 200, void >( this, hdr, pos, q, curtime, bone_mask );
}
diff --git a/cheat/internal_rewrite/context.cpp b/cheat/internal_rewrite/context.cpp
index cec25ba..4de1479 100644
--- a/cheat/internal_rewrite/context.cpp
+++ b/cheat/internal_rewrite/context.cpp
@@ -30,8 +30,8 @@ void c_context::on_cmove_end( user_cmd_t* cmd ) {
//m_last_realangle.x = m_last_fakeangle.x;
}
- if( g_cheat.m_lagmgr.get_choked( ) == 1 ) {
- m_thirdperson_angle = m_last_realangle;
+ if( !g_cheat.m_lagmgr.get_state( ) ) {
+ m_thirdperson_angle = cmd->m_viewangles;
}
m_thirdperson_angle.x = std::clamp( cmd->m_viewangles.x, -89.f, 89.f );
diff --git a/cheat/internal_rewrite/lag_mgr.cpp b/cheat/internal_rewrite/lag_mgr.cpp
index 8f293e7..3606500 100644
--- a/cheat/internal_rewrite/lag_mgr.cpp
+++ b/cheat/internal_rewrite/lag_mgr.cpp
@@ -51,8 +51,12 @@ namespace features
//2017 sucked
//i hope 2018 goes better
- if( !g_settings.rage.fakelag.mode( ) ||
- !g_settings.rage.fakelag.ticks( ) ) {
+ //2018 sucked
+ //but 2019 will be better
+
+ if( ( !g_settings.rage.fakelag.mode( ) ||
+ !g_settings.rage.fakelag.ticks( ) ) &&
+ !g_settings.rage.fake_yaw ) {
m_breaking_lc = false;
return;
}
@@ -63,9 +67,9 @@ namespace features
auto weapon = g_ctx.m_local->get_weapon( );
- if( g_cheat.m_ragebot.m_antiaim->is_fakewalking( ) ) {
- return;
- }
+ //if( g_cheat.m_ragebot.m_antiaim->is_fakewalking( ) ) {
+ // return;
+ //}
bool moving = g_ctx.m_local->m_vecVelocity( ).length2d( ) > 0.f;
@@ -88,9 +92,13 @@ namespace features
max_ticks = math::min( max_ticks, 16 );
+ bool force_send = m_held_ticks >= max_ticks;
+ bool send = true;
+ if( !moving && ( g_ctx.m_local->m_fFlags( ) & FL_ONGROUND ) && g_settings.rage.anti_aim( ) && g_settings.rage.fake_yaw ) {
+ send = force_send = get_choked( ) >= math::max( max_ticks, 10 );
+ }
- bool force_send = m_held_ticks >= max_ticks;
if( settings.mode == 1 ) {
if( delta.length2dsqr( ) > 4096.f ) {
force_send = get_choked( ) > 3;
@@ -115,7 +123,8 @@ namespace features
}
}
- bool send = true;
+
+
static bool was_onground{ };
if( settings.in_move && ( g_ctx.m_local->m_fFlags( ) & FL_ONGROUND ) && moving ) {
@@ -206,7 +215,8 @@ namespace features
}
}
- *m_sendpacket = !( get_choked( ) < 10 );
+ *m_sendpacket = send || force_send;
+
if( *m_sendpacket ) {
m_breaking_lc = delta.length2d( ) > 64.f;
last_rand = ( 1.f + math::random_number( -settings.fluctuate, settings.fluctuate( ) ) * 0.01f );
diff --git a/cheat/internal_rewrite/ragebot.hpp b/cheat/internal_rewrite/ragebot.hpp
index 7bc6c24..c9eb4f2 100644
--- a/cheat/internal_rewrite/ragebot.hpp
+++ b/cheat/internal_rewrite/ragebot.hpp
@@ -118,6 +118,7 @@ namespace features
bool run_freestanding( int player = -1 );
bool run_edge_dtc( );
+ float desync_delta( );
public:
bool is_fakewalking( ) const { return m_is_fakewalking; }
diff --git a/cheat/internal_rewrite/ragebot_antiaim.cpp b/cheat/internal_rewrite/ragebot_antiaim.cpp
index b109328..4e7f185 100644
--- a/cheat/internal_rewrite/ragebot_antiaim.cpp
+++ b/cheat/internal_rewrite/ragebot_antiaim.cpp
@@ -86,6 +86,23 @@ namespace features
}*/
+ float c_ragebot::c_antiaim::desync_delta( ) {
+ auto state = g_ctx.m_local->get_animstate( );
+
+ float duck_amt = state->m_fDuckAmount;
+ float speed_fraction = std::clamp( state->m_flFeetSpeedForwardsOrSideWays, 0.f, 1.f );
+ float speed_factor = std::clamp( state->m_flFeetSpeedUnknownForwardOrSideways, 0.f, 1.f );
+
+ float unk = ( *( float* )( uintptr_t( state ) + 0x11c ) * -0.30000001f - 0.19999999f ) * speed_fraction + 1.f;
+ if( duck_amt > 0.f )
+ unk += ( ( duck_amt * speed_factor ) * ( 0.5f - unk ) );
+
+ //not exact but who cares
+ float max_delta = 57.5f * unk;
+
+ return max_delta;
+ }
+
void c_ragebot::c_lby_breaker::update_animstate( ) {
if( !g_settings.rage.anti_aim( ) )
return;
@@ -119,7 +136,11 @@ namespace features
g_ctx.m_local->get_animstate( )->m_iLastClientSideAnimationUpdateFramecount -= 1;
g_ctx.m_local->get_animstate( )->update( real_angle.y, real_angle.x );
- g_ctx.m_local->cache_anim_data( );
+
+ if( !g_cheat.m_lagmgr.get_state( ) ) {
+ g_ctx.m_absyaw = g_ctx.m_local->get_animstate( )->m_flGoalFeetYaw;
+ g_ctx.m_local->cache_anim_data( );
+ }
g_csgo.m_globals->m_curtime = backup_curtime;
g_csgo.m_globals->m_frametime = backup_frametime;
@@ -208,7 +229,7 @@ namespace features
}
if( std::abs( offset ) < 105 ) {
- int min_tick = g_cheat.m_ragebot.m_antiaim->is_fakewalking( ) ? g_settings.rage.fakewalk_ticks( ) + 2 : 4;
+ int min_tick = 3;
if( update_ticks < min_tick && update_ticks >= 1 ) {
*angles = break_angle + ( offset < 0 ? 105 : -105 );
return;
@@ -537,11 +558,7 @@ namespace features
}
if( is_fake ) {
- int jitter = g_settings.rage.edge_dtc_jitter;
- if( jitter ) {
- aim_angle.y += math::random_number< float >( -jitter, jitter );
- }
- aim_angle.y -= 180.f;
+ aim_angle.y -= desync_delta( );
}
else {
int jitter = g_settings.rage.edge_dtc_real_jitter;
@@ -793,6 +810,10 @@ namespace features
float step = float( g_settings.rage.angle_step_degrees( ) );
original = math::find_closest_step( original, step );
}
+
+ if( is_fake && g_ctx.m_local->m_fFlags( ) & FL_ONGROUND )
+ return g_ctx.m_last_realangle.y - desync_delta( );
+
return get_yaw( is_fake, original, no_jitter );
}
@@ -874,32 +895,10 @@ namespace features
freestanding = run_freestanding( );
}
- m_is_edging = freestanding || edge_detected;
-
- if( g_settings.rage.break_lby( ) && ( !m_is_edging || g_settings.rage.break_lby_edge ) ) {
- float yaw;
-
- if( m_is_edging ) {
- auto target = util::get_closest_player( );
- if( target != -1 ) {
- auto ent = g_csgo.m_entlist( )->GetClientEntity< >( target );
-
- vec3_t ang = math::vector_angles(
- ent->m_vecOrigin( ),
- g_ctx.m_local->m_vecOrigin( ) );
-
- yaw = std::remainderf( ang.y + ( m_direction ? -90.f : 90.f ), 360.f );
- }
- }
- else {
- yaw = get_yaw( true );
- }
+ if( m_breaker.get_next_update( ) < 0 && !g_cheat.m_lagmgr.get_state( ) )
+ m_cmd->m_viewangles.y = g_ctx.m_last_realangle.y + 115.f;
- m_breaker.override_angles( &m_cmd->m_viewangles.y,
- yaw,
- std::remainderf( 180.f - float( g_settings.rage.lby_delta ), 360.f ),
- freestanding );
- }
+ m_is_edging = freestanding || edge_detected;
if( g_cheat.m_lagmgr.get_state( ) && !g_settings.rage.fake_yaw( ) )
m_cmd->m_viewangles.y = g_csgo.m_engine( )->GetViewAngles( ).y;
diff --git a/cheat/internal_rewrite/ui.h b/cheat/internal_rewrite/ui.h
index 9a32603..073a980 100644
--- a/cheat/internal_rewrite/ui.h
+++ b/cheat/internal_rewrite/ui.h
@@ -879,13 +879,6 @@ namespace ui
static auto jitter_air = menu->find_item( xors( "in-air yaw jitter" ) );
jitter_air->set_text( g_settings.rage.air_yaw == 2 ? xors( "spin range" ) : xors( "in-air yaw jitter" ) );
- static auto fakeping_form = menu->find_item( xors( "fake latency" ) );
-
- auto game_rules = c_base_player::get_game_rules( );
- if( game_rules ) {
- fakeping_form->set_visible( !*( bool* )( game_rules + 0x75 ) );
- }
-
render_item( menu.get( ) );
// This was annoying me so I decided to remove it in Release mode.
diff --git a/cheat/internal_rewrite/update_clientside_animation.cpp b/cheat/internal_rewrite/update_clientside_animation.cpp
index 9a0dd2b..243d760 100644
--- a/cheat/internal_rewrite/update_clientside_animation.cpp
+++ b/cheat/internal_rewrite/update_clientside_animation.cpp
@@ -29,14 +29,19 @@ void __fastcall hooks::update_clientside_animation( void* ecx_, void* edx_ ) {
last_update = g_csgo.m_globals->m_curtime;
ent->get_animstate( )->m_iLastClientSideAnimationUpdateFramecount = g_csgo.m_globals->m_framecount;
+
+ float backup_time = ent->get_animstate( )->m_flLastClientSideAnimationUpdateTime;
+
+ ent->get_animstate( )->m_flLastClientSideAnimationUpdateTime = g_csgo.m_globals->m_curtime;
old_func( ecx_, edx_ );
+ ent->get_animstate( )->m_flLastClientSideAnimationUpdateTime = backup_time;
+
if( !first_update ) {
g_ctx.m_local->restore_anim_data( true );
- ent->set_abs_angles( vec3_t( 0, ent->get_animstate( )->m_flGoalFeetYaw, 0 ) );
- bool backup = ent->get_animstate( )->m_bOnGround;
- ent->get_animstate( )->m_bOnGround = false;
+ ent->set_abs_angles( vec3_t( 0, g_ctx.m_absyaw, 0 ) );
+ //ent->get_animstate( )->m_bOnGround = false;
ent->invalidate_bone_cache( );
@@ -52,8 +57,10 @@ void __fastcall hooks::update_clientside_animation( void* ecx_, void* edx_ ) {
}
}
+ byte backup = ent->get< byte >( 0x274 );
+ ent->get< byte >( 0x274 ) = 0;
ent->ce( )->SetupBones( nullptr, 128, BONE_USED_BY_ANYTHING, 0.f );
- ent->get_animstate( )->m_bOnGround = backup;
+ ent->get< byte >( 0x274 ) = backup;
}
first_update = false;