google-site-verification: googlebaca44933768a824.html [C++][HL2/OB] "Fun" with C++ and bones - Old Royal Hack Forum

Announcement

Collapse
No announcement yet.

[C++][HL2/OB] "Fun" with C++ and bones

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

    [C++][HL2/OB] "Fun" with C++ and bones

    I was reading about C++ since i want to start using real C++ instead of C/C++ mutation that can be seen at most source codes, including mine. I was reading about std::map and messed with it, thought what i could do with it as a hax0r and came up with this. I know it's pretty much overkill but at least it's "original" and i will post more when i use it for more practically like in bone selector for aimbot or something :D

    Now what this code does is get our local bones and adds bone names and indexes for map and outputs them to a text-file. After it's done it will close our stream that outputs data into text-file and clears the map. Obviously we dont want to clear the map if we're going to use these for something later but this was just a quick test :p

    credits:

    - Gaben
    - Tetsuo
    - whoever wrote this: map (C++) - Wikipedia, the free encyclopedia
    Code:
    VOID WINAPI mapBones()
    {
    	std::fstream fstrOut;
    	typedef std::map<PCHAR, INT> boneMap;
    	boneMap bones;
    	while( TRUE )
    	{
    		if( g_pEngineClient->IsInGame() )
    		{
    			C_BasePlayer* LocalEntity = reinterpret_cast<C_BasePlayer*>( g_pClientEntList->GetClientEntity( g_pEngineClient->GetLocalPlayer() ));
    			if( !LocalEntity ){ return; }
    			
    			if( !fstrOut.is_open() || fstrOut.bad() ) { fstrOut.open( "C:\\css_bones.txt", std::ios_base::out | std::ios_base::app ); }
    
    			matrix3x4_t pMatrix[MAX_BONES];
    				
    			const model_t *p_model = reinterpret_cast<const model_t*>( LocalEntity->GetModel() );
    			if( !p_model ){ return; }
    
    			studiohdr_t *p_studiomodel = reinterpret_cast<studiohdr_t*>( g_pModelInfoClient->GetStudiomodel( p_model ));	
    			if( !p_studiomodel ){ return; }	
    
    			if( !LocalEntity->SetupBones( pMatrix, MAX_BONES, BONE_USED_BY_HITBOX, GetTickCount() ))
    				return;
    
    			mstudiobone_t *p_bone = NULL;
    			
    			for( size_t bone_index = 0; bone_index < p_studiomodel->numbones; ++bone_index )
    			{
    				p_bone = (mstudiobone_t *)((PBYTE)p_studiomodel + p_studiomodel->boneindex);
    				if( !p_bone ){ continue; }
    				
    				bones.insert( std::pair<PCHAR,INT>( p_bone[bone_index].pszName(), bone_index ));
    			}
    
    			boneMap::const_iterator iter;
    			boneMap::const_iterator end  = bones.end();
    
    			for ( iter = bones.begin(); iter != end; ++iter )
    			{
    				fstrOut << "bone name: " << iter->first << std::endl;
    				fstrOut << "bone index: " << iter->second << std::endl;
    			}
    			
    			fstrOut.close();
    			bones.clear();
    
    			return;
    		}
    	}
    }
    Didnt bother commenting it at all but should be pretty simple if you read a little bit about subject. You could easily do same for hitboxes or use it for networked vars ( Xeno123 did his offset manager with std::map if i remember correct )

    Output:
    Code:
    bone name: ValveBiped.Bip01_Pelvis
    bone index: 0
    bone name: ValveBiped.Bip01_L_Thigh
    bone index: 1
    bone name: ValveBiped.Bip01_L_Calf
    bone index: 2
    bone name: ValveBiped.Bip01_L_Foot
    bone index: 3
    bone name: ValveBiped.Bip01_L_Toe0
    bone index: 4
    bone name: ValveBiped.Bip01_R_Thigh
    bone index: 5
    bone name: ValveBiped.Bip01_R_Calf
    bone index: 6
    bone name: ValveBiped.Bip01_R_Foot
    bone index: 7
    bone name: ValveBiped.Bip01_R_Toe0
    bone index: 8
    bone name: ValveBiped.Bip01_Spine
    bone index: 9
    bone name: ValveBiped.Bip01_Spine1
    bone index: 10
    bone name: ValveBiped.Bip01_Spine2
    bone index: 11
    bone name: ValveBiped.Bip01_Spine4
    bone index: 12
    bone name: ValveBiped.Bip01_Neck1
    bone index: 13
    bone name: ValveBiped.Bip01_Head1
    bone index: 14
    bone name: ValveBiped.Bip01_L_Clavicle
    bone index: 15
    bone name: ValveBiped.Bip01_L_UpperArm
    bone index: 16
    bone name: ValveBiped.Bip01_L_Forearm
    bone index: 17
    bone name: ValveBiped.Bip01_L_Hand
    bone index: 18
    bone name: ValveBiped.Bip01_L_Finger2
    bone index: 19
    bone name: ValveBiped.Bip01_L_Finger21
    bone index: 20
    bone name: ValveBiped.Bip01_L_Finger22
    bone index: 21
    bone name: ValveBiped.Bip01_L_Finger1
    bone index: 22
    bone name: ValveBiped.Bip01_L_Finger11
    bone index: 23
    bone name: ValveBiped.Bip01_L_Finger12
    bone index: 24
    bone name: ValveBiped.Bip01_L_Finger0
    bone index: 25
    bone name: ValveBiped.Bip01_L_Finger01
    bone index: 26
    bone name: ValveBiped.Bip01_L_Finger02
    bone index: 27
    bone name: ValveBiped.Bip01_R_Clavicle
    bone index: 28
    bone name: ValveBiped.Bip01_R_UpperArm
    bone index: 29
    bone name: ValveBiped.Bip01_R_Forearm
    bone index: 30
    bone name: ValveBiped.Bip01_R_Hand
    bone index: 31
    bone name: ValveBiped.Bip01_R_Finger2
    bone index: 32
    bone name: ValveBiped.Bip01_R_Finger21
    bone index: 33
    bone name: ValveBiped.Bip01_R_Finger22
    bone index: 34
    bone name: ValveBiped.Bip01_R_Finger1
    bone index: 35
    bone name: ValveBiped.Bip01_R_Finger11
    bone index: 36
    bone name: ValveBiped.Bip01_R_Finger12
    bone index: 37
    bone name: ValveBiped.Bip01_R_Finger0
    bone index: 38
    bone name: ValveBiped.Bip01_R_Finger01
    bone index: 39
    bone name: ValveBiped.Bip01_R_Finger02
    bone index: 40
    bone name: ValveBiped.Bip01_R_Wrist
    bone index: 41
    bone name: ValveBiped.Bip01_L_Wrist
    bone index: 42
    bone name: ValveBiped.Bip01_L_Ulna
    bone index: 43
    bone name: ValveBiped.Bip01_R_Ulna
    bone index: 44
    bone name: ValveBiped.weapon_bone
    bone index: 45
    bone name: ValveBiped.weapon_bone_RHand
    bone index: 46
    bone name: ValveBiped.weapon_bone_LHand
    bone index: 47
    bone name: ValveBiped.weapon_bone_Clip
    bone index: 48
    bone name: ValveBiped.forward
    bone index: 49
    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.

    #2
    Re: [C++][HL2/OB] &quot;Fun&quot; with C++ and bones

    Gj men,
    I can't get it to work, but i heart you offer some support in teamviewer?
    I also got Steam,Xfire and IM so It shouldnt be a problem.

    i search a good source code for Dods with aimbot and other stuff i know this is the same engine as counter strike source but css hacks are not work in dods.

    Comment


      #3
      Re: [C++][HL2/OB] &quot;Fun&quot; with C++ and bones

      Originally posted by floxy View Post
      Gj men,
      I can't get it to work, but i heart you offer some support in teamviewer?
      I also got Steam,Xfire and IM so It shouldnt be a problem.
      Floxy you've become one impossible troll. :D

      leave your application for meng0t today!
      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


        #4
        Re: [C++][HL2/OB] &quot;Fun&quot; with C++ and bones

        thx mister :)
        btw you know the band norther?
        I hat'em so much

        i search a good source code for Dods with aimbot and other stuff i know this is the same engine as counter strike source but css hacks are not work in dods.

        Comment


          #5
          Re: [C++][HL2/OB] &quot;Fun&quot; with C++ and bones

          Originally posted by floxy View Post
          thx mister :)
          btw you know the band norther?
          I hat'em so much
          Allah will punish jews who try to troll prophet.
          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

          Working...
          X