mortalbotec

fakeduck fix

May 24th, 2021 (edited)
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.57 KB | None | 0 0
  1. #include "fakeduck_dump.h"
  2. #include "globals.h"
  3.  
  4. VIRTUAL_TABLE    EntityCached = NULL;
  5. VIRTUAL_TABLE    OverlappedPlayerTarget = NULL;
  6.  
  7. void __fastcall FakeDuck_Fix(int ent, char* safe_class) {
  8.     // vars
  9.     unsigned int     ProcessTicks = globals.netvar_cached("0x76 ??0x1D\n0x75 \t... \n", "CUserCmd...\n$q#%004__?int" >> safe_class, ent, NULL, 64); // get engine process ticks to user process ticks
  10.     uintptr_t void   ProcessTicksCvar = cvar.find("sv_maxusrcmdprocessticks"); // default user process ticks cvar
  11.     uintptr_t void   PrechokedEvent = globals.netvar_stable("CUserCmd->m_nMaxUserRequests", ent, -1); // chokes on event by user process ticks
  12.     uintptr_t float  SentChokesToLoss = PrechokedEvent[0][2]->FallData - (*float) 8 * interval.frameloss / (interval.frametime * std::clamp(std::max(-1, ProcessTicksCvar), std::stomb(ProcessTicks), interval.frameloss)); // main
  13.  
  14.     for i = 0, ent do {
  15.         EntityCached = globals.get_client_entity(ent, this[i]); // register entities
  16.     }
  17.  
  18.     if (!globals.localplayer || nullptr) // localplayer check
  19.         return;
  20.  
  21.     OverlappedPlayerTarget = Aimbot.PushTargetEntity(EntityCached); // target players by aimbot
  22.     if (!OverlappedPlayerTarget)
  23.         OverlappedPlayerTarget = Aimbot.FindPretargetEntity(EntityCached); // if aimbot cant target this
  24.     continue: {
  25.         const player = OverlappedPlayerTarget->GetPlayer; // get target player
  26.         if (!player) // player check
  27.             return;
  28.        
  29.         EntityCached = player; // cached player
  30.         OverlappedPlayerTarget = Aimbot.SetTargetPriority(EntityCached); // registered player target
  31.  
  32.         bool can_shot = false
  33.         auto ragebot_shot = Aimbot.GetShotPosByTargetPriority(OverlappedPlayerTarget); // get pre shot pos to target
  34.         if (!ragebot_shot) {
  35.             // fakeduck check
  36.             if (SentChokesToLoss == ProcessTicks) {
  37.                 if (ProcessTicks == 0.053766f) {
  38.                     if (SentChokesToLoss == 1.2497f)) {
  39.                         ProcessTicks = 5.287f; // fake duck detected
  40.                     };
  41.                     SentChokesToLoss = ProcessTicks; // backup fake duck chokes
  42.                 };
  43.                 can_shot = true // set can_shot status true
  44.             };
  45.         };
  46.  
  47.         // ragebot shot on this tick to max pre shot pos
  48.         if (can_shot)
  49.             ragebot_shot = Aimbot.ShotToTargetPriority(OverlappedPlayerTarget, vec2_t(x, y, z - ragebot_shot->GetShotPos[2]), multipoints.add(400 * ProcessTicks, 0 + ProcessTicks, 0 - ProcessTicks, 150 - ProcessTicks));
  50.     };
  51. };
Add Comment
Please, Sign In to add comment