def build_mangler_with_args(args): """Return an instance of Mangler with the given parameters.""" parameters = ManglingParameters() parameters.num_file = open(args.numbers_file, 'r').read().splitlines() parameters.sym_file = open(args.symbols_file, 'r').read().splitlines() if (args.custom_file): parameters.cus_file = open(args.custom_file, 'r').read().splitlines() parameters.mutation_mode = args.mutation_mode parameters.from_year = args.from_year print("[-] The method %s is not defined !" % method)
def build_mangler_with_args(args): parameters = ManglingParameters() parameters.num_file = open(args.numbers_file, 'r').read().splitlines() parameters.sym_file = open(args.symbols_file, 'r').read().splitlines() if (args.custom_file): parameters.cus_file = open(args.custom_file, 'r').read().splitlines() parameters.mutation_mode = args.mutation_mode parameters.from_year = args.from_year parameters.to_year = args.to_year parameters.suffix_pos_swap = args.symbols_before_suffix return Mangler(mangling_parameters=parameters)
def build_mangler_with_args(args): """Return an instance of Mangler with the given parameters.""" parameters = ManglingParameters() parameters.num_file = open(args.numbers_file, 'r').read().splitlines() parameters.sym_file = open(args.symbols_file, 'r').read().splitlines() if (args.custom_file): parameters.cus_file = open(args.custom_file, 'r').read().splitlines() parameters.from_year = args.from_year parameters.to_year = args.to_year parameters.suffix_pos_swap = args.symbols_before_suffix return Mangler(mangling_parameters=parameters)
def build_mangler_with_args(args): """Return an instance of Mangler with the given parameters.""" parameters = ManglingParameters() parameters.num_file = open(args.numbers_file, 'r').read().splitlines() parameters.sym_file = open(args.symbols_file, 'r').read().splitlines() if (args.custom_file): parameters.cus_file = open(args.custom_file, 'r').read().splitlines() parameters.mutation_mode = args.mutation_mode parameters.from_year = args.from_year parameters.to_year = args.to_year parameters.short_year = args.short_year (name, line.strip()))
def validate_files(strings_file, output_file): """Check if input/output files are valid.""" if not os.path.isfile(strings_file): print("[-] The file %s does not exist or is not a file!" % strings_file) sys.exit(1) if os.path.isfile(output_file): os.remove(output_file) parameters = ManglingParameters() parameters.num_file = open(args.numbers_file, 'r').read().splitlines() parameters.sym_file = open(args.symbols_file, 'r').read().splitlines() if (args.custom_file): parameters.cus_file = open(args.custom_file, 'r').read().splitlines() parameters.mutation_mode = args.mutation_mode parameters.from_year = args.from_year parameters.to_year = args.to_year parameters.suffix_pos_swap = args.symbols_before_suffix return Mangler(mangling_parameters=parameters)