static void * tf (void *arg) { setuid_tests[TESTNO (arg)].test (CHECK_BEFORE, THREADNO (arg)); int e = pthread_barrier_wait (&b3); if (e != 0 && e != PTHREAD_BARRIER_SERIAL_THREAD) { puts ("barrier_wait failed"); exit (1); } return tf2 (arg); }
TEST(Bullet, TransformOrder ) { btTransform tf(btQuaternion(1,0,0)); btTransform tf2(btQuaternion(0,0,0),btVector3(100,0,0)); btTransform tf3 = tf * tf2; tf*= tf2; EXPECT_TRUE(tf3 == tf); tf = btTransform(btQuaternion(1,0,0)); tf3 = tf; EXPECT_TRUE(tf.inverse() * tf2 == tf.inverseTimes(tf2)); }
bool aimbot::DoStateCheck(CBaseEntity* pl) { if (!pl->IsAlive()) return 0; if (Ignore(pl)) return 0; if (tf2()) { if (pl->TF2_IsUbercharged()) return 0; if (pl->TF2_HasCond(PlayerCond_Bonked)) return 0; // TODO: Find better way to check if it's invulnerable //if (pl->TF2_GetClassNum() == Class_Demoman && pl->GetHealth() == 1 && // !strcmp(mdlinfo->GetModelName(pl->GetModel()), "models/bots/demo/bot_sentry_buster.mdl")) // // return false; } if (MENU_SPAWPROT == 1 && ALPHA(pl->GetMDLColor()) == 128) return 0; if (MENU_SPAWPROT == 2 && pl->GetHealth() > 500) return 0; if (MENU_SPAWPROT == 3 && ALPHA(pl->GetMDLColor()) == 200) return 0; if (!MENU_STEAMBRO && pl->IsSteamFriend()) return 0; return 1; }
bool aimbot::Think(CUserCmd* cmd) { float best = std::numeric_limits<float>::quiet_NaN(); if (css()) { if (!GetMaterialParameters) GetMaterialParameters = (void (__cdecl*)(int, float&, float&))util::FindPattern("client", "\x55\x8B\xEC\x8B\x45\x08\x83\xC0\xBD"); if (!GetBulletTypeParameters) GetBulletTypeParameters = (void (__stdcall*)(int, float&, float&))util::FindPattern("client", "\x55\x8B\xEC\x56\x8B\x75\x08\x68????\x56\xE8????\x83\xC4\x08\x84\xC0" ); } if (!bf) bf = new BulletFilter(); target_id = 0; bf->hSelf = lp; Vector sp = lp->GetShootPos(); Vector tp = Vector(); CBaseEntity* w = lp->GetActiveWeapon(); if (gmod() && MENU_SPAWPROT == 3 && ALPHA(lp->GetMDLColor()) == 200) return 0; int lteam = lp->GetTeam(); int maxcl = (MENU_NPCAIMBT ? ents->GetHighestEntityIndex() : globals->max_clients); for (int i = 1; i <= maxcl; ++i) if (CBaseEntity* pl = ents->GetClientEntity(i)) { if (pl == lp) continue; //if (pl->IsDormant()) // continue; if (!pl->GetModel()) continue; bool npc = i > globals->max_clients; bool lowp = 1; if (npc) { const char* cclass = pl->GetClientClass()->m_pNetworkName; if (gmod()) { RecvTable* p = pl->GetClientClass()->m_pRecvTable->m_pProps[0].m_pDataTable; if ((strcmp(cclass, "CAI_BaseNPC") && (!p || strcmp(p->m_pNetTableName, "DT_AI_BaseNPC"))) || !pl->IsAlive()) continue; } if (tf2()) { if ( lowp = ( strcmp(cclass, "CObjectSentrygun") || ReadPtr<bool>(pl, m_bHasSapper) ) && ( strcmp(cclass, "CTFGrenadePipebombProjectile") || !ReadPtr<int>(pl, m_iType) || !ReadPtr<bool>(pl, m_bTouched) || !pl->IsDummyProjectile() || sp.DistTo(lp->GetAbsOrigin()) > 768.f ) ) continue; if (pl->GetTeam() == lteam) continue; } } else if (!DoStateCheck(pl)) continue; if (!pl->UpdateBones()) continue; float rate = Rate(lp, pl, npc); if (!lowp) rate *= 0.1f; if (rate > best) continue; if (css() && pl->GetOrigin().DistTo(sp) > 8192.f) continue; int aim = GetAimBone(pl); bool doscan = 1; if (pl->GetHitbox(aim)) { Vector box = pl->GetBoxPos(aim); if (BulletTrace(sp, box, pl)) { target_id = i; best = rate; tp = box; continue; } } if (doscan && MENU_BONESCAN) { int m = pl->Hitboxes(); for (int j = 0; j < m; ++j) { if (j == aim) continue; if (pl->GetHitbox(j)) { Vector box = pl->GetBoxPos(j); if (BulletTrace(sp, box, pl)) { target_id = i; best = rate; tp = box; continue; } } } } } if (target_id > 0) { CBaseEntity* pl = ents->GetClientEntity(target_id); if (!pl) return 0; if (target_id > globals->max_clients) // TODO: predict non-lag comepnsated stuff { tp -= pl->GetAbsOrigin(); tp += pl->GetOrigin() + pl->GetVelocity() * engine->GetNetChannel()->GetPing(); } cmd->viewangles = (tp - sp).Angle(); NormalizeAngles(cmd->viewangles); if (MENU_AUTOSHOT) add(cmd->buttons, IN_ATTACK); return 1; } return 0; }
float aimbot::Rate(CBaseEntity* me, CBaseEntity* pl, bool npc) { if (!npc && MENU_RAGEBOTE && pl->EntIndex() == ragebot) return 0.f; float rate = 0.f; switch (MENU_PRIORSYS) { case 0: rate = me->GetAbsOrigin().DistTo(pl->GetAbsOrigin()); break; case 1: { Vector path = (pl->GetAbsOrigin() - me->GetAbsOrigin()).Angle(); Vector eyes = me->GetEyeAngles(); NormalizeAngles(eyes); rate = path.DistTo(eyes); break; } case 2: { Vector path = (me->GetAbsOrigin() - pl->GetAbsOrigin()).Angle(); Vector eyes = pl->GetEyeAngles(); NormalizeAngles(eyes); rate = path.DistTo(eyes); break; } case 3: { return pl->EntIndex() < next_shot ? 0.f : 1.f; } } if (npc) { rate *= 3.f; } else { if (tf2()) { if (pl->TF2_HasCond(PlayerCond_Cloaked)) rate *= 50.f; if (pl->TF2_HasCond(PlayerCond_DeadRingered)) rate *= 100.f; if (pl->TF2_GetClassNum() == Class_Medic) if (ReadPtr<bool>(pl->GetActiveWeapon(), m_bHealing)) rate *= 0.05f; } } return rate; }
void CreateMove(CUserCmd* cmd) { sendPacket = 1; CBaseEntity* me = LocalPlayer(); CBaseEntity* w = me->GetActiveWeapon(); Vector qrv = cmd->viewangles; globals->cur_time = (float)me->GetTickBase() * ReadPtr<float>(me, m_flLaggedMovementValue) * globals->interval_per_tick; aimbot::Update(); aimbot::PerformPrediction(cmd); bool aim = 0; if (MENU_AIMBOTEN && (!MENU_AIMBOTKB || util::IsKeyDown(MENU_AIMBOTKB)) && !aimbot::dummy) aim = aimbot::Think(cmd); if (!MENU_FAKEVIEW && aim) engine->SetViewAngles(cmd->viewangles); nospread::HandleCmd(cmd, w); if (MENU_NORECOIL && !aimbot::dummy) { nospread::FixRecoil(cmd); NormalizeAngles(cmd->viewangles); } if (MENU_SEMIFULL && !aimbot::dummy && !aimbot::bullet) del(cmd->buttons, IN_ATTACK); if (tf2() && MENU_AUTOSTAB && w && !strcmp(w->GetClientClass()->m_pNetworkName, "CTFKnife") && !me->TF2_IsCloaked() && ReadPtr<bool>(w, m_bReadyToBackstab)) add(cmd->buttons, IN_ATTACK); if (MENU_AUTORELD && w && !w->IsMelee() && !w->GetClip1() && !w->IsReloading()) { add(cmd->buttons, IN_RELOAD); del(cmd->buttons, IN_ATTACK); } if (aim) { if (chk(cmd->buttons, IN_ATTACK) && aimbot::bullet) aimbot::next_shot = aimbot::target_id; } else aimbot::next_shot = 0; if (gmod() && MENU_PROPKILL && w && !strcmp(w->GetClientClass()->m_pNetworkName, "CWeaponPhysGun")) { static int hold = 0, punt = 0; if (chk(cmd->buttons, IN_ATTACK)) { float latency = engine->GetNetChannel()->GetPing(); hold = (int)((1.0f / globals->interval_per_tick) * (latency + 0.05f)); punt = (int)((1.0f / globals->interval_per_tick) * (latency + 0.2f)); } else { if (hold > 0) { add(cmd->buttons, IN_ATTACK); hold--; } if (punt > 0) { *cmd->mousewheel() = 0x7F; punt--; } } } if (MENU_FAKEDUCK && css() && me->IsAlive() && me->IsOnGround() && chk(cmd->buttons, IN_DUCK) && (cmd->tick_count % 2)) { del(cmd->buttons, IN_DUCK); del(cmd->buttons, IN_ATTACK); sendPacket = 0; } if (MENU_SMACAIMB) { static Vector old = cmd->viewangles; Vector snap = (cmd->viewangles - old); NormalizeAngles(snap); const float smac = 42.f; if (snap.Normalize() > smac) { cmd->viewangles = old + snap * smac; NormalizeAngles(cmd->viewangles); if (aimbot::bullet) del(cmd->buttons, IN_ATTACK); } old = cmd->viewangles; } if (me->IsAlive()) { //if (MENU_ANTIAIMB) // antiaim::Think(cmd, &sendPacket); static float move = 400.f; // move = max(move, (abs(cmd->move.x) + abs(cmd->move.y)) * 0.5f); float s_move = move * 0.5065f; if (MENU_AUTOSTRF) { if ((chk(cmd->buttons, IN_JUMP) || !me->IsOnGround()) && me->GetWaterLevel() < 2) { cmd->move.x = move * 0.015f; cmd->move.y += (float)(((cmd->tick_count % 2) * 2) - 1) * s_move; if (cmd->mousex) cmd->move.y = (float)clamp(cmd->mousex, -1, 1) * s_move; static float strafe = cmd->viewangles.y; float rt = cmd->viewangles.y, rotation; rotation = strafe - rt; if (rotation < FloatNegate(globals->interval_per_tick)) cmd->move.y = -s_move; if (rotation > globals->interval_per_tick) cmd->move.y = s_move; strafe = rt; } } /* if (MENU_WALKBOST && !chk(cmd->buttons, IN_JUMP) && me->IsOnGround()) { if ((chk(cmd->buttons, IN_FORWARD) && chk(cmd->buttons, IN_MOVELEFT)) || (chk(cmd->buttons, IN_BACK) && chk(cmd->buttons, IN_MOVERIGHT))) if (even) { cmd->move.y += s_move; cmd->move.x += s_move; } else { cmd->move.y -= s_move; cmd->move.x -= s_move; } else if ((chk(cmd->buttons, IN_FORWARD) && chk(cmd->buttons, IN_MOVERIGHT)) || (chk(cmd->buttons, IN_BACK) && chk(cmd->buttons, IN_MOVELEFT))) if (even) { cmd->move.y += s_move; cmd->move.x -= s_move; } else { cmd->move.y -= s_move; cmd->move.x += s_move; } else if (chk(cmd->buttons, IN_FORWARD) || chk(cmd->buttons, IN_BACK)) if (even) cmd->move.y += s_move; else cmd->move.y -= s_move; else if (chk(cmd->buttons, IN_MOVELEFT) || chk(cmd->buttons, IN_MOVERIGHT)) if (even) cmd->move.x += s_move; else cmd->move.x -= s_move; } */ Vector qmove, fixed_va = cmd->viewangles; float speed = cmd->move.Length2D(); VectorAngles(cmd->move, qmove); NormalizeAngles(fixed_va); float yaw = Deg2Rad(fixed_va.y - qrv.y + qmove.y); float nyaw = FloatNegate(yaw); if (cmd->viewangles.x < -90.f || cmd->viewangles.x > 90.f) { cmd->move.x = FloatNegate(sin(nyaw) * speed); cmd->move.y = FloatNegate(cos(nyaw) * speed); } else { cmd->move.x = cos(yaw) * speed; cmd->move.y = sin(yaw) * speed; } if (MENU_BUNNYHOP) { static bool firstjump = 0, fakejmp; if (chk(cmd->buttons, IN_JUMP) && me->GetWaterLevel() < 2) if (!firstjump) firstjump = fakejmp = 1; else if (!me->IsOnGround()) if (MENU_BHOPSAFE && fakejmp && me->GetVelocity().z < 0.0f) fakejmp = 0; else del(cmd->buttons, IN_JUMP); else fakejmp = 1; else firstjump = 0; } } if (MENU_FAKELAGB) { static int q = 0; if (q > 0 && !((MENU_FAKELAGA && LocalPlayer()->GetVelocity().Length() < 100.f) || MENU_FAKELAGS && !aimbot::dummy && aimbot::bullet && chk(cmd->buttons, IN_ATTACK))) { q--; sendPacket = 0; } else q = MENU_FAKELAGN; } if (MENU_CHATSPAM && !(cmd->tick_count % (int)(0.2f / globals->interval_per_tick))) { char disrupt[] = { 0x7F, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0 }; util::SendStringCmd("say %s", disrupt); } if (MENU_NAMESTLR) namestealer::Think(); }
virtual bool ShouldHitEntity(CBaseEntity* E, int) { if (E == hTarget || E == hSelf) return 0; if (ClientClass* cl = E->GetClientClass()) { const char* cclass = cl->m_pNetworkName; if (tf2() && ( !strcmp(cclass, "CTFReviveMarker") || !strcmp(cclass, "CTFMedigunShield") || !strcmp(cclass, "CFuncRespawnRoomVisualizer") ) ) return 0; if (dod() && !strcmp(cclass, "CFuncNewTeamWall")) return 0; if (MENU_AIMGLASS && !strcmp(cclass, "CBreakableSurface")) return 0; } return 1; }