def get_char_dic(minlength, maxlength, customchar, encode, head, tail): return get_base_dic(minlength, maxlength, customchar, encode, head, tail, need_char_dic=True)
os.makedirs(tmp_dirpath) paths.results_path = tmp_dirpath paths.results_file_name = tmp_filename else: if not os.path.isdir(paths.results_path): os.makedirs(paths.results_path) except WindowsError: exit(pyoptions.CRLF + cool.red("[-] Cannot create result file: %s " % paths.results_path)) if __name__ == '__main__': print("{}".format(cool.green(pydictor_art_text))) init() if pyoptions.args_base: get_base_dic(pyoptions.args_base) elif pyoptions.args_char: get_char_dic(pyoptions.args_char) elif pyoptions.args_chunk: get_chunk_dic(pyoptions.args_chunk) elif pyoptions.args_extend: get_extend_dic(pyoptions.args_extend) elif pyoptions.args_plug: plug_parser() elif pyoptions.args_sedb: try: sedb_tricks() shell = SEDB() shell.cmdloop() except Exception as e: exit(e)
cool.red("[-] Cannot create %s " % get_result_store_path())) if args.output: if os.path.exists(args.output): tmppath = os.path.abspath(args.output) else: try: os.mkdir(args.output) tmppath = os.path.abspath(args.output) except IOError: tmppath = "" print(CRLF + cool.red("[-] Cannot create %s, default %s" % (args.output, get_result_store_path()))) if os.path.isdir(tmppath): set_result_store_path(tmppath) if args.base: get_base_dic(args.len[0], args.len[1], args.base, args.encode, args.head, args.tail) elif args.customchar: get_char_dic(args.len[0], args.len[1], args.customchar, args.encode, args.head, args.tail) elif args.chunk: chunk = [] for item in args.chunk: if item != '': chunk.append(item) get_chunk_dic(chunk, args.encode, args.head, args.tail) elif args.plugins: if args.plugins[0] not in plug_range: exit("[!] Choose plug from ({0}, {1}, {2}, {3})".format( cool.fuchsia(plug_range[0]), cool.fuchsia(plug_range[1]), cool.fuchsia(plug_range[2]), cool.fuchsia(plug_range[3]))) else:
if args.output: if os.path.exists(args.output): tmppath = os.path.abspath(args.output) else: try: os.mkdir(args.output) tmppath = os.path.abspath(args.output) except IOError: tmppath = "" print(CRLF + cool.red("[-] Cannot create %s, default %s" % (args.output, get_result_store_path()))) if os.path.isdir(tmppath): set_result_store_path(tmppath) if args.type: get_base_dic(args.len[0], args.len[1], getchars(args.type), args.encode, args.head, args.tail) elif args.customchar: get_base_dic(args.len[0], args.len[1], args.customchar, args.encode, args.head, args.tail) elif args.chunk: chunk = [] for item in args.chunk: if item != '': chunk.append(item) get_chunk_dic(chunk, args.encode, args.head, args.tail) elif args.plugins: if len(args.plugins) == 1 and args.plugins[0] == 'pid6': getIDCardPost('pid6', args.encode, args.head, args.tail, args.sex) elif len(args.plugins) == 1 and args.plugins[0] == 'pid8': getIDCardPost('pid8', args.encode, args.head, args.tail, args.sex) elif len(args.plugins) == 1 and args.plugins[0] == 'extend':
def get_char_dic(customchar): return get_base_dic(customchar, need_char_dic=True)