mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-07-30 07:18:37 -09:00
9396: Fix unsigned PE export ordinal-table indexes
The PE Export Ordinal Table stores unsigned 16-bit indexes into the Export Address Table. Reading these values with readShort() sign-extends entries from 0x8000 through 0xffff, preventing them from matching the nonnegative function index and causing their export names to be lost.
This commit is contained in:
committed by
Ryan Kurtz
parent
fe841ab92d
commit
683b8dae88
@@ -314,7 +314,7 @@ public class ExportDataDirectory extends DataDirectory implements StructConverte
|
||||
|
||||
// See if this function has an associated name exported for it.
|
||||
for (int j = 0; j < numberOfNames; ++j) {
|
||||
int jthOrdinalVal = reader.readShort(pointerToOrdinals + (j * 2));
|
||||
int jthOrdinalVal = reader.readUnsignedShort(pointerToOrdinals + (j * 2));
|
||||
if (jthOrdinalVal == i) {
|
||||
int jthNameRVA = reader.readInt(pointerToNames + (j * 4));
|
||||
int jthNamePtr = ntHeader.rvaToPointer(jthNameRVA);
|
||||
|
||||
Reference in New Issue
Block a user