Relation between ordinal numbers and ordinal bases in PE-files.
Doing some PE-analysis, I cannot recognize what the PE-documentation says in practice:
Thus, when the export name pointer table is searched and a matching string is foundat position i, the algorithm for finding the symbol’s address is:
i = Search_ExportNamePointerTable (ExportName);
ordinal = ExportOrdinalTable [i];
SymbolRVA = ExportAddressTable [ordinal - OrdinalBase];
Having located the ordinal x
for e.g. ExitProcess
and verified to ordinal base to be 0x01
, the RVA for ExitProcess
is found at position x
within the export address table, and not at position x - 1
as specified by the documentation.
Indeed, to look up the RVA for a function, I compute export_address_base + ordinal * 0x04
, and not the advertised export_address_base + (ordinal - 1) * 0x04
Am I missing something here?