Page 1 of 3 123 LastLast
Results 1 to 15 of 38
  1. #1
    CrazyFrost's Avatar
    Join Date
    May 2012
    Gender
    male
    Posts
    94
    Reputation
    33
    Thanks
    935
    My Mood
    Bored

    Smile Some code for ESP

    Decided to share some code with beginner programmers. Here is not the complete project, but only a part of functions - for ESP.
    In my cheat, I have three types of ESP:
    1)Display the names of Enemys
    2)Show healthbar.
    3)draw lines from the center of the screen to the enemy.

    WARNING - address in this code - only for RU CF! UPDATE IT FOR YOUR LOCALIZATION! IT'S CODE NOT FOR C+P

    Code:
    DWORD PlayerClient = *(DWORD*)(ClientShell+0x54);
    		if(PlayerClient!=NULL)
    		{
    			
    			  if(GetMeIdxInPlayerInfoList==NULL)
    			  {
    			  GetMeIdxInPlayerInfoList = (lpGetMeIdxInPlayerInfoList) (CShell + (0x1FD70));//this function return my player index
    			  }
    			int drawcount=0;
    			CPlayer *me = (CPlayer*)((ClientShell + (0x743C+4))+ (GetMeIdxInPlayerInfoList(ClientShell) * 0x4c8));//this is my player
    			
    			char szFormat[256];
    			for(int i=0;i<16;i++)//array of players
    			{
    				CPlayer * pPlayerInfo = (CPlayer*)((ClientShell + (0x743C+4))+ (i * 0x4c8));
    				if(strlen(pPlayerInfo->Name)>2 && pPlayerInfo->Team!=me->Team)//if player have name and his Enemy
    				{
    					drawcount++;
    					if(pPlayerInfo->Health>0)//If Enemy Alive
    					{
    					   
    						sprintf(szFormat,"%s",pPlayerInfo->Name);
    						D3DXVECTOR3 pos;
    						if(WorldToScreen(pDevice,pPlayerInfo->Object->Head,&pos))//If visible in My Screen
    						{
    							if(hack1>=1)//first type ESP
    							{
    							WriteText(szFormat,pos.x,pos.y,Red);//Draw Enemy Name
    							if(pPlayerInfo->Has_C4)
    							{
    								sprintf(szFormat,"%s","C4");
    								WriteText(szFormat,pos.x,pos.y+15+15,Red);//Draw what Enemy have C4
    							}
    							}
    						
    							if(hack1>=2)//second ESP type
    							{
    							if(pPlayerInfo->Health>=90)//enemy health is very good
    							{
    								DrawHealthBar(pos.x,pos.y+15,30,5,Green,Black,pPlayerInfo->Health,100,pDevice);
    							}
    							else if(pPlayerInfo->Health>=40)//enemy health is not good
    							{
    								DrawHealthBar(pos.x,pos.y+15,30,5,Yellow,Black,pPlayerInfo->Health,100,pDevice);
    							}
    							else //enemy health - very bad, you can kill him very easy :)
    							{
    								DrawHealthBar(pos.x,pos.y+15,30,5,Red,Black,pPlayerInfo->Health,100,pDevice);
    							}
    							
    							}
    								int ScreenCenterX = GetSystemMetrics(0) / 2;
    								int ScreenCenterY = GetSystemMetrics(1) / 2;
    								if(hack1>=3)// DrawLines from center screen to Enemy
    								{
    								DrawLine(ScreenCenterX,ScreenCenterY,pos.x,pos.y,1,Blue,pDevice);
    								}
    						}
    						
    					}
    					
    
    				}
    			}
    		}
    What you need for this code:

    Code:
    void DrawHealthBar(int x, int y, int w, int h, D3DCOLOR color, D3DCOLOR BorderColor, int hp, int maxhp,LPDIRECT3DDEVICE9 g_pDevice)
    {
    	FillRGB(x, y, ( hp / (double)maxhp ) * w, h, color, g_pDevice);
    	DrawBorder(x, y, w, h, BorderColor, g_pDevice);
    }
    bool WorldToScreen(LPDIRECT3DDEVICE9 pDev, D3DXVECTOR3 vWorld, D3DXVECTOR3* Pos)
    {
    	D3DVIEWPORT9 viewPort = {0};
    	D3DXMATRIX projection, view, world;
      	pDev->GetTransform(D3DTS_VIEW, &view);
    	pDev->GetTransform(D3DTS_PROJECTION, &projection);
    	pDev->GetTransform(D3DTS_WORLD, &world);
    	pDev->GetViewport(&viewPort);
    	D3DXVec3Project(Pos, &vWorld, &viewPort, &projection, &view, &world);
    	if(Pos->z < 1)
    	{
    		return true;
    	}
    	return false;
    }
    
    ID3DXLine *pLine = NULL;  
    void DrawLine(float x, float y, float x2, float y2, float width, D3DCOLOR color, LPDIRECT3DDEVICE9 pDevice)
    {
    	if(pLine==NULL)
    	{
    		D3DXCreateLine( pDevice, &pLine); 
    	}
        D3DXVECTOR2 vLine[2];
        pLine->SetWidth( width );
        pLine->SetAntialias( false );
        pLine->SetGLLines( true );
        vLine[0].x = x;
        vLine[0].y = y;
        vLine[1].x = x2;
        vLine[1].y = y2;
        pLine->Begin();
        pLine->Draw( vLine, 2, color );
        pLine->End();
    }
    and some classes:
    Code:
    struct cObject
    {
         char spacer00[0x4];
             D3DXVECTOR3 Origin;
             D3DXVECTOR3 Head;
    };
     
    struct UnkStruct
    {
            float Pitch;
            float Yaw;
            char spacer00[0xC6];
            bool IsDead;
            char spacer01[0x1647];
            unsigned char CurrentGun;
            char spacer02[0x3];
            bool IsMutant;
    };
     
    struct CPlayer
    {
          //  char spacer00[0x8];
            cObject* Object;
            char ClientID;
            char Team;    
            char Name[12];
            char spacer01[0x2];
            UnkStruct *unk;
            int PlayerSlotTeam;
            int unkstruct1;
            bool Has_C4;
            int State;
            int Rank;
            int unkstruct2;
            int unkstruct3;
            short Health;
            short Kills;
    };
    How find address for ESP? Its simple - run game with bypass (or use special LoadLib program), attach to game with OllyDbg.
    Select "Cshell.dll" module, and use this string for binary scan: "56 8B F1 0F B6 86 ?? ?? ?? ?? 50 E8 ?? ?? ?? ?? 83 C4 04"
    after that u see function with desired offsets. use function prototype:
    Code:
    typedef int (__thiscall *lpGetMeIdxInPlayerInfoList)(unsigned long ulCLTClientShell);
    lpGetMeIdxInPlayerInfoList GetMeIdxInPlayerInfoList;
    update desired offsets or use this log

    Enjoy! Sorry for my English.

    Credits: luizimloko &~FALLEN~
    can I have someone forgot to add in the credits?

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

    DarkPladin (01-22-2013),dreek1 (01-21-2013),mamo007 (04-08-2015),needhash (01-31-2013),prolife200 (09-09-2015),Sirius Blac (01-21-2013),The Decoder (01-22-2013),The_Rostik (01-05-2017),zikox (10-26-2013)

  3. #2
    virganja's Avatar
    Join Date
    May 2011
    Gender
    male
    Location
    jakarta
    Posts
    19
    Reputation
    10
    Thanks
    1
    wow


    thank you very mush

  4. #3
    chr0me021a's Avatar
    Join Date
    Feb 2012
    Gender
    male
    Posts
    38
    Reputation
    10
    Thanks
    2
    My Mood
    Hungover
    thank you dude.

  5. #4
    3D's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Location
    In The World :P
    Posts
    1,007
    Reputation
    134
    Thanks
    14,172
    My Mood
    Amazed
    Why share thises ..

  6. #5
    Ryuesi's Avatar
    Join Date
    Jun 2011
    Gender
    male
    Location
    Right here.
    Posts
    7,339
    Reputation
    413
    Thanks
    2,397
    My Mood
    Relaxed
    Wait for 4846545 Hack now
    Why did u share that





    Contributor Since 24-11-2011 ~ 26-12-2011
    VM / PM




  7. #6
    CrazyFrost's Avatar
    Join Date
    May 2012
    Gender
    male
    Posts
    94
    Reputation
    33
    Thanks
    935
    My Mood
    Bored
    Quote Originally Posted by Jutie View Post
    Wait for 4846545 Hack now
    Why did u share that
    Most of people can't compile this code

  8. #7
    V I's Avatar
    Join Date
    Oct 2012
    Gender
    male
    Location
    Jewish land
    Posts
    1,440
    Reputation
    272
    Thanks
    2,443
    My Mood
    Aggressive
    cool story , now everyone have esp source
    fucktard.

  9. #8
    luizimloko's Avatar
    Join Date
    Feb 2011
    Gender
    male
    Location
    fs:[0]
    Posts
    1,879
    Reputation
    136
    Thanks
    10,140
    My Mood
    Yeehaw
    the peoples dont know keep the codes for yourself, and share with others. it is that happens

  10. #9
    Zacherl's Avatar
    Join Date
    May 2009
    Gender
    male
    Posts
    150
    Reputation
    10
    Thanks
    42
    My Mood
    Aggressive
    Quote Originally Posted by kareem111 View Post
    Why share thises ..
    These classes are public on UC for ages. And @~FALLEN~ posted them in his aimbot source on MPGH long time ago.

  11. #10
    Sirius Blac's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Location
    World
    Posts
    33
    Reputation
    10
    Thanks
    6
    My Mood
    Yeehaw
    Quote Originally Posted by REALITY™ View Post
    cool story , now everyone have esp source
    fucktard.
    lol dude stop scold all

  12. #11
    3D's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Location
    In The World :P
    Posts
    1,007
    Reputation
    134
    Thanks
    14,172
    My Mood
    Amazed
    Quote Originally Posted by Zacherl View Post
    These classes are public on UC for ages. And @~FALLEN~ posted them in his aimbot source on MPGH long time ago.
    Soooooo C+P

  13. #12
    Ryuesi's Avatar
    Join Date
    Jun 2011
    Gender
    male
    Location
    Right here.
    Posts
    7,339
    Reputation
    413
    Thanks
    2,397
    My Mood
    Relaxed
    Quote Originally Posted by CrazyFrost View Post
    Most of people can't compile this code
    who said that , anyone know 10% C++ Can Compile it easy
    Just call the ESP if u are using D3D Menu at Present/EndScence Hook





    Contributor Since 24-11-2011 ~ 26-12-2011
    VM / PM




  14. #13
    DarkPladin's Avatar
    Join Date
    Jul 2012
    Gender
    male
    Location
    (◔̯◔)
    Posts
    365
    Reputation
    10
    Thanks
    610
    My Mood
    Devilish
    Quote Originally Posted by Jutie View Post


    who said that , anyone know 10% C++ Can Compile it easy
    Just call the ESP if u are using D3D Menu at Present/EndScence Hook
    NO Read the code carefully , it needs some thing !

  15. #14
    mamo007's Avatar
    Join Date
    Apr 2012
    Gender
    male
    Location
    Behind You !
    Posts
    1,654
    Reputation
    216
    Thanks
    15,611
    My Mood
    Amazed
    thanks for sharing but many will leech it ...
    [Source Code] Present Hooks Win 7/8 .. 8.1/10


    - removed youtube video as it had an outside link


  16. #15
    Dragon(H)ell's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Posts
    703
    Reputation
    154
    Thanks
    4,819
    My Mood
    Angelic
    it's 90& working even that most of people here still can't compile it

Page 1 of 3 123 LastLast

Similar Threads

  1. [Release] I have some Code for user.ini hack
    By frostmoon in forum Mission Against Terror Hacks & Cheats
    Replies: 12
    Last Post: 11-14-2012, 09:46 PM
  2. Imneed Some Codes For Hack
    By magicwar7 in forum CrossFire Hack Coding / Programming / Source Code
    Replies: 22
    Last Post: 07-16-2012, 01:15 PM
  3. some codes for fun
    By scoutboss in forum WarRock - International Hacks
    Replies: 7
    Last Post: 03-14-2010, 01:42 PM
  4. [Source Code] some codes for ..
    By YellowDanger in forum CrossFire Hacks & Cheats
    Replies: 15
    Last Post: 03-14-2010, 05:22 AM
  5. LVL 16 wr account + Working Bypass + Some hacks for a retail code
    By eusker03 in forum Trade Accounts/Keys/Items
    Replies: 2
    Last Post: 06-11-2007, 03:49 AM