Advertisement
encoree1996

Untitled

May 12th, 2015
343
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.52 KB | None | 0 0
  1. void pSilent ( CUserCmd* cmd )
  2. {
  3.     //_asm INT 3
  4.     Angle oldView = cmd->viewangles;
  5.     float oldSidemove = cmd->sidemove;
  6.     float oldForwardmove = cmd->forwardmove;
  7.     static Vector aimAngles;
  8.     /////////// Do all aimbot / nospread / norecoil stuff here
  9.  
  10.     DWORD flags = pClientEntList->GetClientEntity ( pEngine->GetLocalPlayer ( ) )->GetFlags ( );
  11.     //PrintConsole ( "CURRENT FLAGS: %i %i\n", true, flags, 123 );
  12.     int shotsfired = pClientEntList->GetClientEntity ( pEngine->GetLocalPlayer ( ) )->ShotsFired ( );
  13.  
  14.     if ( gCvars.aimbot.bEnabled && (cmd->buttons & IN_ATTACK || gCvars.aimbot.bAutoshoot) && (flags & FL_ONGROUND) && cAim.bestTarget ( aimAngles ) )
  15.     {
  16.  
  17.         if ( gCvars.aimbot.bEnableRCS && shotsfired > 2 )
  18.         {
  19.             Vector vecPunchAngle =  cEng.GetPunchAngle ( pClientEntList->GetClientEntity ( pEngine->GetLocalPlayer ( ) ) );
  20.             aimAngles -= vecPunchAngle * gCvars.aimbot.fRCSmultiplier;
  21.         }
  22.  
  23.         cmd->viewangles = aimAngles;
  24.  
  25.         if ( gCvars.aimbot.bAutoshoot )
  26.             cmd->buttons |= IN_ATTACK;
  27.  
  28.     }
  29.  
  30.     ///////////////////////////
  31.     static BYTE bSPPattern [] = {0xB3, 0x01, 0x8B, 0x01, 0x8B, 0x40, 0x18, 0xFF, 0xD0, 0x84, 0xC0};
  32.     static char bSPMask [] = "xxxxxxxxxxx";
  33.     static BYTE* bSendPacket = ( BYTE* )(cEng.Pattern ( ( DWORD )GetModuleHandleA ( "engine.dll" ), 0xFFFFFFFF, bSPPattern, bSPMask )) + 0x01;
  34.  
  35.     IClientEntity* entWpn = pClientEntList->GetClientEntityFromHandle ( pClientEntList->GetClientEntity ( pEngine->GetLocalPlayer ( ) )->GetActiveWeaponHandle ( ) );
  36.  
  37.  
  38.     if ( !entWpn )
  39.         return;
  40.  
  41.  
  42.  
  43.     float fNextAttack = *( float* )(( DWORD )entWpn + 0x159C);
  44.  
  45.     int* iper_tick = ( int* )(( DWORD )GetModuleHandleA ( "client.dll" ) + 0x4A36F7C);
  46.     if ( !iper_tick )
  47.         return;
  48.  
  49.     int interval_per_tick = *iper_tick;
  50.  
  51.     float flServerTime = ( float )(pClientEntList->GetClientEntity ( pEngine->GetLocalPlayer ( ) )->readOffset<int> ( 0x17cc )) * interval_per_tick;
  52.  
  53.  
  54.  
  55.     bool bBulletTime = true;
  56.  
  57.     if ( fNextAttack > flServerTime )
  58.         bBulletTime = false;
  59.  
  60.     DWORD oldProtect, tmp;
  61.     VirtualProtect ( bSendPacket, 1, PAGE_EXECUTE_READWRITE, &oldProtect );
  62.  
  63.     if ( cmd->buttons & IN_ATTACK && bBulletTime )
  64.     {
  65.         *bSendPacket = false;
  66.     } else
  67.     {
  68.         *bSendPacket = true;
  69.         cmd->viewangles = oldView;
  70.         cmd->sidemove = oldSidemove;
  71.         cmd->forwardmove = oldForwardmove;
  72.     }
  73.     VirtualProtect ( bSendPacket, 1, oldProtect, &tmp );
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement