⭐ONEHACK⭐
-
Автор темы
- #1
Нашел такой Backstap но он не работает, может кто сказать, что я делаю не так?
Найденный код
CreateMove
UPD: Работает только в одном направлении к противнику...
Найденный код
C++:
// anywhere before createmove
QAngle viewangles = math::calc_angle(localplayer->EyePosition(), player->OBBMiddle());
cmd->viewangles = player->GetAbsAngles();
// fixmove ofc
o_createmove(thisptr, sample_frametime, ucmd);
Vector forward; AngleVectors(viewangles, &forward);
*(Vector*)((uintptr_t)g::cmd + 0x40) = forward;
*(bool*)((uintptr_t)g::cmd + 0x3f) = true;
CreateMove
C++:
typedef bool(__thiscall* CreateMoveFn)(void*, float, CUserCmd*);
CreateMoveFn orgCreateMove = nullptr;
bool __fastcall hookCreateMove(ClientMode* ClientMode, void* edx, float flInputSampleTime, CUserCmd* cmd)
{
if (!cmd)
return false;
C_GMOD_Player* LocalPlayer = (C_GMOD_Player*)cliententitylist()->GetClientEntity(engine()->GetLocalPlayer());
ViewAngle = cmd->viewangles;
if (cmd->command_number == 0 || !engine()->IsInGame() || !LocalPlayer || !LocalPlayer->IsAlive()) {
orgCreateMove(ClientMode, flInputSampleTime, cmd);
return false;
}
bool ForcedPacket = false;
if (engine()->GetNetChannel()->m_nChokedPackets >= 14)
ForcedPacket = true;
HackVars::CurCmd = cmd;
DWORD move;
_asm mov move, ebp;
bool& sendpacket = *(***(bool****)(move)-1);
CBaseCombatWeapon* weapon = LocalPlayer->GetActiveWeapon();
QAngle viewpunchangle = LocalPlayer->m_vecViewPunch();
bool HoldingTool = H::Util::IsHoldingTool();
if (HackVars::Aimbot::Bhop)
H::Bhop(cmd);
if (weapon && LocalPlayer && cmd) {
PredictionSystem.StartPrediction(cmd);
bool bCanShoot = weapon->m_flNextPrimaryAttack() <= LocalPlayer->m_nTickBase() * globals()->interval_per_tick;
auto Lua = LuaShared()->GetLuaInterface(GarrysMod::Lua::Client);
weapon->PushEntity();
Lua->GetField(-1, "MaxSpreadInc");
float curcone = Lua->GetNumber(-1);
Lua->Pop(2);
QAngle SpreadAngle;
if (memcmp(weapon->GetLuaScriptName(), "cw_", 3) == 0) {
Interfaces::Random()->SetSeed(cmd->command_number);
auto x = Interfaces::Random()->RandomFloat(-curcone, curcone);
auto y = Interfaces::Random()->RandomFloat(-curcone, curcone);
SpreadAngle = H::SpreadAngle(cmd);
if (bCanShoot && cmd->buttons.IsFlagSet(IN_ATTACK) && !HoldingTool && HackVars::Aimbot::Norecoil)
cmd->viewangles -= (QAngle(x, y, 0) * 25);
}
else {
SpreadAngle = H::SpreadAngle(cmd);
if (bCanShoot && cmd->buttons.IsFlagSet(IN_ATTACK) && !HoldingTool && HackVars::Aimbot::Norecoil)
cmd->viewangles += SpreadAngle;
}
C_GMOD_Player* Target = nullptr;
QAngle TargetAngle = QAngle(0, 0, 0);
bool Aim = false;
if (InputSystem()->IsButtonDown(KEY_LALT) && HackVars::Aimbot::Enabled && !HoldingTool && !ForcedPacket) {
if (H::ClosestTargetToCrosshair(cmd, Target, TargetAngle) && bCanShoot) {
cmd->viewangles = TargetAngle + SpreadAngle;
cmd->buttons.SetFlag(IN_ATTACK);
H::Util::CorrectMovement(cmd, ViewAngle);
Aim = true;
cmd->tick_count = TIME_TO_TICKS(Target->m_flSimulationTime());
// ^ that will not hit anyone fake lagging in hvh fyi.
}
}
HackVars::Aimbot::AimbotTarget = Target;
cmd->viewangles = H::Util::Math::FixAngles(cmd->viewangles);
PredictionSystem.EndPrediction(cmd);
orgCreateMove(ClientMode, flInputSampleTime, cmd);
QAngle TargetAngle2 = QAngle(0, 0, 0);
C_GMOD_Player* player = nullptr;
if (H::ClosestTargetToCrosshair(cmd, player, TargetAngle2) && HackVars::Aimbot::backstab)
{
cmd->viewangles = player->EyeAngles();
orgCreateMove(ClientMode, flInputSampleTime, cmd);
Vector forward; AngleVectors(TargetAngle2, &forward);
*(Vector*)((uintptr_t)cmd + 0x40) = forward;
*(bool*)((uintptr_t)cmd + 0x3f) = true;
}
if (ForcedPacket)
sendpacket = true;
if (sendpacket) {
HackVars::LastSentInfo::Position = LocalPlayer->GetRenderOrigin();
HackVars::LastSentInfo::viewangles = cmd->viewangles;
}
if (Aim)
return !HackVars::Aimbot::Silent;
}
return false;
};
UPD: Работает только в одном направлении к противнику...
Последнее редактирование: