From d26536abd485671f43b394f8bc2ee83b0f3b00aa Mon Sep 17 00:00:00 2001 From: "gergely.erdelyi" Date: Mon, 27 Apr 2009 18:20:02 +0000 Subject: [PATCH] idautils.py: Heads() and Functions() now used inf.minEA and inf.maxEA as default parameters idautils.py: Heads() will not yield a head at 'start' if there is none --- python/idautils.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/python/idautils.py b/python/idautils.py index 576762f..b486d25 100644 --- a/python/idautils.py +++ b/python/idautils.py @@ -171,27 +171,29 @@ def XrefsTo(ea, flags=0): yield _copy_xref(xref) -def Heads(start, end): +def Heads(start=idaapi.cvar.inf.minEA, end=idaapi.cvar.inf.maxEA): """ Get a list of heads (instructions or data) - @param start: start address (this one is always included) - @param end: end address + @param start: start address (default: inf.minEA) + @param end: end address (default: inf.maxEA) @return: list of heads between start and end """ ea = start + if not idc.isHead(idc.GetFlags(ea)): + ea = idaapi.next_head(ea, end) while ea != idaapi.BADADDR: yield ea ea = idaapi.next_head(ea, end) -def Functions(start, end): +def Functions(start=idaapi.cvar.inf.minEA, end=idaapi.cvar.inf.maxEA): """ Get a list of functions - @param start: start address - @param end: end address + @param start: start address (default: inf.minEA) + @param end: end address (default: inf.maxEA) @return: list of heads between start and end