diff options
Diffstat (limited to 'tools/descramble.c')
-rw-r--r-- | tools/descramble.c | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/tools/descramble.c b/tools/descramble.c index 7ed32139c6..7376190c69 100644 --- a/tools/descramble.c +++ b/tools/descramble.c | |||
@@ -20,6 +20,20 @@ | |||
20 | #include <stdio.h> | 20 | #include <stdio.h> |
21 | #include <stdlib.h> | 21 | #include <stdlib.h> |
22 | 22 | ||
23 | #include "iriver.h" | ||
24 | |||
25 | void usage(void) | ||
26 | { | ||
27 | printf("usage: descramble [options] <input file> <output file>\n"); | ||
28 | printf("options:\n" | ||
29 | "\t-fm Archos FM recorder format\n" | ||
30 | "\t-v2 Archos V2 recorder format\n" | ||
31 | "\t-mm=X Archos Multimedia format (X values: A=JBMM, B=AV1xx, C=AV3xx)\n" | ||
32 | "\t-iriver iRiver format\n" | ||
33 | "\nNo option assumes Archos standard player/recorder format.\n"); | ||
34 | exit(1); | ||
35 | } | ||
36 | |||
23 | int main (int argc, char** argv) | 37 | int main (int argc, char** argv) |
24 | { | 38 | { |
25 | unsigned long length,i,slen; | 39 | unsigned long length,i,slen; |
@@ -32,9 +46,7 @@ int main (int argc, char** argv) | |||
32 | FILE* file; | 46 | FILE* file; |
33 | 47 | ||
34 | if (argc < 3) { | 48 | if (argc < 3) { |
35 | printf("usage: %s [-fm] [-v2] [-mm] <input file> <output file>\n", | 49 | usage(); |
36 | argv[0]); | ||
37 | return -1; | ||
38 | } | 50 | } |
39 | 51 | ||
40 | if (!strcmp(argv[1], "-fm") || !strcmp(argv[1], "-v2")) { | 52 | if (!strcmp(argv[1], "-fm") || !strcmp(argv[1], "-v2")) { |
@@ -49,6 +61,14 @@ int main (int argc, char** argv) | |||
49 | oname = argv[3]; | 61 | oname = argv[3]; |
50 | descramble = 0; | 62 | descramble = 0; |
51 | } | 63 | } |
64 | |||
65 | if(!strcmp(argv[1], "-iriver")) { | ||
66 | /* iRiver code dealt with in the iriver.c code */ | ||
67 | iname = argv[2]; | ||
68 | oname = argv[3]; | ||
69 | iriver_decode(iname, oname, FALSE, STRIP_NONE); | ||
70 | return 0; | ||
71 | } | ||
52 | 72 | ||
53 | /* open file and check size */ | 73 | /* open file and check size */ |
54 | file = fopen(iname,"rb"); | 74 | file = fopen(iname,"rb"); |