Added get bone position by hitbox

memflow_0.1.5
MisterY52 2 years ago
parent 76560b875c
commit ca5a77f990

@ -125,6 +125,42 @@ Vector Entity::getBonePosition(int id)
return bone;
}
//https://www.unknowncheats.me/forum/apex-legends/496984-getting-hitbox-positions-cstudiohdr-externally.html
//https://www.unknowncheats.me/forum/3499185-post1334.html
Vector Entity::getBonePositionByHitbox(int id)
{
Vector origin = getPosition();
//BoneByHitBox
uint64_t Model = *(uint64_t*)(buffer + OFFSET_STUDIOHDR);
//get studio hdr
uint64_t StudioHdr;
apex_mem.Read<uint64_t>(Model + 0x8, StudioHdr);
//get hitbox array
int HitBoxsArray_set;
apex_mem.Read<int>(StudioHdr + 0xB4,HitBoxsArray_set);
uint64_t HitBoxsArray = StudioHdr + HitBoxsArray_set;
int HitboxIndex;
apex_mem.Read<int>(HitBoxsArray + 0x8, HitboxIndex);
int Bone;
apex_mem.Read<int>(HitBoxsArray + HitboxIndex + (id * 0x2C), Bone);
if(Bone < 0 || Bone > 255)
return Vector();
//hitpos
uint64_t BoneArray = *(uint64_t*)(buffer + OFFSET_BONES);
matrix3x4_t Matrix = {};
apex_mem.Read<matrix3x4_t>(BoneArray + Bone * sizeof(matrix3x4_t), Matrix);
return Vector(Matrix.m_flMatVal[0][3] + origin.x, Matrix.m_flMatVal[1][3] + origin.y, Matrix.m_flMatVal[2][3] + origin.z);
}
QAngle Entity::GetSwayAngles()
{
return *(QAngle*)(buffer + OFFSET_BREATH_ANGLES);
@ -264,7 +300,7 @@ QAngle CalculateBestBoneAim(Entity& from, uintptr_t t, float max_fov)
}
Vector LocalCamera = from.GetCamPos();
Vector TargetBonePosition = target.getBonePosition(bone);
Vector TargetBonePosition = target.getBonePositionByHitbox(bone);
QAngle CalculatedAngles = QAngle(0, 0, 0);
WeaponXEntity curweap = WeaponXEntity();

@ -44,6 +44,7 @@ public:
void SetViewAngles(SVector angles);
void SetViewAngles(QAngle& angles);
Vector getBonePosition(int id);
Vector getBonePositionByHitbox(int id);
bool Observing(uint64_t entitylist);
void get_name(uint64_t g_Base, uint64_t index, char* name);
};

@ -387,7 +387,7 @@ static void EspLoop()
if (bs.x > 0 && bs.y > 0)
{
Vector hs = Vector();
Vector HeadPosition = Target.getBonePosition(8);
Vector HeadPosition = Target.getBonePositionByHitbox(0);
WorldToScreen(HeadPosition, m.matrix, 1920, 1080, hs);
float height = abs(abs(hs.y) - abs(bs.y));
float width = height / 2.0f;
@ -462,7 +462,7 @@ static void EspLoop()
if (bs.x > 0 && bs.y > 0)
{
Vector hs = Vector();
Vector HeadPosition = Target.getBonePosition(8);
Vector HeadPosition = Target.getBonePositionByHitbox(0);
WorldToScreen(HeadPosition, m.matrix, 1920, 1080, hs);
float height = abs(abs(hs.y) - abs(bs.y));
float width = height / 2.0f;

@ -27,6 +27,7 @@
#define OFFSET_ORIGIN 0x014c //m_vecAbsOrigin
#define OFFSET_BONES 0x0e88 + 0x48 //m_nForceBone + 0x48
#define OFFSET_STUDIOHDR 0x10d8
#define OFFSET_AIMPUNCH 0x23f8 //m_currentFrameLocalPlayer.m_vecPunchWeapon_Angle
#define OFFSET_CAMERAPOS 0x1ea0 //CPlayer!camera_origin
#define OFFSET_VIEWANGLES 0x24f4 - 0x14 //m_ammoPoolCapacity - 0x14
@ -74,6 +75,7 @@
#define OFFSET_ORIGIN 0x014c //m_vecAbsOrigin
#define OFFSET_BONES 0x0e88 + 0x48 //m_nForceBone + 0x48
#define OFFSET_STUDIOHDR 0x10d8
#define OFFSET_AIMPUNCH 0x23f8 //m_currentFrameLocalPlayer.m_vecPunchWeapon_Angle
#define OFFSET_CAMERAPOS 0x1ea0 //CPlayer!camera_origin
#define OFFSET_VIEWANGLES 0x24f4 - 0x14 //m_ammoPoolCapacity - 0x14

Loading…
Cancel
Save