'Search for all valid pointers in memory ranges
Args:
- searchfor: memory region to search for pointers (String)
- belongto: memory region that pointed addresses belong to (String)
Returns:
- list of found result: (address(Int), value(Int))'

@memoized
def search_pointer(self, searchfor='stack', belongto='binary'):

    search_result = []
    result = []
    maps = self.get_vmmap()
    searchfor_ranges = self.get_vmmap(searchfor)
    belongto_ranges = self.get_vmmap(belongto)
    step = self.intsize()
    for (start, end, _, _) in searchfor_ranges[::(-1)]:
        mem = self.dumpmem(start, end)
        if (not mem):
            continue
        for i in range(0, len(mem), step):
            search = ('0x' + codecs.encode(mem[i:(i + step)][::(-1)], 'hex').decode('utf-8'))
            addr = to_int(search)
            if self.is_address(addr):
                (v, t, vn) = self.examine_mem_value(addr)
                if (t != 'value'):
                    if self.is_address(to_int(vn), belongto_ranges):
                        if ((to_int(v), v) not in search_result):
                            search_result += [(to_int(v), v)]
        for (a, v) in search_result:
            result += self.searchmem(start, end, to_address(a), mem)
    return result
