Fix using incorrect member as bounds for looping exporteds

Fixes a crasher on certain modules as it could read oob; must use 'NumberOfNames' to iterate over export names.
This commit is contained in:
Kawe Mazidjatari 2023-07-23 20:02:12 +02:00
parent af81954b7f
commit 2b05edd374

View File

@ -120,7 +120,7 @@ CMemory CModule::GetExportedSymbol(QWORD pModuleBase, const char* szSymbolName)
if (!pAddressOfOrdinals)
return nullptr;
for (DWORD i = 0; i < pImageExportDirectory->NumberOfFunctions; i++)
for (DWORD i = 0; i < pImageExportDirectory->NumberOfNames; i++)
{
// Get virtual relative Address of the function name,
// then add module base Address to get the actual location.