From 66aeb3955c8050a66982f8dd42882640220645e0 Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Sun, 10 Jan 2021 11:37:01 -0400 Subject: [PATCH] fix crash --- Memory/Hooks.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index b4f6fed59..c00940b17 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -1584,7 +1584,15 @@ __int64 Hooks::PaintingRenderer__render(__int64 _this, __int64 a2, __int64 a3) { bool Hooks::DirectoryPackAccessStrategy__isTrusted(__int64 _this) { static auto func = g_Hooks.DirectoryPackAccessStrategy__isTrustedHook->GetFastcall(); - if (Utils::getRttiBaseClassName(reinterpret_cast(_this)) == "DirectoryPackAccessStrategy") + static uintptr_t** directoryPackAccessStrategyVtable = 0; + + if (!directoryPackAccessStrategyVtable) { + uintptr_t sigOffset = FindSignature("48 8D 05 ?? ?? ?? ?? 49 89 06 49 8D 76 50"); + int offset = *reinterpret_cast(sigOffset + 3); + directoryPackAccessStrategyVtable = reinterpret_cast(sigOffset + offset + 7); + } + + if (*reinterpret_cast(_this) == (uintptr_t)directoryPackAccessStrategyVtable) return true; return func(_this);