This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
YimMenu/src/hooks/protections/fragment_physics_crash.cpp
TheGreenBandit 858b4d6b9f
feat(Protection): fragment physics crash (#806)
Patch made by @SkiddyToast
2023-01-03 10:52:07 +00:00

21 lines
645 B
C++

#include "hooking.hpp"
namespace big
{
bool hooks::fragment_physics_crash(uintptr_t a1, uint32_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5)
{
if (auto ptr = *reinterpret_cast<uintptr_t*>(a5 + 0x70); ptr)
if (auto ptr2 = *reinterpret_cast<uintptr_t*>(ptr + 8 * a2); !ptr2)
return false;
return g_hooking->get_original<hooks::fragment_physics_crash>()(a1, a2, a3, a4, a5);
}
bool hooks::fragment_physics_crash_2(float* a1, float* a2)
{
if (!a1 || !a2)
return false;
return g_hooking->get_original<hooks::fragment_physics_crash_2>()(a1, a2);
}
}