diff options
Diffstat (limited to 'utils/jz4760_tools/packtools.cpp')
-rw-r--r-- | utils/jz4760_tools/packtools.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/utils/jz4760_tools/packtools.cpp b/utils/jz4760_tools/packtools.cpp index 6bd5ec0330..b594525978 100644 --- a/utils/jz4760_tools/packtools.cpp +++ b/utils/jz4760_tools/packtools.cpp | |||
@@ -96,6 +96,9 @@ const uint32_t jz4760_crc_key[256] = | |||
96 | 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0, | 96 | 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0, |
97 | }; | 97 | }; |
98 | 98 | ||
99 | /* This table is generated programmatically: it contains two copies of a 172-bytes | ||
100 | * table. This table contains the lower 8-bit of the first 172 prime numbers: | ||
101 | * 2, 3, 5, 7, ..., 251(=0xfb), 257(=0x101 -> 0x01), ... */ | ||
99 | const unsigned JZ4760_XOR_KEY_SIZE = 344; | 102 | const unsigned JZ4760_XOR_KEY_SIZE = 344; |
100 | uint8_t jz4760_xor_key[JZ4760_XOR_KEY_SIZE] = | 103 | uint8_t jz4760_xor_key[JZ4760_XOR_KEY_SIZE] = |
101 | { | 104 | { |
@@ -530,7 +533,7 @@ int descramble(int argc, char **argv) | |||
530 | 533 | ||
531 | void usage() | 534 | void usage() |
532 | { | 535 | { |
533 | printf("usage: [--pack|--unpack|--descramble] <options>\n"); | 536 | printf("usage: [--pack|--unpack|--descramble|--scramble] <options>\n"); |
534 | printf(" unpack options:\n"); | 537 | printf(" unpack options:\n"); |
535 | printf(" -i <file> Input file\n"); | 538 | printf(" -i <file> Input file\n"); |
536 | printf(" -o <dir> Output directory\n"); | 539 | printf(" -o <dir> Output directory\n"); |
@@ -541,7 +544,7 @@ void usage() | |||
541 | printf(" -m <mach> Machine flags\n"); | 544 | printf(" -m <mach> Machine flags\n"); |
542 | printf(" -v Verbose output\n"); | 545 | printf(" -v Verbose output\n"); |
543 | printf(" -t <time> Override date/time (dd/mm/yy hh:mm)\n"); | 546 | printf(" -t <time> Override date/time (dd/mm/yy hh:mm)\n"); |
544 | printf(" descramble options:\n"); | 547 | printf(" (de)scramble options:\n"); |
545 | printf(" -i <file> Input file\n"); | 548 | printf(" -i <file> Input file\n"); |
546 | printf(" -o <file> Output file\n"); | 549 | printf(" -o <file> Output file\n"); |
547 | exit(1); | 550 | exit(1); |
@@ -555,7 +558,7 @@ int main(int argc, char **argv) | |||
555 | return unpack(argc - 1, argv + 1); | 558 | return unpack(argc - 1, argv + 1); |
556 | if(strcmp(argv[1], "--pack") == 0) | 559 | if(strcmp(argv[1], "--pack") == 0) |
557 | return pack(argc - 1, argv + 1); | 560 | return pack(argc - 1, argv + 1); |
558 | if(strcmp(argv[1], "--descramble") == 0) | 561 | if(strcmp(argv[1], "--descramble") == 0 || strcmp(argv[1], "--scramble") == 0) |
559 | return descramble(argc - 1, argv + 1); | 562 | return descramble(argc - 1, argv + 1); |
560 | usage(); | 563 | usage(); |
561 | return 1; | 564 | return 1; |