mirror of
https://github.com/cemu-project/idapython.git
synced 2024-11-28 03:54:18 +01:00
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:
parent
769e9d70f4
commit
d26536abd4
@ -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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user