Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions MemoryModule.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -602,15 +602,20 @@ FARPROC MemoryGetProcAddress(HMEMORYMODULE module, LPCSTR name)
return NULL;
}

// search function name in list of exported names
nameRef = (DWORD *) (codeBase + exports->AddressOfNames);
ordinal = (WORD *) (codeBase + exports->AddressOfNameOrdinals);
for (i=0; i<exports->NumberOfNames; i++, nameRef++, ordinal++){
if (_stricmp(name, (const char *) (codeBase + (*nameRef))) == 0){
idx = *ordinal;
break;
}
}
if (0 == HIWORD(name)){
idx = LOWORD(name) - exports->Base;
}
else{
// search function name in list of exported names
nameRef = (DWORD *)(codeBase + exports->AddressOfNames);
ordinal = (WORD *)(codeBase + exports->AddressOfNameOrdinals);
for (i = 0; i < exports->NumberOfNames; i++, nameRef++, ordinal++){
if (_stricmp(name, (const char *)(codeBase + (*nameRef))) == 0){
idx = *ordinal;
break;
}
}
}

if (idx == -1){
// exported symbol not found
Expand Down