Exemplo n.º 1
0
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))
Exemplo n.º 2
0
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))
Exemplo n.º 3
0
 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
Exemplo n.º 4
0
 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
Exemplo n.º 5
0
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)))
Exemplo n.º 6
0
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))
Exemplo n.º 7
0
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)))