TmpMenu/src/hooks/protections/invalid_decal.cpp
Andreas Maerten fcdeeba7ed Give optimisation hints to compiler (#2929)
feat(invoker): add compiler hints
chore(get network event data): added translation TODO
feat(native hooks): add compiler hint to crashes
feat(render): add likely compiler hint to on_present
feat(thread pool): add compiler hints
Added hook likely/unlikely switches to debug/crash scenarios.
Added HEX_TO_UPPER call on the AC verifier offsets.
Added more fuzzer unlikely attributes.
Replaced some hard coded numbers with their unhashed _J variants.
Added more unlikely attributes to singleton initializer checks.
Added more likely/unlikely attributes to certain scenarios.
2024-04-22 19:48:22 +02:00

16 lines
499 B
C++

#include "hooking/hooking.hpp"
namespace big
{
void hooks::invalid_decal(uintptr_t a1, int a2)
{
if (a1 && a2 == 2) [[unlikely]]
//*(*(*(a1 + 0x48) + 0x30) + 0x2C8)
if (const auto ptr = *reinterpret_cast<uintptr_t*>((a1 + 0x48)); ptr) [[unlikely]]
if (const auto ptr2 = *reinterpret_cast<uintptr_t*>((ptr + 0x30)); ptr2) [[unlikely]]
if (*reinterpret_cast<uintptr_t*>(ptr2 + 0x2C8) == 0) [[unlikely]]
return;
g_hooking->get_original<hooks::invalid_decal>()(a1, a2);
}
}