Solved Entity Head Bone Position

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

PwndDepot

I has a status
Dank Tier VIP
Trump Tier Donator
Dank Tier Donator
Nov 5, 2014
239
7,748
19
So i'm trying to wrap up my ESP for csgo, but i'm having trouble getting my ESP aligned. I have the enemy coords and am able to draw to it, but the coordinates are located at the bottom of the entity. So im trying to find the bone position and use that has the length to draw the ESP for each entity. However i'm having a lot of trouble with the head position. as far as I know, there's a formula for finding bone coords in csgo. i think 6 is the boneid for the head (current version). Idk if i need to run these coords through W2S (id imagine so) but either way it will draw to the middle of the map instead of the entities.

This is in a loop that draws on each entity:
C++:
			DWORD dwBoneMatrix = (*(DWORD*)(m_dwEntityList + (i * 0x10))) + cBoneMatrix;
			float enemyHeadX = *(float*)(dwBoneMatrix + 0x30 * 6 + 0x0C);
			float enemyHeadY = *(float*)(dwBoneMatrix + 0x30 * 6 + 0x1C);
			float enemyHeadZ = *(float*)(dwBoneMatrix + 0x30 * 6 + 0x2C);

			vec3_t enemyHeadPos = { enemyHeadX, enemyHeadY, enemyHeadZ };
			vec2 enemyHeadScreenCoords = { 0 , 0 };

			ESP::WorldToScreen(enemyHeadPos, enemyHeadScreenCoords, ViewMatrix, width, height);
			//DrawBorderBox(screenCoords.x, screenCoords.y, 50, 50, 4, GREEN(255), pDevice);
			//DrawBorderBox(enemyHeadX, enemyHeadY, 50, 50, 4, BLUE(255), pDevice);
			Rect(pDevice, enemyHeadScreenCoords.x, enemyHeadScreenCoords.y, 50, 50, BLUE(255));
			//Rect(pDevice, enemyHeadX, enemyHeadY, 50, 50, YELLOW(255));
			Rect(pDevice, enemyScreenCoords.x, enemyScreenCoords.y, 50, 50, GREEN(255));
im just drawing big boxes to make sure i have the right coordinates lol

and my offsets:
C++:
MODULEINFO clientInfo = GetModuleInfo("client.dll");
MODULEINFO engineInfo = GetModuleInfo("engine.dll");
MODULEINFO serverInfo = GetModuleInfo("server.dll");
MODULEINFO matsInfo = GetModuleInfo("materialsystem.dll");
DWORD clientDll = (DWORD)clientInfo.lpBaseOfDll;
DWORD engineDll = (DWORD)engineInfo.lpBaseOfDll;
DWORD serverDll = (DWORD)serverInfo.lpBaseOfDll;
DWORD matsDll = (DWORD)matsInfo.lpBaseOfDll;

// Addresses
DWORD  dwLocalPlayer = clientDll + 0x00AAD704; // client.dll +
DWORD  dwPlayerCount = serverDll + 0x9EB090; // client.dll +
DWORD  m_dwEntityList = clientDll + 0x04AD0884;
DWORD m_dwViewMatrix = clientDll + 0x04AC2424;
// Offsets.
DWORD cBoneMatrix = 0x2698;

class PlayerEnt;

class PlayerEnt
{
public:
	char pad_0x0000[0xF0]; //0x0000
	__int32 m_iTeamNum; //0x00F0 
	char pad_0x00F4[0x8]; //0x00F4
	__int32 m_iHealth; //0x00FC 
	char pad_0x0100[0x34]; //0x0100
	vec3_t vPos; //0x0134 
	char pad_0x0140[0x11B]; //0x0140
	__int32 m_iLifeState; //0x025B 
	char pad_0x025F[0x25D]; //0x025F

}; //Size=0x04BC
I have a feeling i'm dereferencing wrong or something, because the enemy head position is way wrong and always the same and it should be different per entity.
Anyways any help would be greatly appreciated <3

p.s. yes I know im drawing giant boxes but it's just a test to see where they all are lol
 

PwndDepot

I has a status
Dank Tier VIP
Trump Tier Donator
Dank Tier Donator
Nov 5, 2014
239
7,748
19
got it working with this code:
C++:
			DWORD dwEntity = *(DWORD*)((m_dwEntityList + (i * 0x10)));
			DWORD dwBoneMatrix = *(DWORD*)(dwEntity + cBoneMatrix);
			float enemyHeadX = *(float*)(dwBoneMatrix + 0x30 * 8 + 0x0C);
			float enemyHeadY = *(float*)(dwBoneMatrix + 0x30 * 8 + 0x1C);
			float enemyHeadZ = *(float*)(dwBoneMatrix + 0x30 * 8 + 0x2C);

			vec3_t enemyHeadPos = { enemyHeadX, enemyHeadY, enemyHeadZ };
			vec2 enemyHeadScreenCoords = { 0 , 0 };

			ESP::WorldToScreen(enemyHeadPos, enemyHeadScreenCoords, ViewMatrix, width, height);
			Rect(pDevice, enemyHeadScreenCoords.x, enemyHeadScreenCoords.y, 10, 10, BLUE(255));
I think I was using an old bone id too, thanks :D
 

HexMurder

Arcane Hacker
Dank Tier VIP
Dank Tier Donator
Jun 7, 2012
319
7,988
22
this is in my ReadInfo() func in my entity class:
C++:
Base = mem.ReadInt32(CLIENT.dll + Offsets.dwEntityList + id*0x10);
BoneBase = mem.ReadInt32(Base + Offsets.oBoneMatrix); // offset is 0x2698
seperate class
C++:
public class BoneMatrix
    {
        public static Vec3 GetBonePos(int boneBase, int boneID)
        {
            Vec3 bonePos = new Vec3();
            bonePos.x = Engine.mem.ReadFloat((boneBase + 0x30 * boneID + 0x0C));
            bonePos.y = Engine.mem.ReadFloat((boneBase + 0x30 * boneID + 0x1C));
            bonePos.z = Engine.mem.ReadFloat((boneBase + 0x30 * boneID + 0x2C));
            return bonePos;
        }
    }
Head bone is 8.

you would use it as follows:
C++:
Vec3 HeadBone_pos = BoneMatrix.GetBonePos(Engine.enemy[i].BoneBase, 8); // 8 for head bone
 
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods