1

I'm developing a python script for IDA Pro that analyzes 32 bit PE files containing an anti-disassembly technique, the problem is that the function that contains the technique isn't being listed in the list of functions using idautils.Functions().

To solve the problem I tried to add the function to the list with:

segm = idaapi.get_segm_by_name(".text")
    start = segm.start_ea
    end = segm.end_ea
    while start < end:
        start = idaapi.find_not_func(start, 1)
        ida_funcs.add_func(start)

When the start value is the address of the beginning of the function the ida_funcs.add_func method returns false, meaning that the address can't be added as a function, despite that in the GUI of IDA the function becomes listed.

This is the screenshot of the function containing the technique in the IDA GUI: enter image description here

Do you know what can I do in order to have the script working? Thank you in advance.

1 Answer 1

0

I have solved my problem by using twice idc.auto_wait(), the first time at the start of the script and then between the snippet of code that I posted and the idautils.Functions(), now the function that I need to analyze gets listed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.