Thread: Aimbot Code

Results 1 to 4 of 4
  1. #1
    paradoxcod4's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Posts
    19
    Reputation
    10
    Thanks
    8

    Aimbot Code

    Code:
    bool GetBoneOrigin ( CEntity* Ent, Vector3 * Origin, WORD Bone )
    {
        if(!Ent||!Ent->bIsValidEnt||!Ent->bIsAlive) return 0;
        if(!CODGetTagPos ( Bone, Ent, Origin ) )
            Origin    = &Ent->Location; 
            return Ent->Location;
    }
    Code:
    class CGameServer
    {
    public:
    char unknown0[8]; //0x0000
    DWORD screenX; //0x0008 screenX
    DWORD screenY; //0x000C screenY
    float screenAspect; //0x0010 screenXBias
    DWORD serverCommandSequence; //0x0014 serverCommandSequence
    DWORD processedSnapshotNum; //0x0018 processedSnapshotNum
    DWORD boolLocalServer; //0x001C
    char GameType[4]; //0x0020 Dom, sd, sab, war, koth=HQ, dm = free for al
    };
    CGameServer* server = (CGameServer*)0x0074A908;
    Code:
    BOOL DoAimbot( void )
    {__try{
        CEntity * pCurTarget = NULL;
        CEntity * pBestTarget = NULL;
        CClientInfo * pClientInfo = NULL;
        float fClosestDistance     = 999.0f;
        D3DXVECTOR3 vAimPos, vLocalPos,ViewOrigin, Trajectory;
        int iFound = -1;
    
        WORD HeadBone = RegisterTag_( "j_helmet", 1,7 );
        int nIndex;
        for (nIndex = 0; nIndex < MAX_PLAYERS; nIndex++ )
        {
            pCurTarget = GetEntityIndex( nIndex );
            pClientInfo = GetClientIndex( nIndex );
    //below we check valid target, enemy team and is target alive
            if ( ! ( IsValidEntity ( pCurTarget, pClientInfo )))
                continue;
    
            if ( !IsAlive( pCurTarget ) )
                continue;
    
            bool bEnemyTarget = ( pClientInfo->iTeamID != gLocalInfo->iTeamID || gLocalInfo->iTeamID == TEAM_FREE );
            if ( bEnemyTarget == FALSE )
                continue;
    //FFA check for aimbot
            if (!memcmp(server->GameType,"dm",2))
                if(nIndex == gCG->iLocalClient)
                    continue;
    
            if(!GetBoneOrigin( pCurTarget, VecAimSpot, HeadBone ))
                     continue;
    
            float flCurrent = CMath.GetDistance(camera->Location, pCurTarget->Location ) / 48.0f;
            //we check for target visibility on our just gotten aim location
            if( Trace_Target ( camera->Location,  VecAimSpot ) )
            {
                //we check if targets is on closer distance
                if (flCurrent < fClosestDistance)
                {
                    if(cvar.autozoom==1)
                    {
                        AutoZoom(true);
                    }
                    fClosestDistance    = flCurrent;
                    iFound                = nIndex;
                    pBestTarget            = pCurTarget;
                }
            }
        }
        if ( pBestTarget == NULL )
            return 1;
    
        float * AimAt = pBestTarget->Location;
        AimAt[2] -= .5f;
        
        float fEnemySpeed[3];
        //this is my poor selfpredict method
        VectorSubtract(pBestTarget->NewLocation,pBestTarget->OldLocation,fEnemySpeed);//subtract between NEW and OLD entity Location wich causes us getting the enemy speed!
        // below we apply the speed to our aiming position!
        AimAt[0] += fEnemySpeed[0] + fEnemySpeed[0];
        AimAt[1] += fEnemySpeed[1] + fEnemySpeed[1];
        AimAt[2] += fEnemySpeed[2] + fEnemySpeed[2];
        if ( cvar.autoaim == 1 )
        {
            if(cvar.aimbot == 1)
            {
                //here we set our view angles to target location
                CMath.GetAngleToOrigin( AimAt, &AimViewAngleX, &AimViewAngleY);
                viewangles->ViewAngleX += AimViewAngleX * cvar.aimspeed / 10.f;
                viewangles->ViewAngleY += AimViewAngleY * cvar.aimspeed / 10.f;
            }
        }
        if(cvar.autofire == 1)
        {
            hSendCommand(1,1,"+attack");
            hSendCommand(1,1,"-attack");
        }
    }__except(EXCEPTION_EXECUTE_HANDLER){
        return FALSE;

  2. The Following 2 Users Say Thank You to paradoxcod4 For This Useful Post:

    lowbotnoob (11-27-2012),veryniceguy (11-27-2012)

  3. #2
    lowbotnoob's Avatar
    Join Date
    Nov 2012
    Gender
    male
    Posts
    12
    Reputation
    10
    Thanks
    2
    Very usefull

  4. #3
    veryniceguy's Avatar
    Join Date
    Nov 2012
    Gender
    male
    Posts
    14
    Reputation
    10
    Thanks
    15
    Nice but i prefer to put data file from player insted of position

    Code:
    ///
    PLAYER_DATA GetMyPlayerData(void)
    {
    PLAYER_DATA Player; // Create a blank PLAYER_DATA struct
    ZeroMemory(&Player, sizeof(PLAYER_DATA)); // Initiate it all to 0 (thanks L.Spiro, this solved some problems)
    Peek((void*)mBase,(void*)&Player.baseadd,4); // Get our players Base Address from the pointer
    
    Player.coordEWa = Player.baseadd + 0x8; // Get all the addies for everything...the 0x8, 0xC and shit are the offsets I found for DFX
    Player.coordNSa = Player.baseadd + 0xC;
    Player.coordUDa = Player.baseadd + 0x10;
    Player.lookXa = Player.baseadd + 0x14;
    Player.lookYa = Player.baseadd + 0x18;
    Player.namea = Player.baseadd + 0xF4;
    
    Peek((void*)Player.coordEWa,(void*)&Player.coordEW ,4); // Now we got all the addies, read in the info from em all
    Peek((void*)Player.coordNSa,(void*)&Player.coordNS ,4);
    Peek((void*)Player.coordUDa,(void*)&Player.coordUD ,4);
    Peek((void*)Player.lookXa,(void*)&Player.lookX,4);
    Peek((void*)Player.lookYa,(void*)&Player.lookY,4);
    Peek((void*)Player.namea,(void*)&Player.name,15);
    
    return Player; // Give our PLAYER_DATA Player, as the return value
    }
    ///
    PLAYER_DATA GetPlayerData(BYTE PlayerNum) // Takes the number of the player as a param
    {
    PLAYER_DATA Player;
    ZeroMemory(&Player, sizeof(PLAYER_DATA));
    Peek((void*)hBase,(void*)&Player.baseadd,4);
    
    Player.baseadd = Player.baseadd + (PlayerNum*0x388); // 0x388 is the gap between players, starting with player 1
    
    Player.coordEWa = Player.baseadd + 0x8;
    Player.coordNSa = Player.baseadd + 0xC;
    Player.coordUDa = Player.baseadd + 0x10;
    Player.lookXa = Player.baseadd + 0x14;
    Player.lookYa = Player.baseadd + 0x18;
    Player.namea = Player.baseadd + 0xF4;
    
    Peek((void*)Player.coordEWa,(void*)&Player.coordEW ,4);
    Peek((void*)Player.coordNSa,(void*)&Player.coordNS ,4);
    Peek((void*)Player.coordUDa,(void*)&Player.coordUD ,4);
    Peek((void*)Player.lookXa,(void*)&Player.lookX,4);
    Peek((void*)Player.lookYa,(void*)&Player.lookY,4);
    Peek((void*)Player.namea,(void*)&Player.name,15);

  5. The Following User Says Thank You to veryniceguy For This Useful Post:

    vistamtigamami (11-27-2012)

  6. #4
    vistamtigamami's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Posts
    18
    Reputation
    10
    Thanks
    5
    i'll do it like veryniceguy says,he setuped those bones with player numbers very well think it will fit with gap between players when you start playing

Similar Threads

  1. AIMBOT code :D
    By xxeximusxx in forum Combat Arms Coding Help & Discussion
    Replies: 4
    Last Post: 11-01-2010, 09:38 PM
  2. [Solved]Aimbot code "ONE THAT DON'T SPAWN BULLETS IN THEIR HEAD"
    By ~Just IN~ in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 5
    Last Post: 10-31-2010, 05:36 AM
  3. Ok so i have aimbot codes
    By faaggoott ║ ╘ in forum Combat Arms Discussions
    Replies: 31
    Last Post: 03-01-2010, 11:44 PM
  4. [Undetected] Free Aimbot coded by JP
    By FREEHACKSFROMJP in forum Combat Arms Hacks & Cheats
    Replies: 51
    Last Post: 08-26-2009, 04:09 AM
  5. I need aimbot codes PLEASE
    By eskimo123321 in forum General Hacking
    Replies: 2
    Last Post: 08-04-2008, 08:33 PM