Skip to content

Commit

Permalink
RtlGetReturnAddressHijackTarget (dotnet#102021)
Browse files Browse the repository at this point in the history
  • Loading branch information
VSadov authored May 8, 2024
1 parent cdef0dd commit 214ea9c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/coreclr/vm/threadsuspend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6060,7 +6060,13 @@ void ThreadSuspend::Initialize()
HMODULE hModNtdll = WszLoadLibrary(W("ntdll.dll"));
if (hModNtdll != NULL)
{
g_returnAddressHijackTarget = (void*)GetProcAddress(hModNtdll, "RtlGetReturnAddressHijackTarget");
typedef void* (*PFN_RtlGetReturnAddressHijackTarget)(void);

void* rtlGetReturnAddressHijackTarget = GetProcAddress(hModNtdll, "RtlGetReturnAddressHijackTarget");
if (rtlGetReturnAddressHijackTarget != NULL)
{
g_returnAddressHijackTarget = ((PFN_RtlGetReturnAddressHijackTarget)rtlGetReturnAddressHijackTarget)();
}
}
if (g_returnAddressHijackTarget == NULL)
{
Expand Down

0 comments on commit 214ea9c

Please sign in to comment.