mxmssh / idapython

Automatically exported from code.google.com/p/idapython
Other
0 stars 0 forks source link

idautils.Functions() makes incorrect assumption #41

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
If MinEA() does not reside in a function then the following (equivalent)
calls will return nothing:

idautils.Functions()
idautils.Functions(idc.MinEA(), idc.MaxEA())

The problem is on line 218:

http://code.google.com/p/idapython/source/browse/trunk/python/idautils.py#218
func = idaapi.get_func(start)

This needs to be encapsulated in a loop to find the start of the first
function:

func = None
while not func:
    func = idaapi.get_func(start)
    start += 1

Original issue reported on code.google.com by pedram.amini on 5 Nov 2009 at 9:09

GoogleCodeExporter commented 9 years ago
We're having this issue too with 5.5.  I think you can just call 
idaapi.get_next_func(0) to find the first function?  Maybe?

Original comment by rosskin...@gmail.com on 20 Nov 2009 at 4:32

GoogleCodeExporter commented 9 years ago
This should be fixed by http://code.google.com/p/idapython/source/detail?r=199

If it reproduces for you with the trunk version of idautils.py, please send me 
an example IDB.
You can just copy the latest version of the script over the one that comes with 
5.5.

Original comment by gergely.erdelyi on 24 Nov 2009 at 2:52

GoogleCodeExporter commented 9 years ago
I take the silence as agreement. Case closed for now. ;)

Original comment by gergely.erdelyi on 4 Feb 2010 at 9:03

GoogleCodeExporter commented 9 years ago
Huh.  I thought I'd have gotten email about your comment #2, but I didn't.  The 
fix in 
r199 works for us.

Original comment by rosskin...@gmail.com on 4 Feb 2010 at 9:47

GoogleCodeExporter commented 9 years ago
Gergely,

Weird. I only got notification on this recent message from you. Fix looks good.

Original comment by pedram.amini on 4 Feb 2010 at 9:52