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
This commit is contained in:
gergely.erdelyi 2009-04-27 18:20:02 +00:00
parent 769e9d70f4
commit d26536abd4

View File

@ -171,27 +171,29 @@ def XrefsTo(ea, flags=0):
yield _copy_xref(xref) 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) Get a list of heads (instructions or data)
@param start: start address (this one is always included) @param start: start address (default: inf.minEA)
@param end: end address @param end: end address (default: inf.maxEA)
@return: list of heads between start and end @return: list of heads between start and end
""" """
ea = start ea = start
if not idc.isHead(idc.GetFlags(ea)):
ea = idaapi.next_head(ea, end)
while ea != idaapi.BADADDR: while ea != idaapi.BADADDR:
yield ea yield ea
ea = idaapi.next_head(ea, end) 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 Get a list of functions
@param start: start address @param start: start address (default: inf.minEA)
@param end: end address @param end: end address (default: inf.maxEA)
@return: list of heads between start and end @return: list of heads between start and end