ESP Problems

Posts 1–8 of 8 · Page 1 of 1
ESP Problems
Hey, I'm having some weird issues with my ESP. I have no idea what it can be so I'll share a video and some code.


EDIT: It was my CBaseEntity::Position function that was wrong (works for aimbot tho).

Can someone tell me what's wrong with it?

Code:
Vector3 CBaseEntity::Position(int Bone)
{
	if (this->ReadBoneMatrix())
	{
		Vector3 Pos;
		Pos.Init();
		Pos.x = *(float*)((DWORD)this->BoneMatrix + 0x30 * Bone + 0x0C);
		Pos.z = *(float*)((DWORD)this->BoneMatrix + 0x30 * Bone + 0x1C);
		Pos.y = *(float*)((DWORD)this->BoneMatrix + 0x30 * Bone + 0x2C);
		return Pos;
	}
}
Code:
DWORD CBaseEntity::ReadBoneMatrix()
{
	this->BoneMatrix = *(DWORD*)((DWORD)this->Base + Offsets::m_dwBoneMatrix);
	return this->BoneMatrix;
}
It may be your world to screen I haven't looked into the code you posted that much but try DebugOverlay->screenpoint
Quote Originally Posted by WildAssassinz View Post
It may be your world to screen I haven't looked into the code you posted that much but try DebugOverlay->screenpoint
Gonna check that, you know what the current index is?

Tried it, I still have the same problem. Do you think the CEntity::Position() is wrong? It works for the aimbot so it'd probably not be it but maybe?

Code:
Vector3 CBaseEntity::Position(int Bone)
{
	if (this->ReadBoneMatrix())
	{
		Vector3 Pos;
		Pos.Init();
		Pos.x = *(float*)((DWORD)this->BoneMatrix + 0x30 * Bone + 0x0C);
		Pos.z = *(float*)((DWORD)this->BoneMatrix + 0x30 * Bone + 0x1C);
		Pos.y = *(float*)((DWORD)this->BoneMatrix + 0x30 * Bone + 0x2C);
		return Pos;
	}
}
Code:
DWORD CBaseEntity::ReadBoneMatrix()
{
	this->BoneMatrix = *(DWORD*)((DWORD)this->Base + Offsets::m_dwBoneMatrix);
	return this->BoneMatrix;
}
its your w2s. also, stop reading memory like you would in externals, its dumb and you won't get anywhere with that.

some paste for setupbones, you should use that.

Code:
Vector CBaseEntity::GetBonePosition( int iBone )
{
	matrix3x4_t boneMatrixes[128];
	if ( this->SetupBones( boneMatrixes, 128, 0x100, 0 ) )
	{
		matrix3x4_t boneMatrix = boneMatrixes[iBone];
		return Vector( boneMatrix.m_flMatVal[0][3], boneMatrix.m_flMatVal[1][3], boneMatrix.m_flMatVal[2][3] );
	}
	else return Vector( 0, 0, 0 );
}

bool CBaseEntity::SetupBones( matrix3x4_t *pBoneToWorldOut, int nMaxBones, int boneMask, float currentTime )
{
	__asm
	{
		mov edi, this
		lea ecx, dword ptr ds : [edi + 0x4]
		mov edx, dword ptr ds : [ecx]
		push currentTime
		push boneMask
		push nMaxBones
		push pBoneToWorldOut
		call dword ptr ds : [edx + 0x34]
	}
}
Quote Originally Posted by certmemer View Post
its your w2s. also, stop reading memory like you would in externals, its dumb and you won't get anywhere with that.

some paste for setupbones, you should use that.

Code:
Vector CBaseEntity::GetBonePosition( int iBone )
{
	matrix3x4_t boneMatrixes[128];
	if ( this->SetupBones( boneMatrixes, 128, 0x100, 0 ) )
	{
		matrix3x4_t boneMatrix = boneMatrixes[iBone];
		return Vector( boneMatrix.m_flMatVal[0][3], boneMatrix.m_flMatVal[1][3], boneMatrix.m_flMatVal[2][3] );
	}
	else return Vector( 0, 0, 0 );
}

bool CBaseEntity::SetupBones( matrix3x4_t *pBoneToWorldOut, int nMaxBones, int boneMask, float currentTime )
{
	__asm
	{
		mov edi, this
		lea ecx, dword ptr ds : [edi + 0x4]
		mov edx, dword ptr ds : [ecx]
		push currentTime
		push boneMask
		push nMaxBones
		push pBoneToWorldOut
		call dword ptr ds : [edx + 0x34]
	}
}
Yeah, started on this cheat last summer when I just learned some C++. Haven't had time to change anything so I just had it like that.


Thanks, I'll try it. And no, it's not the W2S as it works when I take the position with Entity + vecOrigin.
you may want to show us how you draw your esp info, maybe your logic is wrong.
Quote Originally Posted by certmemer View Post
you may want to show us how you draw your esp info, maybe your logic is wrong.
Nah, everything's working now except my way of getting the position of an enemy with the bonematrix, your way crashed my game but I'll test it and see if I can get it working. If I use the vecOrigin offset then my ESP is fine.

So basically, my problem is "kinda solved" but now I want to know why my CBaseEntity::Position isn't working or if I can get a working function.

- - - Updated - - -

Got it working, close this. @T-800 @Royce, @DarknzNet
Thread closed.

Reason: Solved.
Posts 1–8 of 8 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us