diff options
| author | jakob <jakob@memeware.net> | 2017-01-09 20:51:41 -0500 |
|---|---|---|
| committer | jakob <jakob@memeware.net> | 2017-01-09 20:51:41 -0500 |
| commit | 8eaa3f0526d380afe422152fada2bea27b8d8f70 (patch) | |
| tree | eded2f25609b6d131a377233fb215efac2b31c18 /src/cli.c | |
| parent | 7d141c7e79bb9688a475b88722f6101ad01ef782 (diff) | |
Significant progress on implementing file decryption. Offsets as of now are trying to go from within the table, which is incorrect. A working commit should come tomorrow.
Diffstat (limited to 'src/cli.c')
| -rw-r--r-- | src/cli.c | 33 |
1 files changed, 30 insertions, 3 deletions
@@ -24,13 +24,20 @@ #include "cli.h" #include "defs.h" -#define VERSION "0.1.0" +#define VERSION "1.0.0.rc1" #define HELP_TEXT "A tool for decompressing the XP3 archives used by " \ "Nekopara.\n\n" \ " -h, --help\t\tDisplay this help page and " \ "exit.\n" \ " -v, --version\tDisplay the currently installed " \ - "version and exit.\n\n" + "version and exit.\n\n" \ + " -l, --list\t\tList games supported by Nekopack.\n" \ + " -a, --archive\tAlternate way of specifying archive" \ + "to extract.\n" \ + " -g, --game\t\tGame the archive is from. Required for " \ + "file decryption" +#define GAME_CONSTANTS "none, nekopara_volume_0, nekopara_volume_0_steam, " \ + "nekopara_volume_1, nekopara_volume_1_steam" /* General subroutine for parsing command-line arguments. Returns a @@ -57,7 +64,8 @@ struct configuration parse_args(int argc, char *argv[]) { }; do { - current = getopt_long(argc, argv, "hv", long_options, &option_index); + current = getopt_long(argc, argv, "hvla:g:", long_options, + &option_index); switch (current) { case 'h': printf("Usage: %s [OPTIONS] (ARCHIVE PATH)\n\n", argv[0]); @@ -67,6 +75,25 @@ struct configuration parse_args(int argc, char *argv[]) { printf("Nekopack, version %s\nProgrammed by " "Jakob. <http://tsar-fox.com/>\n", VERSION); exit(EXIT_SUCCESS); + case 'l': + printf("%s\n", GAME_CONSTANTS); + exit(EXIT_SUCCESS); + case 'a': + count++; + parsed.archive_path = optarg; + break; + case 'g': + count++; + if (!strcmp(optarg, "nekopara_volume_0")) + parsed.source = NEKOPARA_VOLUME_0; + else if (!strcmp(optarg, "nekopara_volume_0_steam")) + parsed.source = NEKOPARA_VOLUME_0_STEAM; + else if (!strcmp(optarg, "nekopara_volume_1")) + parsed.source = NEKOPARA_VOLUME_1; + else if (!strcmp(optarg, "nekopara_volume_1_steam")) + parsed.source = NEKOPARA_VOLUME_1_STEAM; + else + parsed.source = NO_CRYPTO; } count++; } while (current >= 0); |