Skip to content

Commit 058d466

Browse files
committed
Detect when GetProcAddress is called with a DLL ordinal number and skip the string checks
1 parent 0ea89aa commit 058d466

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

sa-mp_masterlist_fix/Fix.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,14 @@ FARPROC WINAPI Fix::GetProcAddress(HMODULE hModule, LPCSTR lpProcName)
1111
return ::GetProcAddress(hModule, lpProcName);
1212
}
1313

14-
auto it = self.m_hooks.find(lpProcName);
15-
if (it != self.m_hooks.end())
14+
// Make sure we are dealing with a string, not a DLL ordinal
15+
if (HIWORD(lpProcName))
1616
{
17-
return it->second;
17+
auto it = self.m_hooks.find(lpProcName);
18+
if (it != self.m_hooks.end())
19+
{
20+
return it->second;
21+
}
1822
}
1923

2024
urmem::hook::raii raii(self.m_procGetterHook);

0 commit comments

Comments
 (0)