Thread: World2Radar

Results 1 to 6 of 6
  1. #1
    cardoow's Avatar
    Join Date
    Jan 2008
    Gender
    male
    Posts
    214
    Reputation
    28
    Thanks
    747
    My Mood
    Amazed

    World2Radar

    For my external radar i totally reversed the fullmap radar, so im sharing it because
    it might be usefull for some of you.

    Code:
    CRadarVecs * GetRadarInfo(CRadarHud * radarhud, CRadarSize radarSize)
    {	
    	float v15, v19;
    	CRadarVecs * radarvecs;
    
    	float v14 = radarhud->w / radarhud->h;
    	float v25 = *(float *)(0x8FF100 + (DWORD)487708) / *(float *)(0x8FF100 + (DWORD)487712);
    	float v22 = radarSize.VecA + radarhud->x;
    	float v23 = radarSize.Vecb + radarhud->y;
    
    	float v13 = v25;
    	float v12 = v14;
    
    	if ( v14 >= v25 )
            {    
    		float v27 = (v13 / v12) * radarhud->w;
    		float v17 = (radarhud->w * 0.5) + v22;
    
    		radarvecs->w = v17 - (0.5 * v27);
    		radarvecs->h = v23;
    		radarvecs->x = v27;
    		v15 = radarhud->h;		
            }
            else
            {
    		float v16 = (radarhud->h * 0.5) + v23;
    		float v26 = (v12 / v13) * radarhud->h;
    
    		radarvecs->w = v22;		
    		radarvecs->h = v16 - (0.5 * v26);
    		radarvecs->x = radarhud->w;
    		v15 = v26;
            }
    
    	radarvecs->y = v15;
    	float v28 = *(float *)(*(DWORD*)(0x8F16D0) + 0xC);
    	float v18 = radarvecs->x * 0.25;
    
            if ( v28 <= v18 )
            {
    		v19 = v28;
            }
            else
            {
    		v19 = v18;
            }
    
            float v20 = 0.25 * radarvecs->y;
            if ( v20 < v19 )
            {		
    		v19 = v20;
            }
    
    	radarvecs->w = radarvecs->w + v19;
    	radarvecs->h = radarvecs->h + v19;
    
    	float v21 = v19 + v19;
    
    	radarvecs->x = radarvecs->x - v21;
    	radarvecs->y = radarvecs->y - v21;
    
    	return radarvecs;
    }
    Code:
    float * GetRadarPos(CRadarVecs * radarvecs, Vec3 vTarget)
    {
    	Vec3 vOrigin;
    	float pos[2];
    
            vOrigin[0] = vTarget[0] - *(float *)(0x8FF100 + (DWORD)487700);
            vOrigin[1] = vTarget[1] - *(float *)(0x8FF100 + (DWORD)487704);
        
            float v18 = (*(float *)(0x8FF100 + (DWORD)487692) * vOrigin[0]) - (*(float *)(0x8FF100 + (DWORD)487688) * vOrigin[1]);
            float v19 = (vOrigin[1] * -*(float *)(0x8FF100 + (DWORD)487692)) - (vOrigin[0] * *(float *)(0x8FF100 + (DWORD)487688));
        
    	float v20 = (v18 / *(float *)(0x8FF100 + (DWORD)487708)) - 0.5;
            float v21 = (v19 / *(float *)(0x8FF100 + (DWORD)487712)) - 0.5;
      
    	pos[0] = radarvecs->x * v20;	
    	pos[1] = radarvecs->y * v21;	
    
    	return pos;
    }
    Code:
    void ShowRadarPos(CRadarHud * radarhud, CRadarSize radarSize, Vec3 vTarget, int Shader)
    {
    	float * fPos;
    	CRadarVecs * radarvecs = GetRadarInfo(radarhud, radarSize);
    
    	fPos = GetRadarPos(radarvecs, vTarget);	
        
    	float v20 = radarhud->x + (radarhud->w * 0.5f) + fPos[0];
    	float v10 = radarhud->y + (radarhud->h * 0.5f) + fPos[1];
    
    	DrawPic(v20, v10, 20, 20, cWhite, Shader);
    }
    example code on how to use it
    Code:
    DrawStretchPic(radarhud.x, radarhud.y, radarhud.w, radarhud.h, 0.0f, 0.0f, 1.0f, 1.0f, cWhite, *(DWORD*)0x976210);
    	
    for(int i=0; i<1024; i++)
    {
    	CEntity * pEnt = GetEntityByIndex(i);
    	if(!(pEnt->isAlive & 1))
    		continue;
    
    	if(pEnt->eType == ET_MISSILE)
    	{
    		char * szShader = GetWeaponShader(pEnt->WeaponNum);
    		if(szShader)
    			ShowRadarPos(&radarhud, radarsize, pEnt->vOrigin, RegisterShader(szShader, 7));
    	}
    }

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

    intervention61 (01-31-2012),lolbie (01-30-2012),[MPGH]master131 (01-30-2012),Sindreh93 (01-30-2012)

  3. #2
    Tdi Power's Avatar
    Join Date
    Dec 2011
    Gender
    male
    Posts
    4
    Reputation
    10
    Thanks
    0
    My Mood
    Amused
    seems nice !

  4. #3
    doan89's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Posts
    33
    Reputation
    10
    Thanks
    1
    which program use for these codes

  5. #4
    joeyjoey's Avatar
    Join Date
    Nov 2006
    Gender
    male
    Location
    Holland
    Posts
    2
    Reputation
    10
    Thanks
    0
    Quote Originally Posted by doan89 View Post
    which program use for these codes
    Paint

  6. #5
    master131's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    8,802
    Reputation
    3165
    Thanks
    73,308
    My Mood
    Breezy
    Don't post if you don't understand what to do with the code.
    Donate:
    BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9


    Handy Tools/Hacks:
    Extreme Injector v3.6.1 *NEW* Windows 10 compatible!
    A powerful and advanced injector in a simple GUI.
    Can scramble DLLs on injection making them harder to detect and even make detected hacks work again!

    Minion Since: 13th January 2011
    Moderator Since: 6th May 2011
    Global Moderator Since: 29th April 2012
    Super User/Unknown Since: 23rd July 2013
    'Game Hacking' Team Since: 30th July 2013

    --My Art--
    [Roxas - Pixel Art, WIP]
    [Natsu - Drawn]
    [Natsu - Coloured]


    All drawings are coloured using Photoshop.

    --Gifts--
    [Kyle]

  7. #6
    Derranged's Avatar
    Join Date
    Jan 2012
    Gender
    male
    Location
    Moranbah, Australia
    Posts
    55
    Reputation
    10
    Thanks
    5
    My Mood
    Yeehaw
    I hate being new to C++ xD

    Still have to learn a crap tonne before I could do something like this. Would be a lot easier if one of the more experienced hackers created a video tutorial.

    Oh well, goodjob ;D