@magic.line_magic
    @magic_arguments()
    @argument('address', type=hexint, help='First address to search')
    @argument('size', type=hexint, help='Size of region to search')
    @argument('byte', type=hexint, nargs='+', help='List of bytes to search for, at any alignment')
    @argument('-f', '--fast', action='store_true', help='Go much faster, using somewhat less trustworthy methods')
    @argument('-s', '--space', type=str, default='arm', help='What address space to read from. See dump.py')
    def find(self, line):
        args = parse_argstring(self.find, line)
        d = self.shell.user_ns['d']
        substr = ''.join(map(chr, args.byte))

        results = search_block(d, args.address, args.size, substr, fast=args.fast, addr_space=args.space)

        for address, before, after in results:
            self.shell.write("%08x %52s [ %s ] %s\n" %
                (address, hexstr(before), hexstr(substr), hexstr(after)))
Read ARM memory block, and look for all occurrences of a byte sequence
dataset/ETHPy150Open scanlime/coastermelt/backdoor/shell_magics.py/ShellMagics.find