UPD: 23.01.21
в честь памятной прогулки по МСК
я был вдохновлен на обновление данной темы
это просто bruteforce с обнаружением фейка и проверкой скорости
я бы знатоков данной темы попросил дополнить ресольвер:
1.фиксом лоудельты
2.подкоректировать значения фейков
буду дополнять ес что
в честь памятной прогулки по МСК
я был вдохновлен на обновление данной темы
это просто bruteforce с обнаружением фейка и проверкой скорости
я бы знатоков данной темы попросил дополнить ресольвер:
1.фиксом лоудельты
2.подкоректировать значения фейков
буду дополнять ес что
C++:
//RESOLVER.cpp
Resolver g_resolver{ };;
bool Resolver::has_fake(Player* entity, LagComp::LagRecord_t* record)
{
//auto player_lag_record = &cheat::features::lagcomp.records[index];
//auto player_lag_record = g_lagcompensation.GetValidRecords(entity);
//if (player_lag_record->m_Tickrecords.size() < 2)
// return true;
float simtime = entity->m_flSimulationTime();
float oldsimtime = entity->m_flOldSimulationTime();
float simdiff = simtime - oldsimtime;
auto chokedpackets = game::TIME_TO_TICKS(std::max(0.f, simdiff)); // you could also include latency
// they are likely not desyncing that much if they are in air
if (!(entity->m_fFlags() & FL_ONGROUND))
return false;
if (fabs(entity->m_flSimulationTime() - entity->m_flOldSimulationTime()) == g_csgo.m_globals->m_interval)
return false;
if (chokedpackets < 1) // player not desyncing
return false;
return true;
}
int last_resolving_side[65];
void Resolver::ResolveAngles(Player* player, LagComp::LagRecord_t* record) {
AimPlayer* data = &g_aimbot.m_players[player->index() - 1];
auto& pdata = inform[player->index() - 1];
CCSGOPlayerAnimState animstate_backup;
animstate_backup = *player->m_PlayerAnimState();
int m_Side;
float resolveValue;
if (g_resolver.has_fake(player, record) == false)
return;
if (record->m_bDidShot)
return;
auto standing = record->m_pLayers[3].m_weight == 0.0f && record->m_pLayers[3].m_cycle == 0.0f;
auto animating = record->m_pLayers[12].m_weight * 1000.f;
auto moving = !animating && (record->m_pLayers[6].m_weight * 1000.f) == (record->m_pLayers[6].m_weight * 1000.f);
float speed = player->m_vecVelocity().length_2d();
if ((player->m_fFlags() & FL_ONGROUND) && (record->m_fFlags & FL_ONGROUND))
{
if (speed > 1.1f)
{
if (moving)
{
float EyeYaw = fabs(record->m_pLayers[6].m_playback_rate - pdata.resolver_anim_layers[0][6].m_playback_rate);
float Negative = fabs(record->m_pLayers[6].m_playback_rate - pdata.resolver_anim_layers[2][6].m_playback_rate);
float Positive = fabs(record->m_pLayers[6].m_playback_rate - pdata.resolver_anim_layers[1][6].m_playback_rate);
if (Positive > EyeYaw || Positive > Negative || (Positive * 1000.0))
{
if (EyeYaw >= Negative && Positive > Negative && !(Negative * 1000.0))
{
m_Side = 1;
}
}
else
{
m_Side = -1;
}
}
}
}
else if (standing)
{
auto m_EyeDelta = math::remainder(math::NormalizedAngle(player->m_angEyeAngles().y - player->m_flLowerBodyYawTarget()), 360.f) <= 0.f;
if (2 * m_EyeDelta)
{
if (2 * m_EyeDelta == 2)
{
m_Side = -1;
}
}
else
{
m_Side = 1;
}
}
switch (data->m_missed_shots % 3)
{
case 1:
resolveValue = 58.0f;
break;
case 2:
resolveValue = 35.0f;
break;
case 3:
resolveValue = 21.0f;
break;
}
if (speed < 110.f && speed > 1.1f)
{
if (resolveValue > 45.0f)
resolveValue = 45.0f;
}
else if (speed > 110.f)
{
if (resolveValue > 30.0f)
resolveValue = 30.0f;
}
else if (speed < 76.f)
{
if (resolveValue > 22.0f)
resolveValue = 22.0f;
}
resolveValue = resolveValue * m_Side;
player->m_PlayerAnimState()->m_flGoalFeetYaw = math::NormalizedAngle(player->m_angEyeAngles().y + resolveValue);
}
float Resolver::ResolveShot(AimPlayer* data, LagComp::LagRecord_t* record) {
float flPseudoFireYaw = math::NormalizedAngle(math::CalcAngle(record->m_pMatrix[8].GetOrigin(), g_cl.m_local->m_BoneCache().m_pCachedBones[0].GetOrigin()).y);
if (data->m_extending) {
float flLeftFireYawDelta = fabsf(math::NormalizedAngle(flPseudoFireYaw - (record->m_angEyeAngles.y + 58.f)));
float flRightFireYawDelta = fabsf(math::NormalizedAngle(flPseudoFireYaw - (record->m_angEyeAngles.y - 58.f)));
g_notify.add(tfm::format(XOR("found shot record on %s: [ yaw: %i ]"), game::GetPlayerName(record->m_pEntity->index()), int(flLeftFireYawDelta > flRightFireYawDelta ? -58.f : 58.f)));//Coded by FuckyPazter aka scking
return flLeftFireYawDelta > flRightFireYawDelta ? -58.f : 58.f;
}
else {
float flLeftFireYawDelta = fabsf(math::NormalizedAngle(flPseudoFireYaw - (record->m_angEyeAngles.y + 58.f)));
float flRightFireYawDelta = fabsf(math::NormalizedAngle(flPseudoFireYaw - (record->m_angEyeAngles.y - 58.f)));
g_notify.add(tfm::format(XOR("found shot record on %s: [ yaw: %i ]"), game::GetPlayerName(record->m_pEntity->index()), int(flLeftFireYawDelta > flRightFireYawDelta ? -58.f : 58.f)));
return flLeftFireYawDelta > flRightFireYawDelta ? -58.f : 58.f;
}
}
C++:
RESOLVER.h
#pragma once
class ShotRecord;
struct resolver_recode
{
float spawn_time;
bool did_shot_this_tick;
float resolved_rotation;
bool breaking_lc;
int resolving_way;
int antifreestand_method;
void Reset()
{
/*last_balance_adjust_trigger_time = 0.f;
just_stopped_delta = 0.f;
last_time_down_pitch = 0.f;
last_time_moving = 0.f;
last_moving_lby = 0.0000001337f;*/
is_dormant = false;
/*is_last_moving_lby_valid = false, is_fakewalking = false, is_just_stopped = false, is_breaking_lby = false;*/
//is_balance_adjust_triggered = false, is_balance_adjust_playing = false, last_moving_lby_can_be_invalid = false;
//did_lby_flick = false;
resolved = false;
fakeangles = false;
m_flRate = 0.0f;
m_flServerTorso = 0.0f;
m_flClientRate = 0.0f;
m_flLastFlickTime = FLT_MAX;
m_iSide = -1;
m_iCurrentSide = -1;
last_time_balanced = 0.0f;
last_cycle_desync = 0.0f;
last_cycle = 0.f;
b_bRateCheck = false;
had_fake = false;
last_time_standed = 0.f;
last_time_choked = 0.f;
last_time_three = 0.f;
last_time_moved = 0.f;
last_shot_time = 0.f;
previous_rotation = 0.f;
//for (auto i = 0; i < 10; i++)
// missed_shots[i] = 0;
current_tick_max_delta = 0.f;
tick_delta = 0.0f;
lby_delta = 0.0f;
abs_yaw_delta = 0.0f;
latest_delta_used = 0.0f;
last_speed = 0.0f;
last_lby = 0.0f;
is_jittering = false;
is_using_static = false;
is_using_balance = false;
did_shot_this_tick = false;
did_lby_update_fail = false;
force_resolving = false;
is_shifting = false;
prev_pose = 0.f;
last_abs_yaw_delta = 0.f;
last_abs_yaw_delta_change = 0.f;
prev_delta = FLT_MAX;
last_abs_yaw_delta_60 = 0.0f;
/*did_hit_low_delta = false;
did_hit_max_delta = false;
did_hit_no_delta = false;*/
inverse_lby = false;
did_hit_inversed_lby = false;
was_shifting = false;
memset(missed_shots, 0, sizeof(int) * 10);
//spawntime = 0.0f;
animations_updated = false;
preserver_animlayers_saved = false;
resolver_method_text.clear();
cfirstmisses = 0;
previous_side = 0.f;
cur_side = 0.f;
breaking_lc = false;
freestand_fixed = false;
force_velocity = false;
new_velocity = vec3_t(0, 0, 0);
old_velocity = vec3_t(0, 0, 0);
did_force_velocity = false;
memset(leftmx, 0, sizeof(matrix3x4_t) * 128);
memset(rightmx, 0, sizeof(matrix3x4_t) * 128);
memset(nodesmx, 0, sizeof(matrix3x4_t) * 128);
}
struct AntiFreestandingRecord
{
int right_damage = 0, left_damage = 0;
float right_fraction = 0.f, left_fraction = 0.f;
void reset()
{
right_damage = 0;
left_damage = 0;
right_fraction = 0.f;
left_fraction = 0.f;
}
};
vec3_t previous_angles;
float prev_pose;
vec3_t last_real_angles;
vec3_t latest_angles;
vec3_t latest_fake;
vec3_t latest_angles_when_faked;
float previous_rotation;
float last_time_balanced;
float last_time_choked;
float last_time_three;
float last_cycle_desync;
float last_cycle;
bool had_fake;
float last_time_standed;
float last_time_moved;
float last_abs_yaw_delta;
float last_abs_yaw_delta_change;
float last_abs_yaw_delta_60;
float last_simtime;
float resolved_yaw;
float previous_side;
float cur_side;
bool force_velocity;
bool did_force_velocity;
vec3_t new_velocity;
vec3_t old_velocity;
bool freestand_fixed = false;
float latest_delta_used;
C_AnimationLayer client_anim_layers[15];
C_AnimationLayer resolver_anim_layers[3][15];
C_AnimationLayer server_anim_layers[15];
C_AnimationLayer preserver_anim_layers[15];
bool preserver_animlayers_saved = false;
AntiFreestandingRecord freestanding_record;
float last_shot_time = 0.0f;
float spawntime = 0.0f;
float m_flServerTorso = 0.0f;
float current_tick_max_delta = 0.0f;
float previous_jitter_lby = 0.0f;
int previous_resolving = 0;
float tick_delta = 0.0f;
float lby_delta = 0.0f;
float abs_yaw_delta = 0.0f;
float last_velocity_angle = 0.0f;
float last_speed = 0.0f;
float last_lby = 0.0f;
bool simtime_updated = false;
bool inverse_lby = false;
bool did_hit_inversed_lby = false;
float left_side = FLT_MAX;
float right_side = FLT_MAX;
float left_lside = FLT_MAX;
float lby_side = FLT_MAX;
float right_lside = FLT_MAX;
float no_side = FLT_MAX;
//float next_predicted_lby_update;
//float last_lby_update;
//bool did_predicted_lby_flick;
/*float last_time_down_pitch;
float last_time_lby_updated;
int lby_update_tick;*/
bool skeet_fakes = false;
bool is_shifting = false;
bool was_shifting = false;
bool is_jittering = false;
bool is_using_static = false;
bool is_using_balance = false;
bool did_lby_update_fail = false;
bool force_resolving = false;
std::string resolver_method_text;
float m_flRate = 0.0f;
float m_flClientRate = 0.0f;
float prev_delta = FLT_MAX;
float m_flLastFlickTime = FLT_MAX;
int m_iSide = -1;
int m_iCurrentSide = -1;
bool b_bRateCheck = false;
bool animations_updated = false;
bool invalidate_resolving = false;
int resolving_method;
int cfirstmisses = 0;
int missed_shots[12];
float last_anims_update_time;
matrix3x4_t leftmx[128];
matrix3x4_t rightmx[128];
matrix3x4_t leftlmx[128];
matrix3x4_t rightlmx[128];
matrix3x4_t LBYmx[128];
matrix3x4_t nodesmx[128];
/*bool lby_update_locked;*/
bool is_dormant, resolved;
//bool /*is_last_moving_lby_valid, last_moving_lby_can_be_invalid, is_just_stopped, is_getting_right_delta,*/is_breaking_lby;
/*bool is_fakewalking;
bool is_balance_adjust_triggered, is_balance_adjust_playing;
bool did_lby_flick;*/
bool fakeangles;
//bool did_hit_low_delta;
//bool did_hit_max_delta;
//bool did_hit_no_delta;
};
struct resolverInfo_t {
resolverInfo_t() = default;
struct missInfo_t {
missInfo_t() {
this->m_freestand = 0;
this->m_first_shot = 0;
this->m_static = 0;
this->m_jitter = 0;
}
int m_freestand;
int m_first_shot;
int m_static;
int m_jitter;
};
struct hitInfo_t {
hitInfo_t() {
this->m_freestand = 0;
this->m_first_shot = 0;
this->m_static = 0;
this->m_jitter = 0;
}
int m_freestand;
int m_first_shot;
int m_static;
int m_jitter;
};
bool m_jitter{};
bool m_use_freestand{};
missInfo_t m_misses{};
hitInfo_t m_hits{};
};
class Resolver {
public:
enum Modes : size_t {
RESOLVE_NONE = 0,
RESOLVE_MOVE,
RESOLVE_STAND,
};
public:
void ResolveAngles(Player* player, LagComp::LagRecord_t* record);
float ResolveShot(AimPlayer* data, LagComp::LagRecord_t* record);
bool has_fake(Player* player, LagComp::LagRecord_t* record);
//void store_delta(Player* m_player, resolver_recode* resolve_data, LagComp::LagRecord_t* m_records);
//void update_animations_for_resolver(Player* player, LagComp::LagRecord_t* from, int Resolver_Index);
resolver_recode inform[64];
public:
std::array< vec3_t, 64 > m_impacts;
//std::unordered_map<CBaseHandle, resolverInfo_t> m_resolver_info;
};
extern Resolver g_resolver;
Последнее редактирование: