*(float*)(animstate + 0x80)
-
Автор темы
- #1
Кидает по мапе когда пытаюсь ломать LC фейклагами
Проблема:
Я смотрел через брикпоинт ни черта не понял по этому делаю эту тему.
Проблема:
Я смотрел через брикпоинт ни черта не понял по этому делаю эту тему.
CreateMove:
__declspec(naked) void __stdcall Hooks::CreateMove_Proxy(int sequence_number, float input_sample_frametime, bool active)
{
__asm
{
push ebx
push esp
push dword ptr[esp + 20]
push dword ptr[esp + 0Ch + 8]
push dword ptr[esp + 10h + 4]
call Hooks::CreateMove
pop ebx
retn 0Ch
}
}
void Hooks::CreateMove(int sequence_number, float input_sample_frametime, bool active, bool& bSendPacket)
{
// let original run first.
g_hooks.m_client.GetOldMethod< CreateMove_t >(IClientMode::CREATEMOVE)(this, sequence_number, input_sample_frametime, active);
CUserCmd* cmd = g_csgo.m_input->GetUserCmd(sequence_number);
CVerifiedUserCmd* verified = g_csgo.m_input->GetVerifiedUserCmd(sequence_number);
// called from CInput::ExtraMouseSample -> return original.
if (!cmd || !cmd->m_command_number)
return g_hooks.m_client.GetOldMethod< CreateMove_t >(IClientMode::CREATEMOVE)(this, sequence_number, input_sample_frametime, active);
// if we arrived here, called from -> CInput::CreateMove
// call EngineClient::SetViewAngles according to what the original returns.
//if ( ret )
g_csgo.m_engine->SetViewAngles(cmd->m_view_angles);
// random_seed isn't generated in ClientMode::CreateMove yet, we must set generate it ourselves.
cmd->m_random_seed = g_csgo.MD5_PseudoRandom(cmd->m_command_number) & 0x7fffffff;
g_cl.m_packet = true;
// remove in_attack flags while the gui is open to maintain ability of moving/walking but not shooting while changing options in the gui.
if (GUI::ctx->open) {
// are we IN_ATTACK?
if (cmd->m_buttons & IN_ATTACK) {
// remove the flag :D!
cmd->m_buttons &= ~IN_ATTACK;
}
// are we IN_ATTACK2?
if (cmd->m_buttons & IN_ATTACK2) {
// remove the flag :D!
cmd->m_buttons &= ~IN_ATTACK2;
}
}
// let's better be setting unpredicted curtime when dead.. (fixes clantag and other stuff in the future)
if (g_cl.m_local && !g_cl.m_local->alive())
g_inputpred.m_stored_variables.m_flCurtime = g_csgo.m_globals->m_curtime;
// let's wait till we successfully charged if we want to, hide shots. (this fixes anti-aim and shit, sorry, redundant :/)
if (g_tickbase.m_shift_data.m_should_attempt_shift && !g_tickbase.m_shift_data.m_should_disable) {
if (g_cfg[XOR("rage_exploit_charged")].get<bool>() && g_cl.m_goal_shift == 7 && (g_tickbase.m_shift_data.m_prepare_recharge || g_tickbase.m_shift_data.m_did_shift_before && !g_tickbase.m_shift_data.m_should_be_ready)) {
// are we IN_ATTACK?
if (cmd->m_buttons & IN_ATTACK) {
// remove the flag :D!
cmd->m_buttons &= ~IN_ATTACK;
}
}
}
// invoke move function.
g_cl.OnTick(cmd);
// make sure to update our animations with the right angles.
if (cmd->m_command_number >= g_cl.m_shot_command_number && g_cl.m_shot_command_number >= cmd->m_command_number - g_csgo.m_cl->iChokedCommands)
g_cl.m_angle = g_csgo.m_input->m_commands[g_cl.m_shot_command_number % 150].m_view_angles;
else
g_cl.m_angle = cmd->m_view_angles;
// let's wait till we successfully charged if we want to, hide shots.
if (g_tickbase.m_shift_data.m_should_attempt_shift && !g_tickbase.m_shift_data.m_should_disable) {
if (g_cfg[XOR("rage_exploit_charged")].get<bool>() && g_cl.m_goal_shift == 7 && (g_tickbase.m_shift_data.m_prepare_recharge || g_tickbase.m_shift_data.m_did_shift_before && !g_tickbase.m_shift_data.m_should_be_ready)) {
// are we IN_ATTACK?
if (cmd->m_buttons & IN_ATTACK) {
// remove the flag :D!
cmd->m_buttons &= ~IN_ATTACK;
}
}
}
// make sure to update our animations at the right time.
g_cl.m_animate = true;
g_cl.m_update_fake = true;
bSendPacket = g_cl.m_packet;
verified->m_cmd = *cmd;
verified->m_crc = cmd->get_checksum();
}
FakeLag:
void HVH::SendPacket()
{
// fake-lag enabled.
if ( !g_cfg[XOR("rage_fakelag_enabled")].get<bool>() )
return;
if ( !g_csgo.m_gamerules->m_bFreezePeriod() && !(g_cl.m_flags & FL_FROZEN) )
{
// limit of lag.
int limit = std::clamp<int>((int)g_cfg[XOR("rage_fakelag_limit")].get<float>(), 0, g_cl.m_max_lag);
int mode = g_cfg[XOR("rage_fakelag_type")].get<int>();
// reset this here everytime..
g_cl.m_should_lag = false;
// get current origin.
vec3_t cur = g_cl.m_local->m_vecOrigin();
// get prevoius origin.
vec3_t prev = g_cl.m_net_pos.empty() ? g_cl.m_local->m_vecOrigin() : g_cl.m_net_pos.front().m_pos;
// delta between the current origin and the last sent origin.
float delta = (cur - prev).length_sqr();
// stand.
if (delta < 0.1) {
g_cl.m_should_lag = true;
if (!g_cfg[XOR("rage_fakelag_standing_enabled")].get<bool>())
limit = 2;
}
// move.
if (g_cfg[XOR("rage_fakelag_move_enabled")].get<bool>() && delta > 0.1f && g_cl.m_speed > 0.1f && !m_fake_duck) {
g_cl.m_should_lag = true;
}
// air.
else if (g_cfg[XOR("rage_fakelag_air_enabled")].get<bool>() && !m_fake_duck && ((g_cl.m_buttons & IN_JUMP) || !(g_cl.m_flags & FL_ONGROUND))) {
g_cl.m_should_lag = true;
}
// crouch.
else if (g_cfg[XOR("rage_fakelag_crouch_enabled")].get<bool>() && g_cl.m_local->m_bDucking() && !m_fake_duck) {
g_cl.m_should_lag = true;
}
// fake duck.
else if (m_fake_duck) {
g_cl.m_should_lag = true;
limit = 14;
mode = 0;
}
// commenting in gives the 'p2c effect' where it turns on fakelag between shots, though cba adjusting the current recharging..
if (g_tickbase.m_shift_data.m_should_attempt_shift && ((!g_tickbase.m_shift_data.m_should_be_ready && g_tickbase.m_shift_data.m_prepare_recharge) || g_tickbase.m_shift_data.m_needs_recharge || g_tickbase.m_shift_data.m_should_be_ready) && !m_fake_duck) {
g_cl.m_should_lag = true;
limit = 1;
mode = 0;
}
// talking.
if (g_csgo.m_engine->IsVoiceRecording()) {
g_cl.m_should_lag = true;
limit = 2;
mode = 0;
}
if (g_cl.m_should_lag)
{
// max.
if (mode == 0)
g_cl.m_packet = false;
// break.
else if (mode == 1 && delta <= 4096.f)
g_cl.m_packet = false;
// random.
else if (mode == 2) {
// compute new factor.
if (g_cl.m_lag >= m_random_lag)
m_random_lag = g_csgo.RandomInt(2, limit);
// factor not met, keep choking.
else g_cl.m_packet = false;
}
// break step.
else if (mode == 3)
{
// normal break.
if (m_step_switch)
{
if (delta <= 4096.f)
g_cl.m_packet = false;
}
// max.
else g_cl.m_packet = false;
}
if (g_cl.m_lag >= limit)
g_cl.m_packet = true;
}
}
else
g_cl.m_should_lag = false;
if (g_cfg[XOR("rage_fakelag_on_land")].get<bool>()) {
vec3_t start = g_cl.m_local->m_vecOrigin(), end = start, vel = g_cl.m_local->m_vecVelocity();
CTraceFilterWorldOnly filter;
CGameTrace trace;
// gravity.
vel.z -= (g_csgo.sv_gravity->GetFloat() * g_csgo.m_globals->m_interval);
// extrapolate.
end += (vel * g_csgo.m_globals->m_interval);
// move down.
end.z -= 2.f;
g_csgo.m_engine_trace->TraceRay(Ray(start, end), MASK_SOLID, &filter, &trace);
// check if landed.
if (trace.m_fraction != 1.f && trace.m_plane.m_normal.z > 0.7f && !(g_cl.m_flags & FL_ONGROUND))
g_cl.m_packet = true;
}
// do not lag while shooting.
if (!g_hvh.m_fake_duck && g_cfg[XOR("cheat_mode")].get<int>() == 0) {
if (g_cl.m_old_shot)
g_cl.m_packet = true;
}
// we somehow reached the maximum amount of lag.
// we cannot lag anymore and we also cannot shoot anymore since we cant silent aim.
if (g_cl.m_lag >= g_cl.m_max_lag) {
// set bSendPacket to true.
g_cl.m_packet = true;
}
}
Последнее редактирование: