Welcome, Guest.

Author Topic: Bone ESP (GMOD)  (Read 322 times)

Offline grey10110

  • Level 0
  • Posts: 6
    • View Profile
  • France
Bone ESP (GMOD)
« on: February 24, 2021, 09:03:15 pm »
Hi
Im trying to make a c++ internal bone ESP but when i draw the skeleton it does this:

(for loop iterating through the bone matrix of the localplayer)

I tried drawing bones by their id but it is not a reliable option (custom models)

I need help please.

Online KittoniuM

  • Administrator
  • Level 8 - Tru Packet
  • *
  • Posts: 1216
    • View Profile
  • Canada
Re: Bone ESP (GMOD)
« Reply #1 on: February 26, 2021, 12:03:50 am »
Hi
Im trying to make a c++ internal bone ESP but when i draw the skeleton it does this:

(for loop iterating through the bone matrix of the localplayer)

I tried drawing bones by their id but it is not a reliable option (custom models)

I need help please.

You must GetStudioModel  of the entity's model, and then that has information on cstudiohdr_t , which contains bone information most importantly bone name.

I dont have access to code right now I cannot help

Offline grey10110

  • Level 0
  • Posts: 6
    • View Profile
  • France
Re: Bone ESP (GMOD)
« Reply #2 on: February 26, 2021, 02:32:37 pm »
So i have to use classes from the source SDK?

if yes changing all unused types to void and void* would work?

Online KittoniuM

  • Administrator
  • Level 8 - Tru Packet
  • *
  • Posts: 1216
    • View Profile
  • Canada
Re: Bone ESP (GMOD)
« Reply #3 on: February 27, 2021, 03:12:22 am »
So i have to use classes from the source SDK?

if yes changing all unused types to void and void* would work?

I am unsure, dont use the valve sdk, only for refrence while reversing.
I am calling the function by its virtual Index.

Anyway, here is some of my code for you:

Code: [Select]
DWORD* GetModel() //this inside entity class
{
return GetVirtualFunction<DWORD* (__thiscall*)(void*)>(this + 0x4,
#if defined(PFW_GAME_L4D) || defined(PFW_GAME_CSGO) || defined(PFW_GAME_L4D2)
8
#else
9
#endif
)(this + 0x4);
}

Code: [Select]
class CBone
{
public:
int NameOffset;
int parent;
int bonecontroller[6];
Vector3 pos;
float quat[4];
Vector3 rot;
Vector3 posscale;
Vector3 rotscale;
Matrix3x4 poseToBone;
float qAlignment[4];
int flags;
int proctype;
int procindex;
mutable int physicsbone;
int surfacepropidx;
int contents;
int unused[8];

const char* get_bone_name()
{
return  (char*)this + NameOffset;
}
};

class CStudioHDR
{
public:
int id;
int version;
int checksum;
char name[64];
int length;
Vector3 eyeposition;
Vector3 illumposition;
Vector3 hull_min;
Vector3 hull_max;
Vector3 view_bbmin;
Vector3 view_bbmax;
int flags;
int LastBone;
int BoneOffset;
int numbonecontrollers;
int bonecontrollerindex;
int numhitboxsets;
int hitboxsetindex;
int numlocalanim;
int localanimindex;
int numlocalseq;
int localseqindex;
mutable int activitylistversion;
mutable int eventsindexed;
int numtextures;
int textureindex;
int numcdtextures;
int cdtextureindex;
int numskinref;
int numskinfamilies;
int skinindex;
int numbodyparts;
int bodypartindex;
int numlocalattachments;
int localattachmentindex;
int numlocalnodes;
int localnodeindex;
int localnodenameindex;
int numflexdesc;
int flexdescindex;
int numflexcontrollers;
int flexcontrollerindex;
int numflexrules;
int flexruleindex;
int numikchains;
int ikchainindex;
int nummouths;
int mouthindex;
int numlocalposeparameters;
int localposeparamindex;
int surfacepropindex;
int keyvalueindex;
int keyvaluesize;
int numlocalikautoplaylocks;
int localikautoplaylockindex;
float mass;
int contents;
int numincludemodels;
int includemodelindex;
mutable void* virtualModel;
int szanimblocknameindex;
int numanimblocks;
int animblockindex;
mutable void* animblockModel;
int bonetablebynameindex;
void* pVertexBase;
void* pIndexBase;
BYTE constdirectionallightdot;
BYTE rootLOD;
BYTE numAllowedRootLODs;
BYTE unused[1];
int unused4;
int numflexcontrollerui;
int flexcontrolleruiindex;
float flVertAnimFixedPointScale;
int unused3[1];
int studiohdr2index;
int unused2[1];

CBone* get_bone(int i)
{
return (CBone*)((char*)this + BoneOffset) + i;
}
};
GetStudioModel id for gmod is 28
Code: [Select]

IClientEntity* client_entity = ent->Address;
if (mm_validptr(client_entity) && mm_validptr(ent->Model))
{
static Matrix3x4 s_Bonematrix[256];
if (client_entity->BoneSetup(s_Bonematrix, 256, 0x100, client_entity->SimulationTime()))
{
CStudioHDR* studio_model = interface_engine_model_info_client->GetStudioModel(ent->Model);
if (mm_validptr(studio_model))
{
for (int bone_id = 0; bone_id < studio_model->LastBone; ++bone_id)
{
CBone* bone = studio_model->get_bone(bone_id);
if (!mm_validptr(bone) || !(bone->flags & 256) || bone->parent == -1)
continue;

//const char* bone_name = bone->get_name();
//if (!mm_validptr((void*)bone_name))
// continue;

if (esp_skeleton == 1)
{
const Vector3 child = Vector3(
s_Bonematrix[bone_id][0][3],
s_Bonematrix[bone_id][1][3],
s_Bonematrix[bone_id][2][3]);
const Vector3 parent = Vector3(
s_Bonematrix[bone->parent][0][3],
s_Bonematrix[bone->parent][1][3],
s_Bonematrix[bone->parent][2][3]);

if (child.IsZero() || parent.IsZero())
continue;

Offline grey10110

  • Level 0
  • Posts: 6
    • View Profile
  • France
Re: Bone ESP (GMOD)
« Reply #4 on: March 03, 2021, 04:28:50 pm »
Thx




Total Members


  • Youtube Youtube
  • Facebook Facebook
  • Twitter Twitter
  • Steam Steam

  • Powered by SMF | SMF © 2018, Simple Machines

    2018 BigPackets. All rights reserved. All other trademarks, logos and copyrights are the property of their respective owners. This site is not associated with any company in any way.