diff --git a/src/main/asset/nx2/tool/usb-profile.c b/src/main/asset/nx2/tool/usb-profile.c index 77c206a..5b4b722 100644 --- a/src/main/asset/nx2/tool/usb-profile.c +++ b/src/main/asset/nx2/tool/usb-profile.c @@ -4,155 +4,370 @@ #include #include #include +#include +#include #include "asset/nx2/lib/util.h" +#include "asset/nx2/lib/usb-save.h" +#include "util/fs.h" #include "util/str.h" int main(int argc, char **argv) { - int ret; - char *rank_path; - char *save_path; + int ret = 0; + char *rank_path_encrypted; + char *save_path_encrypted; + char *rank_path_decrypted; + char *save_path_decrypted; + + struct asset_nx2_usb_rank *rank = NULL; + struct asset_nx2_usb_save *save = NULL; + + if (argc < 2 || argc > 3) + { + printf("Usage: %s help\n", argv[0]); + return -1; + } - if (argc < 3) { + if (!strcmp(argv[1], "help")) + { printf( - "Usage: %s [cmd: new, dec, enc, dump] " - "[path containing nx2rank.bin nx2save.bin]\n", + "Usage: %s [COMMAND]