Skip to content
This repository has been archived by the owner on Dec 26, 2021. It is now read-only.

Commit

Permalink
fix crash
Browse files Browse the repository at this point in the history
  • Loading branch information
SurvirvorHRG committed Jan 10, 2021
1 parent 062caf1 commit 66aeb39
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Memory/Hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<bool, __int64>();

if (Utils::getRttiBaseClassName(reinterpret_cast<void*>(_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<int*>(sigOffset + 3);
directoryPackAccessStrategyVtable = reinterpret_cast<uintptr_t**>(sigOffset + offset + 7);
}

if (*reinterpret_cast<uintptr_t*>(_this) == (uintptr_t)directoryPackAccessStrategyVtable)
return true;

return func(_this);
Expand Down

0 comments on commit 66aeb39

Please sign in to comment.