Question

i have been delving into ida Pro for the last couple of weeks to get a bit of a background.

Something that has been bugging me for a long time though is the seemingly lack of support for pulling out the imported functions.

All i want is a script that can copy the entire imports window and paste into a text file, but I am having serious trouble finding anything in the API's that can help me do this. It should be very simple, yet I find it impossible. I have managed to find things to pull out the library's from this window, but nothing to pull out everything.

any help or direction would be much appreciated.

Was it helpful?

Solution

I agree with the assertion that you should use Ctrl+Ins or dumpbin.

However, what you ask has been solved already by the IDAPython project and I suggest you head over and look at their examples (here and here), especially this one.

The relevant idaapi functions are:

  • idaapi.get_import_module_qty
  • idaapi.enum_import_names

OTHER TIPS

GUI Solution:

You can copy the entire contents of the imports window by placing focus on that window and hitting Ctrl+Ins.

IDAPython Solution:

This may need to be tweaked to your liking, but this should hopefully get you started:

text = ""
seg = SegByName(".idata")
for i in xrange(seg, SegEnd(seg), 4):
    text += "%08x %s\r\n" % (i, Name(i))
open(r"c:\imports.txt", "wb").write(text)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top