'Search for all addresses/references to addresses which belong to a memory range
Usage:
MYNAME address searchfor belongto
MYNAME pointer searchfor belongto'

def lookup(self, *arg):

    (option, searchfor, belongto) = normalize_argv(arg, 3)
    if (option is None):
        self._missing_argument()
    result = []
    if (searchfor is None):
        searchfor = 'stack'
    if (belongto is None):
        belongto = 'binary'
    if (option == 'pointer'):
        msg(('Searching    for    pointers    on:    %s    pointed    to:    %s,    this    may    take    minutes    to    complete...' % (searchfor, belongto)))
        result = peda.search_pointer(searchfor, belongto)
    if (option == 'address'):
        msg(('Searching    for    addresses    on:    %s    belong    to:    %s,    this    may    take    minutes    to    complete...' % (searchfor, belongto)))
        result = peda.search_address(searchfor, belongto)
    text = peda.format_search_result(result, 0)
    pager(text)
    return
