summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornavewindre <boneyaard@gmail.com>2018-09-11 00:27:00 +0200
committernavewindre <boneyaard@gmail.com>2018-09-11 00:27:00 +0200
commit4a53204965489d24725631ce4997c596c9205a21 (patch)
treeb163e7179abfedc4037c3d88cd26abc6ef9494a6
parentb82a9e7a4cd698a9a75dd86fffb091b022061937 (diff)
a
-rw-r--r--internal_rewrite/c_base_player.cpp3
-rw-r--r--internal_rewrite/extra.cpp20
-rw-r--r--internal_rewrite/factory.hpp2
-rw-r--r--internal_rewrite/hooks.cpp11
-rw-r--r--internal_rewrite/in_prediction.cpp1
-rw-r--r--internal_rewrite/ragebot.cpp309
-rw-r--r--internal_rewrite/ragebot.hpp2
7 files changed, 180 insertions, 168 deletions
diff --git a/internal_rewrite/c_base_player.cpp b/internal_rewrite/c_base_player.cpp
index 348c961..791b0ed 100644
--- a/internal_rewrite/c_base_player.cpp
+++ b/internal_rewrite/c_base_player.cpp
@@ -587,12 +587,11 @@ void c_base_player::do_ent_interpolation( bool reset ) {
if( update_delta > 0.f )
lerp = std::clamp( lerp, 0.f, update_delta );
- vec3_t cur_vec = math::lerp( anim_data->m_last_interp_origin, origin, update_lerp / update_delta );
float lerp_progress = ( anim_data->m_simtime + lerp - g_csgo.m_globals->m_curtime ) / lerp;
if( lerp_progress < 0.f && update_delta == TICK_INTERVAL( ) )
lerp_progress = 1.f + lerp_progress;
- vec3_t vec_lerp = math::lerp( origin, cur_vec, std::clamp( lerp_progress, 0.f, 1.f ) );
+ vec3_t vec_lerp = math::lerp( origin, anim_data->m_last_interp_origin, std::clamp( lerp_progress, 0.f, 1.f ) );
for( size_t i{ }; i < 3; ++i )
if( !isfinite( vec_lerp[ i ] ) )
diff --git a/internal_rewrite/extra.cpp b/internal_rewrite/extra.cpp
index fa0882a..fb8564a 100644
--- a/internal_rewrite/extra.cpp
+++ b/internal_rewrite/extra.cpp
@@ -109,26 +109,6 @@ namespace features
g_settings.misc.net_fakeping_active = false;
break;
}
-
- static bool enabled = false;
- auto clientstate = g_csgo.m_global_state->get_client_state( );
- if( clientstate && !enabled ) {
- // TODO: Change this to the non-homosexual way of hooking CNetChan functions.
- // Actually, I'm too lazy. You can do this if you want.
- /*
- auto *base_net_channel = *memory::find_signature< uint32_t ** >( g_cl.m_engine.dll( ), "C7 07 ? ? ? ? E8 ? ? ? ? 83 BF", 2 );
-
- VirtualProtect( &base_net_channel [ 46 ], 4, PAGE_EXECUTE_READWRITE, &o_prot );
- hooked::o_send_datagram = ( decltype( hooked::o_send_datagram ) ) base_net_channel [ 46 ];
- base_net_channel [ 46 ] = uint32_t( hooked::send_datagram );
- VirtualProtect( &base_net_channel [ 46 ], 4, o_prot, &o_prot );
- */
- auto netchannel = clientstate->m_netchannel;
- if( netchannel ) {
- hooks::send_datagram_o = memory::detours.create_hook( &hooks::send_datagram, g_csgo.m_net_channel->get_old_function< void* >( 46 ) );
- enabled = true;
- }
- }
}
void c_extra::add_latency( INetChannel* channel ) {
diff --git a/internal_rewrite/factory.hpp b/internal_rewrite/factory.hpp
index d197951..c81c79b 100644
--- a/internal_rewrite/factory.hpp
+++ b/internal_rewrite/factory.hpp
@@ -11,7 +11,7 @@
//IFACE_DLLMAIN - interfaces are passed through dllmain and below code doesnt need to be ran
#ifndef _DEBUG
//#define IFACE_DLLMAIN
-//#define HEADER_MODULE
+#define HEADER_MODULE
#endif
#ifdef IFACE_DLLMAIN
diff --git a/internal_rewrite/hooks.cpp b/internal_rewrite/hooks.cpp
index cc0cd44..94d2cdb 100644
--- a/internal_rewrite/hooks.cpp
+++ b/internal_rewrite/hooks.cpp
@@ -1,6 +1,7 @@
#include "hooks.hpp"
#include "interface.hpp"
#include "detours.h"
+#include "wipe.hpp"
//god i'm so cool
namespace hooks {
@@ -38,6 +39,8 @@ hooks::c_netvar_proxy hooks::last_shot_proxy;
hooks::c_netvar_proxy hooks::simtime_proxy;
bool hooks::commit( factory::c_csgo* instance ) {
+ DELETE_START( 5 );
+
while ( !( instance->m_hwnd = FindWindowA( xors( "Valve001" ), 0 ) ) )
Sleep( 100 );
@@ -86,7 +89,15 @@ bool hooks::commit( factory::c_csgo* instance ) {
begin_lock_o = d->create_hook( &hooks::begin_lock, instance->m_mdl_cache->get_old_function< void* >( 33 ) );
end_lock_o = d->create_hook( &hooks::end_lock, instance->m_mdl_cache->get_old_function< void* >( 34 ) );
+ auto update_clientside_anim = pattern::first_code_match< void* >( instance->m_chl.dll( ), xors( "55 8B EC 51 56 8B F1 80 BE ? ? ? ? ? 74 36" ) );
+ update_clientside_animation_o = d->create_hook( &hooks::update_clientside_animation, update_clientside_anim );
+
+ auto send_datagram = pattern::first_code_match< void* >( instance->m_engine.dll( ), xors( "55 8B EC 83 E4 F0 B8 ? ? ? ? E8 ? ? ? ? 56 57 8B F9 89 7C 24 18" ) );
+ send_datagram_o = d->create_hook( &hooks::send_datagram, send_datagram );
+
d->enable( );
return true;
+
+ DELETE_END( 5 );
}
diff --git a/internal_rewrite/in_prediction.cpp b/internal_rewrite/in_prediction.cpp
index c7e6f33..3123d06 100644
--- a/internal_rewrite/in_prediction.cpp
+++ b/internal_rewrite/in_prediction.cpp
@@ -5,7 +5,6 @@
#undef max
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
diff --git a/internal_rewrite/ragebot.cpp b/internal_rewrite/ragebot.cpp
index 1638a55..f458bdc 100644
--- a/internal_rewrite/ragebot.cpp
+++ b/internal_rewrite/ragebot.cpp
@@ -675,186 +675,193 @@ namespace features
return -1;
}
- c_ragebot::aim_target_t c_ragebot::find_best_target( ) {
- aim_target_t ret{ -1, m_cmd->m_tick_count, -1, vec3_t{ }, vec3_t{ }, vec3_t{ }, 0.f, 0 };
- vec3_t aim_angle{ };
- vec3_t local_pos{ };
- vec3_t aim_pos{ };
- auto weapon_info = g_ctx.m_local->get_weapon( )->get_wpn_info( );
- bool is_zeus = g_ctx.m_local->get_weapon( )->m_iItemDefinitionIndex( ) == WEAPON_TASER;
- int damage = weapon_info->damage;
+ bool c_ragebot::can_hit_target( int it, aim_target_t* ret, bool zeus ) {
+ vec3_t aim_ang;
+ vec3_t aim_pos;
+ vec3_t local_pos = g_ctx.m_local->get_eye_pos( );
- local_pos = g_ctx.m_local->get_eye_pos( );
+ auto entity = g_csgo.m_entlist( )->GetClientEntity< >( it );
+ if( !entity || !entity->is_valid( ) || entity == g_ctx.m_local )
+ return false;
+ if( entity->m_bGunGameImmunity( ) )
+ return false;
+ if( !entity->has_valid_anim( ) )
+ return false;
- auto players = get_sorted_targets( );
- auto data = players.data( );
+ bool baim = false;
+ bool should_baim = true;
+ bool backtracked = false;
+ bool restore = false;
+ float hit_damage = 0.f;
+ vec3_t extrapolate{ };
- for( size_t i{ }; i < players.size( ); ++i ) {
- auto& it = data[ i ];
-
- auto entity = g_csgo.m_entlist( )->GetClientEntity< >( it );
- if( !entity || !entity->is_valid( ) || entity == g_ctx.m_local ) continue;
- if( entity->m_bGunGameImmunity( ) ) continue;
- if( !entity->has_valid_anim( ) ) continue;
-
- bool baim = false;
- bool should_baim = true;
- bool backtracked = false;
- bool restore = false;
- float hit_damage = 0.f;
- vec3_t extrapolate{ };
-
- lag_record_t original_record( entity );
- lag_record_t* backtracked_record{ };
-
- int tick_count = m_cmd->m_tick_count;
- float lerp = util::get_lerptime( );
- auto record_type = m_lagcomp->can_backtrack_entity( it );
- if( !g_settings.rage.resolver( ) ) {
- if( !util::is_tick_valid( entity->m_flSimulationTime( ) + lerp ) ) {
- int new_tickcount = m_lagcomp->backtrack_entity( it,
- record_type, &backtracked_record );
-
- if( new_tickcount != -1 ) {
- restore = true;
- tick_count = new_tickcount;
- }
- else if( g_settings.misc.net_fakelag == 4 && can_hit_without_ping( it ) ) {
- m_can_fakeping = false;
- }
+ lag_record_t original_record( entity );
+ lag_record_t* backtracked_record{ };
+
+ int tick_count = m_cmd->m_tick_count;
+ float lerp = util::get_lerptime( );
+ auto record_type = m_lagcomp->can_backtrack_entity( it );
+ if( !g_settings.rage.resolver( ) ) {
+ if( !util::is_tick_valid( entity->m_flSimulationTime( ) + lerp ) ) {
+ int new_tickcount = m_lagcomp->backtrack_entity( it,
+ record_type, &backtracked_record );
+
+ if( new_tickcount != -1 ) {
+ restore = true;
+ tick_count = new_tickcount;
+ }
+ else if( g_settings.misc.net_fakelag == 4 && can_hit_without_ping( it ) ) {
+ m_can_fakeping = false;
}
}
+ }
+ else {
+ int new_tickcount = m_lagcomp->backtrack_entity( it, record_type, &backtracked_record );
+ if( new_tickcount != -1 ) {
+ tick_count = new_tickcount;
+ should_baim = record_type != RECORD_LBY;
+ backtracked = record_type == RECORD_LBY;
+ restore = true;
+ }
else {
- int new_tickcount = m_lagcomp->backtrack_entity( it, record_type, &backtracked_record );
- if( new_tickcount != -1 ) {
- tick_count = new_tickcount;
- should_baim = record_type != RECORD_LBY;
- backtracked = record_type == RECORD_LBY;
- restore = true;
+ if( g_settings.misc.net_fakelag == 4 ) {
+ //if( can_hit_without_ping( it ) )
+ // m_can_fakeping = false;
}
- else {
- if( g_settings.misc.net_fakelag == 4 ) {
- //if( can_hit_without_ping( it ) )
- // m_can_fakeping = false;
- }
- lag_record_t* last_simtime_record = m_lagcomp->get_newest_valid_record( it );
- if( last_simtime_record ) {
- //ENSURE THE MOST ACCURATE DATA
- entity->m_vecVelocity( ) = entity->get_animdata( ).m_last_velocity;
-
- auto velocity = entity->m_vecVelocity( );
- auto min_vel = 64 / TICK_INTERVAL( ) / 14;
+ lag_record_t* last_simtime_record = m_lagcomp->get_newest_valid_record( it );
+ if( last_simtime_record ) {
+ //ENSURE THE MOST ACCURATE DATA
+ entity->m_vecVelocity( ) = entity->get_animdata( ).m_last_velocity;
+
+ auto velocity = entity->m_vecVelocity( );
+ auto min_vel = 64 / TICK_INTERVAL( ) / 14;
- //IS HE A SLOW BOI OR A FAST NIGGER
- if( g_settings.rage.fakelag_resolver( ) && velocity.length2d( ) > min_vel - 10.f ) {
- auto new_record = *last_simtime_record;
+ //IS HE A SLOW BOI OR A FAST NIGGER
+ if( g_settings.rage.fakelag_resolver( ) && velocity.length2d( ) > min_vel - 10.f ) {
+ auto new_record = *last_simtime_record;
- //FUCK FAKE PINGERS WE IN THIS BITCH
- auto nci = g_csgo.m_engine( )->GetNetChannelInfo( ); //GOD FUCKING KNOWS WHY
- float latency = nci->GetLatency( 0 ) + g_csgo.m_globals->m_frametime;
+ //FUCK FAKE PINGERS WE IN THIS BITCH
+ auto nci = g_csgo.m_engine( )->GetNetChannelInfo( ); //GOD FUCKING KNOWS WHY
+ float latency = nci->GetLatency( 0 ) + g_csgo.m_globals->m_frametime;
- auto pred_choke = g_cheat.m_prediction.get_predicted_choke( it );
- auto latency_ticks = TIME_TO_TICKS( latency );
+ auto pred_choke = g_cheat.m_prediction.get_predicted_choke( it );
+ auto latency_ticks = TIME_TO_TICKS( latency );
- float time_since_update = g_ctx.pred_time( ) + latency - entity->m_flSimulationTime( );
+ float time_since_update = g_ctx.pred_time( ) + latency - entity->m_flSimulationTime( );
- //NIGGA UPDATED ALREADY FUCK ADAPTIVE
- if( TIME_TO_TICKS( time_since_update ) > pred_choke && pred_choke > 0 ) {
- if( g_settings.rage.fakelag_resolver( ) == 1 )
- continue;
+ //NIGGA UPDATED ALREADY FUCK ADAPTIVE
+ if( TIME_TO_TICKS( time_since_update ) > pred_choke && pred_choke > 0 ) {
+ if( g_settings.rage.fakelag_resolver( ) == 1 )
+ return false;
- else if( latency_ticks > 0 ) {
- int update_count = TIME_TO_TICKS( time_since_update ) / pred_choke;
+ else if( latency_ticks > 0 ) {
+ int update_count = TIME_TO_TICKS( time_since_update ) / pred_choke;
- vec3_t extrapolated_origin = g_cheat.m_prediction.full_walk_move( entity, update_count * pred_choke );
- new_record.m_vecRenderOrigin = extrapolated_origin;
- new_record.m_tickcount += update_count * pred_choke;
- }
+ vec3_t extrapolated_origin = g_cheat.m_prediction.full_walk_move( entity, update_count * pred_choke );
+ new_record.m_vecRenderOrigin = extrapolated_origin;
+ new_record.m_tickcount += update_count * pred_choke;
}
+ }
- //if( !new_record.is_valid( ) )
- // continue;
+ //if( !new_record.is_valid( ) )
+ // continue;
- int shots = m_resolver->get_shots( i );
- bool recalc = shots != last_simtime_record->m_shots;
+ int shots = m_resolver->get_shots( it );
+ bool recalc = shots != last_simtime_record->m_shots;
- new_record.restore( true, recalc );
- tick_count = new_record.m_tickcount;
- backtracked_record = last_simtime_record;
- restore = true;
- }
- else {
- int shots = m_resolver->get_shots( i );
- bool recalc = shots != last_simtime_record->m_shots;
-
- last_simtime_record->restore( recalc, recalc );
- tick_count = last_simtime_record->m_tickcount;
- backtracked_record = last_simtime_record;
- restore = true;
- }
+ new_record.restore( true, recalc );
+ tick_count = new_record.m_tickcount;
+ backtracked_record = last_simtime_record;
+ restore = true;
}
else {
- //fake ping, just wait for an update
- continue;
+ int shots = m_resolver->get_shots( it );
+ bool recalc = shots != last_simtime_record->m_shots;
+
+ last_simtime_record->restore( recalc, recalc );
+ tick_count = last_simtime_record->m_tickcount;
+ backtracked_record = last_simtime_record;
+ restore = true;
}
}
+ else {
+ //fake ping, just wait for an update
+ return false;
+ }
}
+ }
- baim = should_baim_entity( entity, !should_baim );
+ baim = should_baim_entity( entity, !should_baim );
- auto restore_player = [ &original_record, &restore, &entity, this ]( ) {
- original_record.restore( true );
- //entity->m_flLastBoneSetupTime( ) = std::numeric_limits< float >::quiet_NaN( );
- };
+ auto restore_player = [ &original_record, &restore, &entity, this ]( ) {
+ original_record.restore( true );
+ //entity->m_flLastBoneSetupTime( ) = std::numeric_limits< float >::quiet_NaN( );
+ };
- int hitbox = hitscan( entity, baim, aim_pos, hit_damage );
- if( hitbox == -1 ) {
- restore_player( );
- continue;
- }
+ int hitbox = hitscan( entity, baim, aim_pos, hit_damage );
+ if( hitbox == -1 ) {
+ restore_player( );
+ return false;
+ }
- if( aim_pos.dist_to( local_pos ) > 150.f && is_zeus ) {
- restore_player( );
- continue;
- }
+ if( aim_pos.dist_to( local_pos ) > 150.f && zeus ) {
+ restore_player( );
+ return false;
+ }
- aim_angle = math::vector_angles( local_pos, aim_pos ).clamp( );
+ aim_ang = math::vector_angles( local_pos, aim_pos ).clamp( );
- if( g_settings.rage.active->m_auto_stop( ) == 2 )
- quick_stop( m_cmd );
+ if( g_settings.rage.active->m_auto_stop( ) == 2 )
+ quick_stop( m_cmd );
- if( !util::hitchance( it, aim_angle,
- g_settings.rage.active->m_hitchance, hitbox ) ) {
- if( g_settings.rage.active->m_auto_stop( ) == 1 )
- quick_stop( m_cmd );
+ if( !util::hitchance( it, aim_ang,
+ g_settings.rage.active->m_hitchance, hitbox ) ) {
+ if( g_settings.rage.active->m_auto_stop( ) == 1 )
+ quick_stop( m_cmd );
- if( g_settings.rage.auto_scope( ) && g_ctx.m_local->get_weapon( )->is_sniper( ) ) {
- if( !g_ctx.m_local->m_bIsScoped( ) ) {
- m_cmd->m_buttons |= IN_ATTACK2;
- }
+ if( g_settings.rage.auto_scope( ) && g_ctx.m_local->get_weapon( )->is_sniper( ) ) {
+ if( !g_ctx.m_local->m_bIsScoped( ) ) {
+ m_cmd->m_buttons |= IN_ATTACK2;
}
-
- restore_player( );
- continue;
}
- ret.m_ent_index = it;
- ret.m_position = aim_pos;
- ret.m_tick_count = tick_count;
- ret.m_hitbox = hitbox;
- ret.m_backtracked = backtracked;
- ret.m_min = entity->get_hitbox_mins( hitbox );
- ret.m_max = entity->get_hitbox_maxs( hitbox );
- ret.m_radius = entity->get_hitbox_radius( hitbox );
+ restore_player( );
+ return false;
+ }
- memcpy( m_shot_matrix, entity->m_CachedBoneData( ).GetElements( ), sizeof( matrix3x4 ) * entity->m_CachedBoneData( ).GetSize( ) );
+ ret->m_ent_index = it;
+ ret->m_position = aim_pos;
+ ret->m_tick_count = tick_count;
+ ret->m_hitbox = hitbox;
+ ret->m_backtracked = backtracked;
+ ret->m_min = entity->get_hitbox_mins( hitbox );
+ ret->m_max = entity->get_hitbox_maxs( hitbox );
+ ret->m_radius = entity->get_hitbox_radius( hitbox );
- m_shot_target = it;
+ memcpy( m_shot_matrix, entity->m_CachedBoneData( ).GetElements( ), sizeof( matrix3x4 ) * entity->m_CachedBoneData( ).GetSize( ) );
- restore_player( );
+ m_shot_target = it;
- break;
+ restore_player( );
+
+ return true;
+ }
+
+ c_ragebot::aim_target_t c_ragebot::find_best_target( ) {
+ aim_target_t ret{ -1, m_cmd->m_tick_count, -1, vec3_t{ }, vec3_t{ }, vec3_t{ }, 0.f, 0 };
+ vec3_t aim_angle{ };
+ vec3_t aim_pos{ };
+ auto weapon_info = g_ctx.m_local->get_weapon( )->get_wpn_info( );
+ bool is_zeus = g_ctx.m_local->get_weapon( )->m_iItemDefinitionIndex( ) == WEAPON_TASER;
+ int damage = weapon_info->damage;
+
+ auto players = get_sorted_targets( );
+ auto data = players.data( );
+
+ for( size_t i{ }; i < players.size( ); ++i ) {
+ if( can_hit_target( data[ i ], &ret, is_zeus ) )
+ break;
}
return ret;
@@ -1031,6 +1038,12 @@ namespace features
m_send_next = false;
}
+ // do not
+ if( g_settings.rage.silent == 2 && !g_cheat.m_lagmgr.get_choked( ) && !m_antiaim->is_fakewalking( ) ) {
+ g_cheat.m_lagmgr.set_state( false );
+ return;
+ }
+
auto wep = g_ctx.m_local->get_weapon( );
if( !wep ) {
m_target = -1;
@@ -1039,9 +1052,6 @@ namespace features
bool in_attack = false;
- if( !g_ctx.m_local->can_attack( ) )
- return;
-
m_can_fakeping = true;
if ( g_settings.rage.activation_type == 0 ) in_attack = true;
@@ -1063,6 +1073,17 @@ namespace features
return;
}
+ if( !g_ctx.m_local->can_attack( ) ) {
+ aim_target_t t{ };
+ bool is_zeus = wep->m_iItemDefinitionIndex( ) == WEAPON_TASER;
+
+ if( m_target != -1 && !m_antiaim->is_fakewalking( ) )
+ if( g_settings.rage.active->m_auto_stop == 2 && can_hit_target( m_target, &t, is_zeus ) )
+ quick_stop( m_cmd );
+
+ return;
+ }
+
auto target = find_best_target( );
if ( target.m_ent_index != -1 ) {
aim_at_target( target );
diff --git a/internal_rewrite/ragebot.hpp b/internal_rewrite/ragebot.hpp
index 4b5676f..83b960f 100644
--- a/internal_rewrite/ragebot.hpp
+++ b/internal_rewrite/ragebot.hpp
@@ -70,6 +70,7 @@ namespace features
std::array< int, 65 > get_sorted_targets( );
aim_target_t find_best_target( );
+ bool can_hit_target( int, aim_target_t* target, bool zeus );
int hitscan( c_base_player* ent, bool baim, vec3_t& out_pos, float& out_dmg );
void set_angles( const vec3_t& viewangles );
bool should_baim_entity( c_base_player* ent, bool backtracked = false );
@@ -120,6 +121,7 @@ namespace features
public:
bool is_fakewalking( ) const { return m_is_fakewalking; }
+
bool is_edging( ) const { return m_is_edging; }
float get_yaw( bool no_jitter = false );