-
Автор темы
- #1
Код не мой, купил у какого-то чела, биг кодеры югеима, дополните чего не хватает
[DT]
misc.hpp
util.cpp
ctx.cpp
hooked_runcomand.cpp
main.cpp (setup_hooks)
structs.cpp
hooks.cpp
hooks.hpp
[DT]
Код:
bool misc::rapid_fire(CUserCmd* m_pcmd)
{
rapid_fire_enabled = true;
static auto recharge_rapid_fire = false;
static bool firing_dt = false;
static int last_double_tap = 0;
bool remove_knife = false;
if (recharge_rapid_fire)
{
recharge_rapid_fire = false;
recharging_rapid_fire = true;
globals.g.ticks_allowed = 0;
globals.g.next_tickbase_shift = 0;
return false;
}
auto max_tickbase_shift = globals.g.weapon->get_max_tickbase_shift();
if (recharging_rapid_fire)
{
bool in_attack = m_pcmd->m_buttons & IN_ATTACK;
bool can_recharge = globals.g.weapon->is_sniper() ? globals.g.weapon->can_fire(true, max_tickbase_shift)
: fabs(globals.g.fixed_tickbase - last_double_tap) > TIME_TO_TICKS(0.75f);
if (!in_attack && !aim::get().should_stop && can_recharge)
{
recharging_rapid_fire = false;
rapid_fire_key = true;
firing_dt = false;
}
else if (in_attack)
{
firing_dt = true;
last_double_tap = globals.g.fixed_tickbase;
}
}
if (!g_cfg.ragebot.enable)
{
rapid_fire_enabled = false;
rapid_fire_key = false;
globals.g.ticks_allowed = 0;
globals.g.next_tickbase_shift = 0;
return false;
}
if (!g_cfg.ragebot.double_tap)
{
rapid_fire_enabled = false;
rapid_fire_key = false;
globals.g.ticks_allowed = 0;
globals.g.next_tickbase_shift = 0;
return false;
}
static bool was_in_dt = false;
if (g_cfg.ragebot.double_tap_key.key <= KEY_NONE || g_cfg.ragebot.double_tap_key.key >= KEY_MAX)
{
rapid_fire_enabled = false;
rapid_fire_key = false;
globals.g.ticks_allowed = 0;
globals.g.next_tickbase_shift = 0;
return false;
}
if (rapid_fire_key && g_cfg.ragebot.double_tap_key.key != g_cfg.antiaim.hide_shots_key.key)
hide_shots_key = false;
if (!rapid_fire_key
|| globals.local()->m_bGunGameImmunity()
|| globals.local()->m_fFlags() & FL_FROZEN
|| globals.g.fakeducking)
{
rapid_fire_enabled = false;
if (!firing_dt && was_in_dt)
{
globals.g.trigger_teleport = true;
globals.g.teleport_amount = 14;
was_in_dt = false;
}
globals.g.ticks_allowed = 0;
globals.g.next_tickbase_shift = 0;
return false;
}
if (m_gamerules()->m_bIsValveDS())
{
rapid_fire_enabled = false;
globals.g.ticks_allowed = 0;
globals.g.next_tickbase_shift = 0;
return false;
}
if (globals.g.weapon->is_knife())
remove_knife = true;
if (antiaim::get().freeze_check)
return true;
was_in_dt = true;
bool can_peek = !globals.g.weapon->is_non_aim() && key_binds::get().get_key_bind_state(18);
if (!globals.g.weapon->is_grenade() && globals.g.weapon->m_iItemDefinitionIndex() != WEAPON_TASER
&& globals.g.weapon->m_iItemDefinitionIndex() != WEAPON_REVOLVER
&& (m_pcmd->m_buttons & IN_ATTACK || m_pcmd->m_buttons & IN_ATTACK2 && globals.g.weapon->is_knife())) //-V648
{
auto next_command_number = m_pcmd->m_command_number + 1;
auto user_cmd = m_input()->GetUserCmd(next_command_number);
memcpy(user_cmd, m_pcmd, sizeof(CUserCmd));
user_cmd->m_command_number = next_command_number;
util::copy_command(user_cmd, max_tickbase_shift);
globals.send_packet = true;
if (globals.g.aimbot_working)
{
globals.g.double_tap_aim = true;
globals.g.double_tap_aim_check = true;
}
recharge_rapid_fire = true;
rapid_fire_enabled = false;
rapid_fire_key = false;
last_double_tap = globals.g.fixed_tickbase;
firing_dt = true;
}
else if (!globals.g.weapon->is_grenade() && globals.g.weapon->m_iItemDefinitionIndex() != WEAPON_TASER && globals.g.weapon->m_iItemDefinitionIndex() != WEAPON_REVOLVER)
globals.g.tickbase_shift = max_tickbase_shift;
return true;
}
Код:
заменить
*/
bool rapid_fire(CUserCmd* m_pcmd);
bool recharging_rapid_fire = false;
bool rapid_fire_enabled = false;
bool rapid_fire_key = false;
Код:
заменить
*/
void copy_command(CUserCmd* cmd, int tickbase_shift)
{
bool can_peek = !globals.g.weapon->is_non_aim() && key_binds::get().get_key_bind_state(18);
auto fast_stop = [&](CUserCmd* cur_cmd)
{
if (!can_peek)
return;
auto velocity = globals.local()->m_vecVelocity();
if (velocity.Length2D() > 20.0f)
{
Vector direction;
Vector real_view;
math::vector_angles(velocity, direction);
m_engine()->GetViewAngles(real_view);
direction.y = real_view.y - direction.y;
Vector forward;
math::angle_vectors(direction, forward);
static auto cl_forwardspeed = m_cvar()->FindVar(crypt_str("cl_forwardspeed"));
static auto cl_sidespeed = m_cvar()->FindVar(crypt_str("cl_sidespeed"));
auto negative_forward_speed = -cl_forwardspeed->GetFloat();
auto negative_side_speed = -cl_sidespeed->GetFloat();
auto negative_forward_direction = forward * negative_forward_speed;
auto negative_side_direction = forward * negative_side_speed;
cur_cmd->m_forwardmove = negative_forward_direction.x;
cur_cmd->m_sidemove = negative_side_direction.y;
}
};
Vector wish_angle;
m_engine()->GetViewAngles(wish_angle);
util::movement_fix(wish_angle, cmd);
fast_stop(cmd);
auto commands_to_add = 0;
do
{
auto sequence_number = commands_to_add + cmd->m_command_number;
auto command = m_input()->GetUserCmd(sequence_number);
auto verified_command = m_input()->GetVerifiedUserCmd(sequence_number);
memcpy(command, cmd, sizeof(CUserCmd)); //-V598
if (command->m_tickcount != INT_MAX && m_clientstate()->iDeltaTick > 0)
m_prediction()->Update(m_clientstate()->iDeltaTick,
true,
m_clientstate()->nLastCommandAck,
m_clientstate()->nLastOutgoingCommand + m_clientstate()->iChokedCommands);
command->m_command_number = sequence_number;
command->m_predicted = command->m_tickcount != INT_MAX;
++m_clientstate()->iChokedCommands; //-V807
if (m_clientstate()->pNetChannel)
{
++m_clientstate()->pNetChannel->m_nChokedPackets;
++m_clientstate()->pNetChannel->m_nOutSequenceNr;
}
math::normalize_angles(command->m_viewangles);
memcpy(&verified_command->m_cmd, command, sizeof(CUserCmd)); //-V598
verified_command->m_crc = command->GetChecksum();
++commands_to_add;
} while (commands_to_add != tickbase_shift);
*(bool*)((uintptr_t)m_prediction() + 0x24) = true;
*(int*)((uintptr_t)m_prediction() + 0x1C) = 0;
}
Код:
после bool should_update_weather = false;
*/
bool trigger_teleport = false;
int teleport_amount = 0;
Код:
using CLMove_t = void(__vectorcall*)(float, bool);
using ReadPacketEntities_t = void(__vectorcall*)(bool);
void __vectorcall hooks::hooked_clmove(float accumulated_extra_samples, bool bFinalTick)
{
((CLMove_t)original_clmove)(accumulated_extra_samples, bFinalTick);
if (globals.available() && globals.local()->is_alive())
{
if (globals.g.trigger_teleport)
{
for (int i = 0; i < globals.g.teleport_amount; i++)
((CLMove_t)original_clmove)(accumulated_extra_samples, bFinalTick);
globals.g.teleport_amount = 0;
globals.g.trigger_teleport = false;
}
}
}
Код:
static auto clmove = (DWORD)(util::FindSignature(crypt_str("engine.dll"), crypt_str("55 8B EC 81 EC ? ? ? ? 53 56 8A F9")));
hooks::original_clmove = (DWORD)DetourFunction((PBYTE)clmove, (PBYTE)hooks::hooked_clmove); //-V206
Код:
bool weapon_t::can_fire(bool check_revolver, int tick_base)
{
if (!this) //-V704
return false;
if (!is_non_aim() && is_empty())
return false;
auto owner = (player_t*)m_entitylist()->GetClientEntityFromHandle(m_hOwnerEntity());
if (owner == globals.local() && antiaim::get().freeze_check)
return false;
if (!owner->valid(false))
return false;
if (owner->m_bIsDefusing())
return false;
auto server_time = TICKS_TO_TIME(globals.g.fixed_tickbase - tick_base);
if (server_time < m_flNextPrimaryAttack())
return false;
if (server_time < owner->m_flNextAttack())
return false;
if (check_revolver && m_iItemDefinitionIndex() == WEAPON_REVOLVER && m_flPostponeFireReadyTime() >= server_time)
return false;
return true;
}
Код:
после DWORD original_processinterpolatedlist;
*/
DWORD original_clmove;
Код:
//после extern DWORD original_processinterpolatedlist;
extern DWORD original_clmove;
/после bool __stdcall hooked_inprediction();
void __vectorcall hooked_clmove(float accumulated_extra_samples, bool bFinalTick);