Skip to content

Commit

Permalink
Fix loading of DLLs that export all functions by ordinal
Browse files Browse the repository at this point in the history
See-also: fancycode#96
Signed-off-by: Simon Rozman <[email protected]>
  • Loading branch information
rozmansi committed Nov 7, 2020
1 parent f809ca2 commit eaa6085
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion MemoryModule.c
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ FARPROC MemoryGetProcAddress(HMEMORYMODULE mod, LPCSTR name)
}

exports = (PIMAGE_EXPORT_DIRECTORY) (codeBase + directory->VirtualAddress);
if (exports->NumberOfNames == 0 || exports->NumberOfFunctions == 0) {
if (exports->NumberOfFunctions == 0) {
// DLL doesn't export anything
SetLastError(ERROR_PROC_NOT_FOUND);
return NULL;
Expand Down

0 comments on commit eaa6085

Please sign in to comment.