Advertisement
Guest User

Untitled

a guest
Nov 6th, 2016
1,421
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. bool CBaseEntity::SetupBones(matrix3x4_t *pBoneToWorldOut, int nMaxBones, int boneMask, float currentTime) {
  2. //*(byte*)((uintptr_t)this + 0xA28) &= ~0x0A;
  3. *(int*)((uintptr_t) this + offsets.m_nWritableBones) = 0;
  4. *(int*)((uintptr_t) this + offsets.m_bDidCheckForOcclusion) = reinterpret_cast<int*>(offsets.m_dwOcclusionArray)[1];
  5. reinterpret_cast<void(__fastcall*)(void*)>(offsets.InvalidateBoneCache)(this);
  6.  
  7. __asm
  8. {
  9. mov edi, this
  10. lea ecx, DWORD ptr ds : [edi + 0x4]
  11. mov edx, DWORD ptr ds : [ecx]
  12. push currentTime
  13. push boneMask
  14. push nMaxBones
  15. push pBoneToWorldOut
  16. call DWORD ptr ds : [edx + 0x34]
  17. }
  18.  
  19. //typedef bool(__thiscall* SetupBonesFn)(PVOID, matrix3x4_t*, int, int, float);
  20. //U::GetVFunc<SetupBonesFn>((void*)((uintptr_t)this + 0x4), 34)((void*)((uintptr_t) + 0x4), pBoneToWorldOut, nMaxBones, boneMask, currentTime);
  21. }
  22.  
  23.  
  24. /////
  25.  
  26.  
  27. offsets.m_nWritableBones = U::NetVars->GetOffset(charenc("DT_CSPlayer"), charenc("m_nForceBone")) + 0x20;
  28. offsets.m_dwOcclusionArray = *(uintptr_t*)(U::FindPattern(strenc("client.dll"), strenc("A1 ? ? ? ? 83 EC 30 56 57 8B F9")) + 0x1);
  29. offsets.m_bDidCheckForOcclusion = *(uintptr_t*)(U::FindPattern(strenc("client.dll"), strenc("A1 ? ? ? ? 83 EC 30 56 57 8B F9")) + 0xE);
  30. offsets.InvalidateBoneCache = U::FindPattern(strenc("client.dll"), strenc("80 3D ? ? ? ? 00 74 16 A1"));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement