gendef: Detect jumping of stdcall function to imported ordinal-only symbol
Currently gendef does not recognize information about stdcall functions
which jumps to function from external library imported by ordinal number.
It prints just:
Check!!! Couldn't determine function argument count. Function doesn't return.
With this change gendef recognize also such jumps and prints better info:
Check!!! return value is from ord 1 in lib.dll
First thing which is fixed in this change is mixing of ordinal numbers and
hint numbers. Those are two different things which in most cases are not
same numbers for exported functions in DLL export table.
Imported function in PE import table is either by name + hint number or by
the ordinal number. Never both. Currently the imp32_add() is taking
argument named "ord", but do_import_read32() calls that function with
parsed hint number. And then dump_def() function is printing line
"from <name> in <dll> (ordinal <%u>)" but for %u it prints hint number.
This is misleading for reader as it makes hard to understand it.
Extend do_import_read32() to properly read ordinal or hint number (what is
available) and adjust dump_def() to print ordinal number or export name,
based on what is present. Printing the hint number from import table is
useless as in most cases it does not match the hint number from DLL export
table.
Signed-off-by: Martin Storsjö <martin@martin.st>
2 files changed