Closed GoogleCodeExporter closed 9 years ago
A good new to this question after I searched in the discussion group, and
luckily I found that Romain already give an solution to my question, and now I
can get all function names imported by ordinals.
But unfortunately after detailed investigation, I noticed that his solution is
not a complete solution.
Because it currently just work for pe.DIRECTORY_ENTRY_IMPORT , and it still
cannot work for delay import table [which is pe.DIRECTORY_ENTRY_DELAY_IMPORT],
and I tried to revise pefile python code [parse_delay_import_directory function
and parse_imports function ] to implement it but failed with dead looping
seemingly, because the code seems to enter into an infinite loop.
Currently I got the following results: OLEAUT32.dll is belong to
DIRECTORY_ENTRY_IMPORT and WS2_32.dll is belong to DIRECTORY_ENTRY_DELAY_IMPORT.
OLEAUT32.dll
0x10493f0c SysFreeString 6 OLEAUT32.dll
0x10493f10 SysAllocString 2 OLEAUT32.dll
0x10493f14 SysStringLen 7 OLEAUT32.dll
0x10493f18 SysAllocStringLen 4 OLEAUT32.dll
0x10493f1c VariantClear 9 OLEAUT32.dll
0x10493f20 VariantTimeToSystemTime 185 OLEAUT32.dll
0x10493f24 SafeArrayLock 21 OLEAUT32.dll
0x10493f28 SafeArrayGetLBound 20 OLEAUT32.dll
0x10493f2c SafeArrayGetUBound 19 OLEAUT32.dll
0x10493f30 SafeArrayUnlock 22 OLEAUT32.dll
0x10493f34 SafeArrayDestroy 16 OLEAUT32.dll
0x10493f38 SafeArrayCreateVector 411 OLEAUT32.dll
WS2_32.dll
0x1052b548 None 271075289 8 WS2_32.dll
0x1052b54c None 271075262 9 WS2_32.dll
0x1052b550 getaddrinfo 271075309 None WS2_32.dll
0x1052b554 None 271075299 57 WS2_32.dll
0x1052b558 None 273211143 14 WS2_32.dll
0x1052b55c freeaddrinfo 271075319 None WS2_32.dll
0x1052b560 None 273211153 15 WS2_32.dll
Obviously the existent solution just did not work for the delayed import table,
such as WS2_32.dll.
And for my purpose, I would have to parse the WS2_32.dll again to get its
export table then matching with the ordinal number.
Here, I just want to point to this problem, and hope that there is an solution,
which like IDAPro.
Thanks in advance!
Original comment by linfengl...@gmail.com
on 18 Sep 2012 at 11:46
When symbols are imported by ordinal there will be no names and viceversa, when
imported by name there will be no ordinal.
IDA displays the information because it knows the names that correspond to the
ordinals for some common DLLs. pefile will be able to do something similar.
Original comment by ero.carr...@gmail.com
on 4 Dec 2013 at 5:36
There is now support to resolve symbols from 'ws2_32.dll' / 'wsock32.dll' and
'oleaut32.dll' thanks to a patch contributed by Mandiant (revision 134).
Original comment by ero.carr...@gmail.com
on 11 Dec 2013 at 10:47
Original issue reported on code.google.com by
linfengl...@gmail.com
on 11 Sep 2012 at 11:12