google-site-verification: googlebaca44933768a824.html [CSS] weapon id + alias [external] - Old Royal Hack Forum

Announcement

Collapse
No announcement yet.

[CSS] weapon id + alias [external]

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [CSS] weapon id + alias [external]

    Code:
    DWORD CWeapon::getActiveWeapon(DWORD dwPlayer)
    {
    	DWORD dwWeaponHandle;
    	g_pHack->readMemory((void*)(dwPlayer + 0xD28), &dwWeaponHandle, sizeof(dwWeaponHandle), NULL);
    	if (dwWeaponHandle != -1)
    	{
    		DWORD dwEntityListAddress = g_pHack->m_dwClient + 0x2A2300 + 0x266B94;
    		DWORD dwEntityList;
    		g_pHack->readMemory((void*)(dwEntityListAddress), &dwEntityList, sizeof(dwEntityList), NULL);
    		DWORD dwTemp = dwWeaponHandle;
    		dwTemp &= 0xFFF;
    		dwTemp += dwTemp;
    		DWORD dwX = dwEntityList + dwTemp * 8 + 4;
    		dwWeaponHandle >>= 0xC;
    		DWORD dwValueX;
    		g_pHack->readMemory((void*)(dwX + 0x4), &dwValueX, sizeof(dwValueX), NULL);
    		if (dwWeaponHandle == dwValueX)
    		{
    			g_pHack->readMemory((void*)(dwX), &m_dwBaseAddress, sizeof(m_dwBaseAddress), NULL);
    			return m_dwBaseAddress;
    		}
    	}
    	m_dwBaseAddress = NULL;
    	return m_dwBaseAddress;
    }
    
    int CWeapon::getWeaponId(void)
    {
    	if (!m_dwBaseAddress)
    		return 0;
    
    	DWORD dwVTable = 0;
    	g_pHack->readMemory((void*)m_dwBaseAddress, &dwVTable, sizeof(dwVTable), NULL);
    	DWORD dwGetWeaponIdFunc = 0;
    	g_pHack->readMemory((void*)(dwVTable + 0x58C), &dwGetWeaponIdFunc, sizeof(dwGetWeaponIdFunc), NULL);
    	int iWeaponID = 0;
    	g_pHack->readMemory((void*)(dwGetWeaponIdFunc + 0x1), &iWeaponID, sizeof(iWeaponID), NULL);
    	return iWeaponID;
    }
    
    char* CWeapon::getWeaponAlias(int iWeaponID)
    {
    	DWORD dwWeaponListAddress = g_pHack->m_dwClient + 0x2A2300 + 0x2761B0;
    	for (int i = 0; i < 0x26; i++)
    	{
    		int iWeaponIDinArray = 0;
    		g_pHack->readMemory((void*)(dwWeaponListAddress+8*i), &iWeaponIDinArray, sizeof(iWeaponIDinArray), NULL);
    		if (iWeaponID == iWeaponIDinArray)
    		{
    			dwWeaponListAddress += 0x4;
    			DWORD dwWeaponNameAddress = 0;
    			g_pHack->readMemory((void*)(dwWeaponListAddress+8*i), &dwWeaponNameAddress, sizeof(dwWeaponNameAddress), NULL);
    
    			char cLetter = 1;
    			DWORD dwCurPos = dwWeaponNameAddress;
    			int iLength = 0;
    			while (cLetter != NULL)
    			{
    				g_pHack->readMemory((void*)dwCurPos, &cLetter, sizeof(cLetter), NULL);
    				iLength++;
    				dwCurPos++;
    			}
    			char *pcWeaponName = new char[iLength];
    			g_pHack->readMemory((void*)dwWeaponNameAddress, pcWeaponName, iLength, NULL);
    			return pcWeaponName;
    		}
    	}
    	return NULL;
    }

    #2
    Re: [CSS] weapon id + alias [external]

    That's seriously fucking ugly but gj at doing it.
    lolmaoman: Germans are born with a lifetime x22 login engraved into their birth certificates. True story.
    I DONT HAVE TEAMVIEWER AND IM NOT GOING TO GIVE ANY 24/7 ONLINE SUPPORT VIA STEAM, XFIRE OR OTHER IM PROGRAMS SO DONT BOTHER ASKING. THANKS.

    Comment


      #3
      Re: [CSS] weapon id + alias [external]

      What the fuck are you doing? Good job over complicating an incredibly simple thing.

      Comment


        #4
        Re: [CSS] weapon id + alias [external]

        so how to do it easier?

        Comment


          #5
          Re: [CSS] weapon id + alias [external]

          Originally posted by copymark View Post
          so how to do it easier?
          Reverse IClientEntity and make use of netvars.

          Don't do the netvars in some half ass convoluted way either.

          Comment


            #6
            Re: [CSS] weapon id + alias [external]

            well actually this is exactly the same what the game does ._.

            Comment


              #7
              Re: [CSS] weapon id + alias [external]

              Originally posted by copymark View Post
              well actually this is exactly the same what the game does ._.
              no it is not

              Comment


                #8
                Re: [CSS] weapon id + alias [external]

                ASK MONEY FOR UR INFOS WAV.

                THERE ARENT MUCH SHARPER RAZORS IN THE BOXORS THEN YUO K
                *Tom: badazz b trollin n hatin , sellin crack , hiding smack and now having to jack cause life gone all whack*
                www.myg0t.com

                Comment


                  #9
                  Re: [CSS] weapon id + alias [external]

                  Originally posted by BaDaZZ View Post
                  ASK MONEY FOR UR INFOS WAV.

                  THERE ARENT MUCH SHARPER RAZORS IN THE BOXORS THEN YUO K
                  rifk

                  i think a fair starting price is oh, 9001 EURO

                  Comment


                    #10
                    Re: [CSS] weapon id + alias [external]

                    better and more readable code

                    PHP Code:
                    dword GetClientEntityFromHandle dword handle )
                    {
                        
                    dword offsetinfo[2];
                        
                        if ( 
                    handle == -)
                            return 
                    0;

                        
                    offset handle ENT_ENTRY_MASK;
                        
                    offset = (offset 0x10) + 0x4;
                        
                        if ( !
                    hl2.readmem hl2.table.g_pEntityListsizeof(dword) * 2infooffset ) )
                            return 
                    0;
                            
                        if ( 
                    info[1] != (handle >> 12) ) // compare serial number
                            
                    return 0;
                        
                        return 
                    info[0];

                    PHP Code:
                                if ( !hl2.readmem<dword> ( pl->dwBase, &hActiveWeapon0xD70 ) )
                                    return 
                    false;

                                
                    pl->weapon GetClientEntityFromHandle hActiveWeapon ); 
                    PHP Code:
                    int GetWeaponID dword vmt )
                    {
                        
                    byte id;

                        
                    dword tmp;
                        
                        if ( 
                    vmt ) {
                            
                    // get the address of this weapon's GetWeaponID vfunc
                            
                    if ( hl2.readmem<dword> ( vmt, &tmp0x594 ) ) {
                                
                    // read second byte for return value (it's always a static integer)
                                
                    if ( hl2.readmem<byte> ( tmp, &id0x1 ) )
                                    return (int)
                    id;
                            }
                        }
                        
                        return 
                    WEAPON_BASE;

                    PHP Code:
                    void WeaponIDToAlias int iWeaponIDcharalias )
                    {
                        
                    dword srcioffsettmp];

                        if ( !
                    alias )
                            return;    
                            
                        
                    strcpy alias"none" );
                            
                        if ( (
                    iWeaponID WEAPON_BASE) || (iWeaponID >= WEAPON_MAX) )
                            return;    
                        
                        
                    // get the weaponid index
                        
                    src hl2.table.s_WeaponAliasInfo 0x4;
                        for ( 
                    0WEAPON_MAXi++ ) {
                            
                    // read the string and ID for this index
                            
                    offset 0x8;
                            if ( !
                    hl2.readmem srcsizeof(dword) * 2tmpoffset ) )
                                return;
                            
                    // compare
                            
                    if ( tmp[0] == iWeaponID )
                                break;
                        }
                            
                        
                    // read the string
                        
                    if ( !hl2.readstr ( (char*)tmp[1], alias ) )
                            
                    strcpy alias"none" );

                    PHP Code:
                    bool IsPlayer dword vmt )
                    {
                        
                    byte ret;

                        
                    dword tmp;

                        if ( 
                    vmt ) {
                            
                    // get address of IsPlayer virtual
                            
                    if ( hl2.readmem<dword> ( vmt, &tmp0x1F8 ) ) {
                                
                    // read return value
                                
                    if ( hl2.readmem<byte> ( tmp, &ret0x1 ) )
                                    return (
                    ret == 1); // if false then it will be xor al, al
                            
                    }
                        }

                        return 
                    false;

                    Last edited by phallus; 09-03-2013, 06:23 PM.

                    Comment

                    Working...
                    X