Подведи собственные итоги года совместно с YOUGAME и забери ценные призы! Перейти

Исходник Setupbones fixes

  • Автор темы Автор темы train67
  • Дата начала Дата начала
Участник
Участник
Статус
Оффлайн
Регистрация
26 Апр 2018
Сообщения
866
Реакции
181
Я пастер помогите нам - нужно в хуо в хуки запехнуть я правильно думаю)

Код:
Expand Collapse Copy
void C_BasePlayer::SetupBonesFix() {
  static auto r_jiggle_bones = g_CVar->FindVar("r_jiggle_bones");

  auto animstate = GetPlayerAnimState();
  //fixvelocity
  animstate->m_vVelocityX = 0.f;
  animstate->m_vVelocityY = 0.f;
  animstate->speed_2d = 0.001f; // 0.0 will break more than fix so use 0.001 or just hook this field

  auto parent_cvar = r_jiggle_bones->m_pParent;
  if (parent_cvar == r_jiggle_bones)
    parent_cvar = 0;
  else
    parent_cvar = 1;

  // fixing goal feet yaw for better interpolating bones
  animstate->m_flGoalFeetYaw = this->m_flLowerBodyYawTarget() + animstate->m_flMaxBodyYaw;

  C_AnimationOverlay* pOverlay = this->GetAnimOverlay(6);
  //adjust the value to correctly calculate the position of the bones
  pOverlay->m_flWeight = pOverlay->m_flCycle = pOverlay->m_flPlaybackRate = 0.f;
 
  if (pOverlay->m_Sequence > 0)
    pOverlay->m_Sequence += 1; // Fixing sequence delay before setup bones calc

  //skip extrapolating velocity
  m_bHasDefuser() = false;
  this->m_vecVelocity() = this->EstimateAbsVelocity() * animstate->m_flUnknownVelocityLean;
  //trigger lby update
  m_nSequence() = 979;
  animstate->m_flLastBodyUpdate = g_Globals->curtime + 1.32f; // set new body yaw update with delay

  *(int*)(((uintptr_t)this) + 0xA30) = 0;

  auto v5 = *(int*)(((uintptr_t)this) + 0xF0);
  *(int*)(((uintptr_t)this) + 0xF0) |= 8u;
  auto v6 = *(uint8_t*)(((uintptr_t)this) + 0x274);
  *(uint8_t*)(((uintptr_t)this) + 0x274) &= 0xFEu;
  *(int*)(g_GlobalVars + 0x001C) = -1; // fix interpolation
  *(bool*)(((uintptr_t)this) + 0xF3C) = true; // SetupVelocity call for calculation right angles
  // ref: DoExtraBonesProcessing
  (*(_BYTE *)(uintptr_t(this )+ 0xA28)) |= 0xE;
  *(short*)(uintptr_t(this)+ 0x272) = -1


  int result = 1;
  __asm push 0x54f12f43
  this->SetupBones(0, -1, BONE_USED_BY_ANYTHING, g_GlobalVars->curtime);
  __asm pop result
 
  this->m_vecVelocity() = this->EstimateAbsVelocity(); // restore velocity

  *(uint8_t*)(((uintptr_t)this) + 0x274) = v6;
  *(int*)(((uintptr_t)this) + 0xF0) = v5;

  r_jiggle_bones->SetValue(result);
}


bool __fastcall hkSetupBones(void* ecx, void* edx, matrix3x4_t* pBoneToWorldOut, int nMaxBones, int boneMask, float currentTime) {
  auto stack = _AddressOfReturnAddress();
  //prevent game call setupbones
  if (*(int*)((int)stack + 0x14) != 0x54f12f43){
    return false;
  }
  return oSetupBones( ecx, edx, pBoneToWorldOut, nMaxBones, boneMask, std::remainderf(currentTime, 360.0f));
}

credits also: @poiak, @ikfakof,@Soufiw, @esloberic, not flying lama
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Я пастер помогите нам - нужно в хуо в хуки запехнуть я правильно думаю)

Код:
Expand Collapse Copy
void C_BasePlayer::SetupBonesFix() {
  static auto r_jiggle_bones = g_CVar->FindVar("r_jiggle_bones");

  auto animstate = GetPlayerAnimState();
  //fixvelocity
  animstate->m_vVelocityX = 0.f;
  animstate->m_vVelocityY = 0.f;
  animstate->speed_2d = 0.001f; // 0.0 will break more than fix so use 0.001 or just hook this field

  auto parent_cvar = r_jiggle_bones->m_pParent;
  if (parent_cvar == r_jiggle_bones)
    parent_cvar = 0;
  else
    parent_cvar = 1;

  // fixing goal feet yaw for better interpolating bones
  animstate->m_flGoalFeetYaw = this->m_flLowerBodyYawTarget() + animstate->m_flMaxBodyYaw;

  C_AnimationOverlay* pOverlay = this->GetAnimOverlay(6);
  //adjust the value to correctly calculate the position of the bones
  pOverlay->m_flWeight = pOverlay->m_flCycle = pOverlay->m_flPlaybackRate = 0.f;

  if (pOverlay->m_Sequence > 0)
    pOverlay->m_Sequence += 1; // Fixing sequence delay before setup bones calc

  //skip extrapolating velocity
  m_bHasDefuser() = false;
  this->m_vecVelocity() = this->EstimateAbsVelocity() * animstate->m_flUnknownVelocityLean;
  //trigger lby update
  m_nSequence() = 979;
  animstate->m_flLastBodyUpdate = g_Globals->curtime + 1.32f; // set new body yaw update with delay

  *(int*)(((uintptr_t)this) + 0xA30) = 0;

  auto v5 = *(int*)(((uintptr_t)this) + 0xF0);
  *(int*)(((uintptr_t)this) + 0xF0) |= 8u;
  auto v6 = *(uint8_t*)(((uintptr_t)this) + 0x274);
  *(uint8_t*)(((uintptr_t)this) + 0x274) &= 0xFEu;
  *(int*)(g_GlobalVars + 0x001C) = -1; // fix interpolation
  *(bool*)(((uintptr_t)this) + 0xF3C) = true; // SetupVelocity call for calculation right angles
  // ref: DoExtraBonesProcessing
  (*(_BYTE *)(uintptr_t(this )+ 0xA28)) |= 0xE;
  *(short*)(uintptr_t(this)+ 0x272) = -1


  int result = 1;
  __asm push 0x54f12f43
  this->SetupBones(0, -1, BONE_USED_BY_ANYTHING, g_GlobalVars->curtime);
  __asm pop result

  this->m_vecVelocity() = this->EstimateAbsVelocity(); // restore velocity

  *(uint8_t*)(((uintptr_t)this) + 0x274) = v6;
  *(int*)(((uintptr_t)this) + 0xF0) = v5;

  r_jiggle_bones->SetValue(result);
}


bool __fastcall hkSetupBones(void* ecx, void* edx, matrix3x4_t* pBoneToWorldOut, int nMaxBones, int boneMask, float currentTime) {
  auto stack = _AddressOfReturnAddress();
  //prevent game call setupbones
  if (*(int*)((int)stack + 0x14) != 0x54f12f43){
    return false;
  }
  return oSetupBones( ecx, edx, pBoneToWorldOut, nMaxBones, boneMask, std::remainderf(currentTime, 360.0f));
}

credits also: @poiak, @ikfakof,@Soufiw, @esloberic, not flying lama
Это рофл был, этим кодом ты игру крашнешь
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
У меня сейчас во такая фигня если есть лучше этого то дайте пожалуйста


Код:
Expand Collapse Copy
void C_BaseEntity::FixSetupBones(matrix3x4_t *Matrix){ // i took out alot of stuff from here because b1g secrets
static int m_fFlags = g_pNetvars->GetOffset("DT_BasePlayer", "m_fFlags");
static int m_nForceBone = g_pNetvars->GetOffset("DT_BaseAnimating", "m_nForceBone");

if (this == Globals::LocalPlayer)
{
    const auto Backup = *(int*)(uintptr_t(this) + ptrdiff_t(0x272));

    *(int*)(uintptr_t(this) + ptrdiff_t(0x272)) = -1;

    this->SetupBones(Matrix, 126, 0x00000100 | 0x200, g_pGlobalVars->curtime);

    *(int*)(uintptr_t(this) + ptrdiff_t(0x272)) = Backup;
}
else
{
    *reinterpret_cast<int*>(uintptr_t(this) + 0xA30) = g_pGlobalVars->framecount;
    *reinterpret_cast<int*>(uintptr_t(this) + 0xA28) = 0;

    const auto Backup = *(int*)(uintptr_t(this) + ptrdiff_t(0x272));

    *(int*)(uintptr_t(this) + ptrdiff_t(0x272)) = -1;

    this->SetupBones(Matrix, 126, 0x00000100 | 0x200, g_pGlobalVars->curtime);

    *(int*)(uintptr_t(this) + ptrdiff_t(0x272)) = Backup;
}
}
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
У меня сейчас во такая фигня если есть лучше этого то дайте пожалуйста


Код:
Expand Collapse Copy
void C_BaseEntity::FixSetupBones(matrix3x4_t *Matrix){ // i took out alot of stuff from here because b1g secrets
static int m_fFlags = g_pNetvars->GetOffset("DT_BasePlayer", "m_fFlags");
static int m_nForceBone = g_pNetvars->GetOffset("DT_BaseAnimating", "m_nForceBone");

if (this == Globals::LocalPlayer)
{
    const auto Backup = *(int*)(uintptr_t(this) + ptrdiff_t(0x272));

    *(int*)(uintptr_t(this) + ptrdiff_t(0x272)) = -1;

    this->SetupBones(Matrix, 126, 0x00000100 | 0x200, g_pGlobalVars->curtime);

    *(int*)(uintptr_t(this) + ptrdiff_t(0x272)) = Backup;
}
else
{
    *reinterpret_cast<int*>(uintptr_t(this) + 0xA30) = g_pGlobalVars->framecount;
    *reinterpret_cast<int*>(uintptr_t(this) + 0xA28) = 0;

    const auto Backup = *(int*)(uintptr_t(this) + ptrdiff_t(0x272));

    *(int*)(uintptr_t(this) + ptrdiff_t(0x272)) = -1;

    this->SetupBones(Matrix, 126, 0x00000100 | 0x200, g_pGlobalVars->curtime);

    *(int*)(uintptr_t(this) + ptrdiff_t(0x272)) = Backup;
}
}
Это голый анимфикс, тут всё нужное вырезано.
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Я пастер помогите нам - нужно в хуо в хуки запехнуть я правильно думаю)

Код:
Expand Collapse Copy
void C_BasePlayer::SetupBonesFix() {
  static auto r_jiggle_bones = g_CVar->FindVar("r_jiggle_bones");

  auto animstate = GetPlayerAnimState();
  //fixvelocity
  animstate->m_vVelocityX = 0.f;
  animstate->m_vVelocityY = 0.f;
  animstate->speed_2d = 0.001f; // 0.0 will break more than fix so use 0.001 or just hook this field

  auto parent_cvar = r_jiggle_bones->m_pParent;
  if (parent_cvar == r_jiggle_bones)
    parent_cvar = 0;
  else
    parent_cvar = 1;

  // fixing goal feet yaw for better interpolating bones
  animstate->m_flGoalFeetYaw = this->m_flLowerBodyYawTarget() + animstate->m_flMaxBodyYaw;

  C_AnimationOverlay* pOverlay = this->GetAnimOverlay(6);
  //adjust the value to correctly calculate the position of the bones
  pOverlay->m_flWeight = pOverlay->m_flCycle = pOverlay->m_flPlaybackRate = 0.f;

  if (pOverlay->m_Sequence > 0)
    pOverlay->m_Sequence += 1; // Fixing sequence delay before setup bones calc

  //skip extrapolating velocity
  m_bHasDefuser() = false;
  this->m_vecVelocity() = this->EstimateAbsVelocity() * animstate->m_flUnknownVelocityLean;
  //trigger lby update
  m_nSequence() = 979;
  animstate->m_flLastBodyUpdate = g_Globals->curtime + 1.32f; // set new body yaw update with delay

  *(int*)(((uintptr_t)this) + 0xA30) = 0;

  auto v5 = *(int*)(((uintptr_t)this) + 0xF0);
  *(int*)(((uintptr_t)this) + 0xF0) |= 8u;
  auto v6 = *(uint8_t*)(((uintptr_t)this) + 0x274);
  *(uint8_t*)(((uintptr_t)this) + 0x274) &= 0xFEu;
  *(int*)(g_GlobalVars + 0x001C) = -1; // fix interpolation
  *(bool*)(((uintptr_t)this) + 0xF3C) = true; // SetupVelocity call for calculation right angles
  // ref: DoExtraBonesProcessing
  (*(_BYTE *)(uintptr_t(this )+ 0xA28)) |= 0xE;
  *(short*)(uintptr_t(this)+ 0x272) = -1


  int result = 1;
  __asm push 0x54f12f43
  this->SetupBones(0, -1, BONE_USED_BY_ANYTHING, g_GlobalVars->curtime);
  __asm pop result

  this->m_vecVelocity() = this->EstimateAbsVelocity(); // restore velocity

  *(uint8_t*)(((uintptr_t)this) + 0x274) = v6;
  *(int*)(((uintptr_t)this) + 0xF0) = v5;

  r_jiggle_bones->SetValue(result);
}


bool __fastcall hkSetupBones(void* ecx, void* edx, matrix3x4_t* pBoneToWorldOut, int nMaxBones, int boneMask, float currentTime) {
  auto stack = _AddressOfReturnAddress();
  //prevent game call setupbones
  if (*(int*)((int)stack + 0x14) != 0x54f12f43){
    return false;
  }
  return oSetupBones( ecx, edx, pBoneToWorldOut, nMaxBones, boneMask, std::remainderf(currentTime, 360.0f));
}

credits also: @poiak, @ikfakof,@Soufiw, @esloberic, not flying lama
зачем сливать то что уже было?
пизи разлогинься
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
дай тогда пожалуйста верный вариант
Реверсь кс го и сам поймёшь как нужно делать правильное получение костей игрока с сервера (анимфикс в широком смысле). А ваще я сомневаюсь что ты даже нормально хукнул сетапбонс
 
Назад
Сверху Снизу