| 57 | |
| 58 | |
| 59 | def build_base_parser(plugin_names): |
| 60 | p = argparse.ArgumentParser(description="Encrypt binary to new payload format (plugin-based)") |
| 61 | p.add_argument("-i", "--input", default="calc.bin", help="input binary file (default calc.bin)") |
| 62 | p.add_argument("-o", "--output", default="src/encrypt.bin", help="output encoded file (default src/encrypt.bin)") |
| 63 | default = plugin_names[0] if plugin_names else None |
| 64 | p.add_argument("-m", "--method", default=default, choices=plugin_names, |
| 65 | help="encryption method / plugin to use") |
| 66 | p.add_argument("-e", "--encode", default="base64", choices=["base64", "base32", "hex", "urlsafe_base64", "none"], |
| 67 | help="encoding method for output (default base64)") |
| 68 | return p |
| 69 | |
| 70 | |
| 71 | def main(): |