Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Matrix4x4
- {
- public:
- D3DXVECTOR3 ConverMathtoVector3(int BoneIndex)
- {
- static float cx=0;
- static float cy=0;
- static float cz=0;
- int v6;
- v6 =BoneIndex;
- v6<<=6;
- ReadProcessMemory (GetCurrentProcess (), (LPVOID)(this+v6+0x30), &cx, sizeof(cx), 0);
- ReadProcessMemory (GetCurrentProcess (), (LPVOID)(this+v6+0x34), &cy, sizeof(cy), 0);
- ReadProcessMemory (GetCurrentProcess (), (LPVOID)(this+v6+0x38), &cz, sizeof(cz), 0);
- return D3DXVECTOR3(cx, cy, cz);
- }
- D3DXMATRIX Getmath(int idx)
- {
- D3DXMATRIX Bones;
- ReadProcessMemory (GetCurrentProcess (), (LPVOID)(this+idx*64), &Bones, sizeof(Bones), 0);
- return Bones;
- }
- }; //Size: 0x039C
- class i3MatrixArray
- {
- public:
- char pad_0000[12]; //0x0000
- Matrix4x4* MathArray; //0x000C
- char pad_0010[52]; //0x0010
- D3DXVECTOR3 getBonePosition(int BoneIndex)
- {
- D3DXMATRIX *pBone = (D3DXMATRIX*)(*((DWORD *)this + 0xC));
- return D3DXVECTOR3(pBone[ BoneIndex ]._41, pBone[ BoneIndex ]._42, pBone[ BoneIndex ]._43);
- }
- D3DXMATRIX * getMatrixBone4x4()
- {
- D3DXMATRIX *pBone = (D3DXMATRIX*)(*((DWORD *)this + 0xC));
- return pBone;
- }
- D3DXMATRIX testgetmath(int idx)
- {
- D3DXMATRIX res;
- DWORD addmath = 0;
- addmath = (*((DWORD *)this + 0xC));
- if(addmath)
- {
- ReadProcessMemory (GetCurrentProcess (), (LPVOID)(addmath+idx*64), &res, sizeof(res), 0);
- return res;
- }
- return res;
- }
- }; //Size: 0x0044
- class nama
- {
- public:
- __int32 unk; //0x0000
- __int32 SizeName; //0x0004
- char Namanya[6]; //0x0008
- char pad_000E[56]; //0x000E
- }; //Size: 0x0046
- class i3Bone
- {
- public:
- nama* nama; //0x0000
- char pad_0004[12]; //0x0004
- D3DXMATRIX Pos; //0x0010
- char pad_0050[2]; //0x0050
- __int8 idx; //0x0052
- };
- class toi3bone
- {
- public:
- i3Bone* geti3Bone(int index)
- {
- return (i3Bone*)(((DWORD)this+0x0)+(index * 0x60));
- }
- };
- class i3BoneMatrixListAttr
- {
- public:
- char pad_0000[16]; //0x0000
- toi3bone* ptoi3bone; //0x0010
- __int32 m_Count; //0x0014
- i3MatrixArray* ai3MatrixArray; //0x0018
- i3MatrixArray* ai3MatrixArray2; //0x001C
- char pad_0020[36]; //0x0020
- i3MatrixArray* Geti3MatrixArray1(void)
- {
- return (i3MatrixArray*)*(DWORD*)(this + 0x18);
- }
- i3MatrixArray* Geti3MatrixArray2(void)
- {
- return (i3MatrixArray*)*(DWORD*)(this + 0x1C);
- }
- toi3bone * Gettoi3Bone(void)
- {
- return (toi3bone*)*(DWORD*)(this + 0x10);
- }
- }; //Size: 0x0044
- class StrBone
- {
- public:
- char lpStrName[15]; //0x0000
- char pad_000F[64]; //0x000F
- }; //Size: 0x004F
- class BoneName
- {
- public:
- StrBone* StrBone; //0x0000
- __int32 SizeBoneName; //0x0004
- char pad_0008[4]; //0x0008
- __int32 BoneIndex; //0x000C
- char pad_0010[308]; //0x0010
- }; //Size: 0x0144
- class CBoneName
- {
- public:
- BoneName* getBoneNamebyidx(int index)
- {
- return (BoneName*)(((DWORD)this + 0x0)+(index * 0x10));
- }
- };
- class i3Skeleton
- {
- public:
- char pad_0000[16]; //0x0000
- i3BoneMatrixListAttr* i3BoneMatrixListAttr; //0x0010
- char pad_0014[8]; //0x0014
- CBoneName* CBoneName; //0x001C
- char pad_0020[288]; //0x0020
- }; //Size: 0x0140
- class i3LOD
- {
- public:
- char pad_0000[12]; //0x0000
- i3Skeleton* i3Skeleton; //0x000C
- char pad_0010[48]; //0x0010
- }; //Size: 0x0040
- class i3AnimationContext
- {
- public:
- char pad_0000[12]; //0x0000
- i3MatrixArray* pi3MatrixArray; //0x000C
- i3Skeleton * getFrameSkeleton; //0x0010 //sama i3LOD skeleton
- char pad_0014[4]; //0x0014
- class getCombiner* CgetCombiner; //0x0018
- char pad_001C[28]; //0x001C
- i3MatrixArray* Geti3MatrixArray(void)
- {
- return (i3MatrixArray*)*(DWORD*)(this + 0xC);
- }
- }; //Size: 0x0038
- class i3Body
- {
- public:
- //char pad_0000[104]; //0x0000
- //i3LOD* i3LOD; //0x0068
- //i3AnimationContext* i3AnimationContext; //0x006C
- //char pad_0070[20]; //0x0070
- char pad_0000[108]; //0x0000
- i3LOD* i3LOD; //0x006C
- i3AnimationContext* i3AnimationContext; //0x0070
- char pad_0074[208]; //0x0074
- }; //Size: 0x0084
- class i3SceneObject
- {
- public:
- //char pad_0000[96]; //0x0000
- //D3DXMATRIX pos; //0x0060
- //char pad_00A0[28]; //0x00A0
- //class i3Body* i3Body; //0x00BC
- //char pad_00C0[128]; //0x00C0
- char pad_0000[56]; //0x0000
- i3Body* i3Body; //0x0038
- char pad_003C[248]; //0x003C
- }; //Size: 0x0104
- class CharaViewMgr
- {
- public:
- char pad_0000[4]; //0x0000
- class UICharaView* UICharaView; //0x0004
- char pad_0008[36]; //0x0008
- class UIFloatCharacterView_V10* UIFloatCharacterView_V10; //0x002C
- i3SceneObject* i3SceneObject; //0x0030
- char pad_0034[256]; //0x0034
- static CharaViewMgr * pCharaViewMgr()
- {
- return (CharaViewMgr*)(*(DWORD*)(i3Tools->GetValueByKey("CCharaViewMgr")));
- }
- }; //Size: 0x0134
- static bool isSameStr(string str1, string str2)
- {
- if (strstr(str1.c_str(), str2.c_str()))
- {
- return true;
- }
- return false;
- }
- bool GetVECTORBoneTest01(i3SceneObject * pi3SceneObject,int idx,D3DXVECTOR3 &Out)
- {
- if(pi3SceneObject)
- {
- i3Body * pi3Body = pi3SceneObject->i3Body;
- if(pi3Body)
- {
- i3LOD * pi3LOD = pi3Body->i3LOD;
- i3AnimationContext * pi3AnimationContext = pi3Body->i3AnimationContext;
- if(pi3AnimationContext&&pi3LOD)
- {
- i3Skeleton * pi3Skeleton = pi3LOD->i3Skeleton;
- if(pi3Skeleton)
- {
- i3BoneMatrixListAttr * pi3BoneMatrixListAttr = pi3Skeleton->i3BoneMatrixListAttr;
- if(pi3BoneMatrixListAttr)
- {
- }
- }
- }return false;
- }return false;
- }return false;
- }
- bool GetVectorBoneByName(i3SceneObject * pi3SceneObject,string BoneNam,D3DXVECTOR3 &Out)
- {
- D3DXMATRIX Mathhanim;
- if(pi3SceneObject)
- {
- i3Body * pi3Body = pi3SceneObject->i3Body;
- if(pi3Body)
- {
- i3LOD * pi3LOD = pi3Body->i3LOD;
- i3AnimationContext * pi3AnimationContext = pi3Body->i3AnimationContext;
- if(pi3LOD&&pi3AnimationContext)
- {
- i3Skeleton * pi3Skeleton = pi3LOD->i3Skeleton;
- if(pi3Skeleton)
- {
- i3BoneMatrixListAttr * pi3BoneMatrixListAttr = pi3Skeleton->i3BoneMatrixListAttr;
- CBoneName * pCBoneName = pi3Skeleton->CBoneName;
- if(pCBoneName&&pi3BoneMatrixListAttr)
- {
- int i=0;
- do{
- BoneName * pBoneName = pCBoneName->getBoneNamebyidx(i);
- if(pBoneName&&pBoneName->StrBone)
- {
- string NameBone(pBoneName->StrBone->lpStrName);
- if(isSameStr(NameBone,BoneNam))
- {
- i3MatrixArray * pi3MatrixArrayanim = pi3AnimationContext->pi3MatrixArray;
- if(pi3MatrixArrayanim)
- {
- Matrix4x4 * pMatrix4x4anim = pi3MatrixArrayanim->MathArray;
- if(pMatrix4x4anim)
- {
- Mathhanim = pMatrix4x4anim->Getmath(pBoneName->BoneIndex);
- if(!D3DXMatrixIsIdentity(&Mathhanim))
- {
- Out = D3DXVECTOR3(Mathhanim._41, Mathhanim._42, Mathhanim._43);
- return true;
- }
- }
- }
- }
- }
- i++;
- }while(i<=pi3BoneMatrixListAttr->m_Count);
- }return false;
- }return false;
- }return false;
- }return false;
- }return false;
- }
- void DrawBoneNew(i3SceneObject * pi3SceneObject,i3RenderContext * Render,string start,string end,LPDIRECT3DDEVICE9 pDevice)
- {
- D3DXVECTOR3 OnWorldA,OnScreenA;
- D3DXVECTOR3 OnWorldB,OnScreenB;
- if(GetVectorBoneByName(pi3SceneObject,start,OnWorldA)
- && Render->W2S(OnWorldA,OnScreenA,pDevice)
- && GetVectorBoneByName(pi3SceneObject,end,OnWorldB)
- && Render->W2S(OnWorldB,OnScreenB,pDevice))
- {
- DrawLines(pDevice,OnScreenA.x,OnScreenA.y,OnScreenB.x,OnScreenB.y,1,WHITE);
- }
- }
- void PrintEspBone(i3SceneObject * pi3SceneObject,i3RenderContext * Render,LPDIRECT3DDEVICE9 pDevice)
- {
- DrawBoneNew(pi3SceneObject,Render,"Head","Neck",pDevice);
- DrawBoneNew(pi3SceneObject,Render,"Neck","L Clavicle",pDevice);
- DrawBoneNew(pi3SceneObject,Render,"L Clavicle","L UpperArm",pDevice);
- DrawBoneNew(pi3SceneObject,Render,"L UpperArm","L Forearm",pDevice);
- DrawBoneNew(pi3SceneObject,Render,"L Forearm","L Hand",pDevice);
- DrawBoneNew(pi3SceneObject,Render,"Neck","R Clavicle",pDevice);
- DrawBoneNew(pi3SceneObject,Render,"R Clavicle","R UpperArm",pDevice);
- DrawBoneNew(pi3SceneObject,Render,"R UpperArm","R Forearm",pDevice);
- DrawBoneNew(pi3SceneObject,Render,"R Forearm","R Hand",pDevice);
- DrawBoneNew(pi3SceneObject,Render,"Neck","Spine3",pDevice);
- DrawBoneNew(pi3SceneObject,Render,"Spine3","Spine2",pDevice);
- DrawBoneNew(pi3SceneObject,Render,"Spine3","IK",pDevice);
- DrawBoneNew(pi3SceneObject,Render,"IK","L Thigh",pDevice);
- DrawBoneNew(pi3SceneObject,Render,"L Thigh","L Calf",pDevice);
- DrawBoneNew(pi3SceneObject,Render,"L Calf","L Foot",pDevice);
- DrawBoneNew(pi3SceneObject,Render,"L Foot","L Toe",pDevice);
- DrawBoneNew(pi3SceneObject,Render,"IK","R Thigh",pDevice);
- DrawBoneNew(pi3SceneObject,Render,"R Thigh","R Calf",pDevice);
- DrawBoneNew(pi3SceneObject,Render,"R Calf","R Foot",pDevice);
- DrawBoneNew(pi3SceneObject,Render,"R Foot","R Toe",pDevice);
- }
- void __EspBoneNewMethod(int i,LPDIRECT3DDEVICE9 pDevice)
- {
- unsigned long Avatar = NULL;
- i3RenderContext * Render = i3Viewer::pi3Viewer()->GetRenderContext();
- Avatar = __GetAvatarAddress(i);
- if(Avatar&&*(PDWORD)((DWORD)(Avatar+0x50))!=0)
- {
- i3SceneObject * pi3SceneObject =(i3SceneObject*)(*(PDWORD)((DWORD)(Avatar+0x50)));
- if(pi3SceneObject)
- {
- PrintEspBone(pi3SceneObject,Render,pDevice);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment