def invoke(self, arg, from_tty): search_for = '' current_runs = False address_space = False quick = False size_class = 0 filled_holes = False try: arg = arg.split() alist, args = getopt.getopt(arg, 'cs:qfa') for (field, val) in alist: if field in '-c': current_runs = True if field in '-a': address_space = True if field in '-s': size_class = int(val) if field in '-q': quick = True if field in '-f': filled_holes = True shadow.show_filled_holes() break if filled_holes == True: return search_for = args[0:] if not search_for: return except: if filled_holes == True: return print('[shadow] usage: jesearch [-cfqs] <hex dword>') print('[shadow] options:') print('[shadow] -c search current runs only') print('[shadow] -s <size> regions of the given size only') print('[shadow] for example: jesearch -c -s 256 0x41424344') print('[shadow] or: jesearch -f') return if filled_holes == False: shadow.search(search_for, size_class, current_runs, address_space)
def invoke(self, arg, from_tty): if arg == '': print('[shadow] usage: jesearch [-c] <hex dword>') print('[shadow] Use -c to search current runs only') print('[shadow] for example: jesearch 0x41424344') return arg = arg.split() if len(arg) >= 2 and arg[0] == '-c': current_runs = true search_for = arg[1] else: current_runs = false search_for = arg[0] shadow.search(search_for, \ search_current_runs = current_runs, proc = self.proc)
try: alist, args = getopt.getopt(sys.argv[2:], 'cs:') for (field, val) in alist: if field in '-c': search_current_runs = True if field in '-s': size_class = int(val) search_for = args[0:] if not search_for: sys.exit() except: print('[shadow] usage: jesearch [-cs] <hex dword>') print('[shadow] options:') print('[shadow] -c search current runs only') print('[shadow] -s <size> regions of the given size only') print('[shadow] for example: jesearch -c -s 256 0x41424344') sys.exit() shadow.search(search_for, size_class, search_current_runs, False) sys.exit() # EOF
shadow.show_filled_holes() break if filled_holes == true: sys.exit() search_for = args[0] except: if filled_holes == true: sys.exit() print('[shadow] usage: jesearch [-cfqs] <hex dword>') print('[shadow] options:') print('[shadow] -c search current runs only') print('[shadow] -q quick search') print('[shadow] -s <size> regions of the given size only') print('[shadow] -f search for filled region holes') print('[shadow] for example: jesearch -c -s 256 0x41424344') print('[shadow] or: jesearch -f') sys.exit() if filled_holes == false: shadow.search(search_for, region_size = size_class, \ search_current_runs = current_runs, quick_search = quick) sys.exit() # EOF