Skip to content

Commit

Permalink
Check return address in shouldDrawFog hook only when using MinHook ho…
Browse files Browse the repository at this point in the history
…oking method
  • Loading branch information
danielkrupinski committed Jun 22, 2020
1 parent d9abfd6 commit 852b538
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Osiris/Hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ static void __stdcall emitSound(SoundData data) noexcept

static bool __stdcall shouldDrawFog() noexcept
{
if constexpr (std::is_same_v<HookType, MinHook>) {
#ifdef _DEBUG
// Check if we always get the same return address
if (*static_cast<std::uint32_t*>(_ReturnAddress()) == 0x6274C084) {
Expand All @@ -320,6 +321,7 @@ static bool __stdcall shouldDrawFog() noexcept

if (*static_cast<std::uint32_t*>(_ReturnAddress()) != 0x6274C084)
return hooks->clientMode.callOriginal<bool, 17>();
}

return !config->visuals.noFog;
}
Expand Down

0 comments on commit 852b538

Please sign in to comment.