void GameState::displayLoop(SDL_Surface * surface) { Item item1 = Item(1,"Obj1",false,1,Coordinates(0,0),Resource()); Item item01 = Item(6,"Obj01",false,1,Coordinates(0,1),Resource()); Item item10 = Item(7,"Obj10",false,1,Coordinates(1,0),Resource()); Item item11 = Item(8,"Obj11",false,1,Coordinates(1,1),Resource()); Item item02 = Item(9,"Obj02",false,1,Coordinates(0,2),Resource()); Item item20 = Item(10,"Obj20",false,1,Coordinates(2,0),Resource()); Item item22 = Item(11,"Obj22",false,1,Coordinates(2,2),Resource()); Item item2 = Item(2,"Obj2",false,1,Coordinates(9,9),Resource()); Item item3 = Item(3,"Obj3",false,1,Coordinates(9,0),Resource()); Item item4 = Item(4,"Obj4",false,1,Coordinates(0,9),Resource()); Item item5 = Item(5,"Obj5",false,1,Coordinates(4,4),Resource()); std::vector<Item> items; Scene mainScene = Scene(1,items ,LocalPlayer()); mainScene.addItem(item1); mainScene.addItem(item2); mainScene.addItem(item3); mainScene.addItem(item4); mainScene.addItem(item5); mainScene.addItem(item10); mainScene.addItem(item01); mainScene.addItem(item11); mainScene.addItem(item20); mainScene.addItem(item02); mainScene.addItem(item22); mainScene.render(surface); }
void aimbot::RunCommand(UserCmd *ucmd) { if (movehelper == nullptr) return; #ifdef VORANGEBOX static int offset = *(int *)util::FindPattern(prediction->GetMethod<void *>(17), 0x100, ((const pattern *)"\x02\x41\x00\x00\x00\x89\xE8")); #endif #ifdef VL4D static int offset = *(int *)util::FindPattern(prediction->GetMethod<void *>(18), 0x100, ((const pattern *)"\x02\x41\x00\x00\x00\x89\xE8")); #endif #ifdef VALIENSWARM static int offset = *(int *)util::FindPattern(prediction->GetMethod<void *>(19), 0x100, ((const pattern *)"\x02\x41\x00\x00\x00\x89\xE8")); #endif Entity *lp = LocalPlayer(); WritePtr<UserCmd *>(lp, offset, ucmd); GetVFunc<void (__thiscall *)(void *, Entity *)>(movehelper, 1)(movehelper, lp); real_flags = ReadPtr<int>(lp, m_fFlags); char movedata[0x100] = {0}; prediction->SetupMove(lp, ucmd, nullptr, movedata); movement->ProcessMovement(lp, movedata); prediction->FinishMove(lp, ucmd, movedata); next_flags = ReadPtr<int>(lp, m_fFlags); }
void __thiscall hooked_RunCommand(void *t, Entity *pl, UserCmd *ucmd, void *movehelper) { if (pl == LocalPlayer()) { aimbot::movehelper = movehelper; if (ucmd && speedfix[ucmd->command_number % sizeof(speedfix)]) return aimbot::RunCommand(ucmd); } org_RunCommand(t, pl, ucmd, movehelper); }
bool aimbot::Ignore(CBaseEntity* e) { if (MENU_RAGEBOTE && e->EntIndex() == ragebot) return 0; int team = e->GetTeam(); switch (MENU_AIM4TEAM) { case 1: return team == LocalPlayer()->GetTeam(); case 2: return team != LocalPlayer()->GetTeam(); case 3: return 1; } return 0; }
void fix_nTickBase(const RecvProxyData* data, CBaseEntity* pl, int* out) { if (pl == LocalPlayer()) { static int stuck = 0; int update = data->m_Value.m_Int; *out = (update == stuck) ? pl->GetTickBase() + 1 : update; stuck = update; } else *out = data->m_Value.m_Int; }
void hud::DrawESP() { surface->SetFont(ui::font_hud); surface->SetTextColor(0xff, 0xff, 0xff, 0xff); Entity *lp = LocalPlayer(); int maxent = globals->maxclients(); for (int i = 1; i <= ents->GetMaxEntities(); ++i) { Entity *ent = ents->GetEntity(i); if (ent == nullptr || ent == lp) continue; if (ent->IsDormant()) continue; if (1 && i <= maxent) { if (!ent->IsAlive()) continue; int x0, y0, x1, y1; if (!MakeBox(ent, x0, y0, x1, y1)) continue; surface->SetColor(0x00, 0x00, 0x00, 0x7f); surface->DrawOutlinedRect(x0 - 1, y0 - 1, x1 + 1, y1 + 1); surface->DrawOutlinedRect(x0 + 1, y0 + 1, x1 - 1, y1 - 1); if (1) // menu.ESP.health surface->DrawFilledRect(x0 - 4, y0 - 1, x0 - 1, y1 + 1); #if defined(L4D) || defined(L4D2) switch (ent->GetTeam()) { case 2: case 4: surface->SetColor(0x46, 0x78, 0xff, 0xff); break; case 3: surface->SetColor(0x96, 0x00, 0xe1, 0xff); break; } #else switch (ent->GetTeam()) { case TEAM_RED: surface->SetColor(0xff, 0x64, 0x64, 0xff); break; case TEAM_BLU: surface->SetColor(0x46, 0x78, 0xff, 0xff); break; } #endif surface->DrawOutlinedRect(x0, y0, x1, y1); if (1) // menu.ESP.health { if (ent->GetHealth() <= ent->GetMaxHealth()) { if (ent->GetHealth() <= (ent->GetMaxHealth() / 4)) surface->SetColor(0xff, 0x00, 0x00, 0xff); else surface->SetColor(0x00, 0xff, 0x00, 0xff); } surface->DrawFilledRect(x0 - 3, y1 - Min<int>(y1 - y0, (float)(y1 - y0) * ((float)ent->GetHealth() / (float)ent->GetMaxHealth()) + 0.5f), x0 - 1, y1); } if (1) // menu.ESP.name { player_info info; engine->GetPlayerInfo(i, info); int length = 0; const wchar_t *text = tounicode(info.name, length); int tw, th; surface->GetTextSize(ui::font_hud, text, tw, th); surface->SetTextPos((x0 + x1 - tw) / 2, y0 - th); surface->DrawText(text, length, 0); } if (1) // menu.ESP.weapon { Entity *weapon = ent->GetActiveWeapon(); if (weapon) { const char *classname = weapon->GetClass(); #ifndef GMOD if (qstrlen(classname) > 6) { classname += 6; } #endif int length = 0; const wchar_t *text = util::MakeReadable(classname, length); int tw, th; surface->GetTextSize(ui::font_hud, text, tw, th); surface->SetTextPos((x0 + x1 - tw) / 2, y1 + 1); surface->DrawText(text, length, 0); } } continue; } if (1) { #if defined(L4D) || defined(L4D2) if (streq(ent->GetNetworkClass()->name, "Infected")) { if (!ent->NPC_IsAlive()) continue; int x0, y0, x1, y1; if (!MakeBox(ent, x0, y0, x1, y1)) continue; surface->SetColor(0x00, 0x00, 0x00, 0x7f); surface->DrawOutlinedRect(x0 - 1, y0 - 1, x1 + 1, y1 + 1); surface->DrawOutlinedRect(x0 + 1, y0 + 1, x1 - 1, y1 - 1); surface->SetColor(0xc8, 0xff, 0x00, 0xff); surface->DrawOutlinedRect(x0, y0, x1, y1); int tw, th; if (ReadPtr<bool>(ent, m_mobRush)) { surface->GetTextSize(ui::font_hud, L"Mob rush", tw, th); surface->SetTextPos((x0 + x1 - tw) / 2, y1 + 1); surface->DrawText(L"Mob rush", 8, 0); } else { surface->GetTextSize(ui::font_hud, L"Common", tw, th); surface->SetTextPos((x0 + x1 - tw) / 2, y1 + 1); surface->DrawText(L"Common", 6, 0); } continue; } if (streq(ent->GetNetworkClass()->name, "Witch")) { if (!ent->NPC_IsAlive()) continue; int x0, y0, x1, y1; if (!MakeBox(ent, x0, y0, x1, y1)) continue; surface->SetColor(0x00, 0x00, 0x00, 0x7f); surface->DrawOutlinedRect(x0 - 1, y0 - 1, x1 + 1, y1 + 1); surface->DrawOutlinedRect(x0 + 1, y0 + 1, x1 - 1, y1 - 1); surface->SetColor(0x96, 0x00, 0xe1, 0xff); surface->DrawOutlinedRect(x0, y0, x1, y1); int tw, th; surface->GetTextSize(ui::font_hud, L"Witch", tw, th); surface->SetTextPos((x0 + x1 - tw) / 2, y1 + 1); surface->DrawText(L"Witch", 5, 0); continue; } #endif } } }
void __thiscall hooked_SetViewAngles(void *t, Angle &angles) { bpaware(); register UserCmd *ucmd asm("esi"); #ifdef GMOD if (ucmd && ucmd->tick_count == 0 && ucmd->predicted) return; #endif org_SetViewAngles(t, angles); if (ucmd && ucmd->command_number == bp->next->arg<int>(1)) { Entity *lp = LocalPlayer(); Entity *weapon = lp->GetActiveWeapon(); float curtime = (float)lp->GetTickCount() * globals->interval(); if (!lp->IsAlive()) return; // static int speedcmd = 0; // if (speedfix[(ucmd->command_number+1) % sizeof(speedfix)] = (GetAsyncKeyState(VK_LSHIFT) && --speedcmd > 0)) // { // bp->next->next->next->next->ret -= 5; // } // else // { // speedcmd = 5; // } aimbot::RunCommand(ucmd); Angle viewang = ucmd->viewangles; bool canshoot = weapon && weapon->Clip1() > 0; #ifdef VORANGEBOX bool &sendpacket = *((bool *)bp->next->next->next - 1); #endif #ifdef VL4D bool &sendpacket = *((bool *)bp->next->next->next - 0x21); #endif #ifdef CSGO bool &sendpacket = *((bool *)bp->next - 0x1c); #endif if (1 && !lp->HasFlag(FL_ONGROUND)) // menu/bhop ucmd->buttons.del(IN_JUMP); if (1 && canshoot) // menu.aimbot { if (aimbot::Think(ucmd) && 0) { // org_SetViewAngles(t, ucmd->viewangles); } } if (1) // menu.norecoil { nospread::ApplyRecoil(lp, ucmd->viewangles, -1.0f); } if (canshoot && ucmd->buttons.test(IN_ATTACK)) { //if (1) // menu/nospread // nospread::ApplySpread(ucmd->command_number, lp, ucmd->viewangles, -1.0f); if (1 && weapon->GetNextPrimaryFire() > curtime) // menu/autopistol ucmd->buttons.del(IN_ATTACK); if (1) { if (weapon->GetNextPrimaryFire() > curtime) { ucmd->viewangles = viewang; } else { sendpacket = false; } } if (weapon->GetNextPrimaryFire() <= curtime) aimbot::Next(); } Angle move; VectorAngles(ucmd->move, move); float velocity = ucmd->move.Length2D(); float sin, cos; SinCos(Deg2Rad(ucmd->viewangles.y - viewang.y + move.y), sin, cos); if (ucmd->viewangles.x < -90.0f || ucmd->viewangles.x > 90.0f) { ucmd->move.x = sin * velocity; ucmd->move.y = cos * velocity; } else { ucmd->move.x = cos * velocity; ucmd->move.y = sin * velocity; } // ucmd->move.RotateInPlace(); } }
bool aimbot::Think(UserCmd *ucmd) { Entity *lp = LocalPlayer(); Entity *t = nullptr; float best = 3.40282347e+38f; weaponinfo = lp->GetActiveWeapon()->GetWeaponInfo(); Vector aim, tp, sp = lp->GetShootPos(); AngleVectors(ucmd->viewangles, aim); BulletFilter bf(lp); for (int i = 1, ignore = engine->GetLocalPlayer(), players = globals->maxclients(); #ifdef NPCS i <= ents->GetMaxEntities(); #else i <= globals->maxclients(); #endif i++) { if (i == ignore) continue; if (Entity *pl = ents->GetEntity(i)) { if (pl->IsDormant()) continue; if (i > players) continue; if (!CheckTarget(lp, pl)) continue; if (!pl->GetModel()) continue; if (!pl->SetupBones()) continue; float rate = RateOf(ucmd, lp, pl, i); if (rate >= best) continue; bf.against(pl); bool next = false; int index = 0; for (int j = pl->Hitboxes() - 1; j >= 0; j--) { hitbox *box = pl->GetHitbox(j); if (box->group == HITGROUP_HEAD) { Vector pos = pl->GetBoxPos(box); if (BulletTrace(sp, pos, &bf)) { t = pl; tp = pos; best = rate; shot = i; next = true; } index = j; break; } } if (!next && 1) // menu.aimbot.hitscan { for (int j = 0; j < pl->Hitboxes(); j++) { if (j == index) continue; hitbox *box = pl->GetHitbox(j); if (box->group && box->group != HITGROUP_HEAD) { Vector pos = pl->GetBoxPos(box); if (BulletTrace(sp, pos, &bf)) { t = pl; tp = pos; best = rate; shot = i; break; } } } } } } if (t != nullptr) { VectorAngles(tp - sp, ucmd->viewangles); //if (1) // menu.aimbot.autoshot // ucmd->buttons.add(IN_ATTACK); return true; } return false; }
Scene::Scene() { maxid = 0; player = LocalPlayer(); }
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(); }
void aimbot::Update() { lp = LocalPlayer(); dummy = 1; if (ragebot && (!ents->GetClientEntity(ragebot) || ragebot > globals->max_clients)) ragebot = 0; if (dod() && !lp->IsOnGround()) return; CBaseEntity* w = lp->GetActiveWeapon(); if (!w || !w->GetClip1() || w->IsReloading() || w->IsMelee()) return; bullet = !(w->GetNextPrimaryFire() > globals->cur_time); dummy = 0; }