def below(ea, includeSegment=False): '''Return all of the function names and their offset that are called by the function at `ea`.''' tryhard = lambda ea: "{:s}{:+x}".format(func.name(func.top( ea)), ea - func.top(ea)) if func.within(ea) else "{:+x}".format( ea) if func.name(ea) is None else func.name(ea) return '\n'.join(':'.join( [segment.name(ea), tryhard(ea)] if includeSegment else [tryhard(ea)]) for ea in func.down(ea))
def below(ea, includeSegment=False): '''Display all the functions that the function at /ea/ can call''' tryhard = lambda ea: "{:s}+{:x}".format(database.name(function.top( ea)), ea - function.top(ea)) if function.within( ea) else "+{:x}".format(ea) if database.name( ea) is None else database.name(ea) return '\n'.join( ':'.join((segment.name(ea), tryhard(ea)) if includeSegment else (tryhard(ea), )) for ea in function.down(ea))
def _collectcall(addr, result): process = {item for item in []} for f in func.down(addr): if any(f in coll for coll in [result, sentinel]): continue if not func.within(f): logging.warning("{:s}.collectcall({:#x}, {!r}) : Adding non-function address {:#x} ({:s}).".format(__name__, ea, sentinel, f, database.name(f))) result.add(f) continue process.add(f) for addr in process: result |= _collectcall(addr, result | process) return result
def _collectcall(addr, result): process = set() for f in func.down(addr): if any(f in coll for coll in (result, sentinel)): continue if not func.within(f): logging.warn("{:s}.collectcall({:#x}, {!r}) : Adding non-function address {:#x} ({:s}).".format(__name__, ea, sentinel, f, database.name(f))) result.add(f) continue process.add(f) for addr in process: result |= _collectcall(addr, result | process) return result
def below(ea): '''Display all the functions that the function at /ea/ can call''' tryhard = lambda x: '%s+%x'%(database.name(function.top(x)),x-function.top(x)) if function.within(x) else hex(x) if database.name(x) is None else database.name(x) return '\n'.join(map(tryhard,function.down(ea)))
def below(ea, includeSegment=False): '''Return all of the function names and their offset that are called by the function at `ea`.''' tryhard = lambda ea: "{:s}{:+x}".format(func.name(func.top(ea)), ea - func.top(ea)) if func.within(ea) else "{:+x}".format(ea) if func.name(ea) is None else func.name(ea) return '\n'.join(':'.join((segment.name(ea), tryhard(ea)) if includeSegment else (tryhard(ea),)) for ea in func.down(ea))
def below(ea): '''Display all the functions that the function at /ea/ can call''' tryhard = lambda x: '%s+%x' % (database.name(function.top( x)), x - function.top(x)) if function.within(x) else hex( x) if database.name(x) is None else database.name(x) return '\n'.join(map(tryhard, function.down(ea)))