2

I have a pretty basic IDAPython script which finds indirect calls by using idc.FindText() and then extracts the arguments. It works great except that it does not find the indirect calls in undefined functions. The script below can't find any calls if the function is correctly disassembled but undefined. However, the normal IDA GUI text search is able to find the call that I'm looking for. Is there something I'm doing wrong?

The basic code works like so:

addr = MinEA()
while addr != idc.BADADDR:
   addr = idc.FindText(addr, idc.SEARCH_DOWN | idc.SEARCH_NEXT, 0, 0, "call e")
   doStuff(addr)
   addr = idc.NextHead(addr)
  • I would recommend against using text search. There are specific APIs to do what you want. – NirIzr Nov 1 '17 at 14:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.