From adaae249ef397a65d7d77c378e2050f0d61144a7 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 24 Jan 2005 09:01:48 +0000 Subject: iRiver scramble and descramble code from Dave Cooper git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5649 a1c6a512-1295-4272-9138-f99709370657 --- tools/descramble.c | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'tools/descramble.c') 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 @@ #include #include +#include "iriver.h" + +void usage(void) +{ + printf("usage: descramble [options] \n"); + printf("options:\n" + "\t-fm Archos FM recorder format\n" + "\t-v2 Archos V2 recorder format\n" + "\t-mm=X Archos Multimedia format (X values: A=JBMM, B=AV1xx, C=AV3xx)\n" + "\t-iriver iRiver format\n" + "\nNo option assumes Archos standard player/recorder format.\n"); + exit(1); +} + int main (int argc, char** argv) { unsigned long length,i,slen; @@ -32,9 +46,7 @@ int main (int argc, char** argv) FILE* file; if (argc < 3) { - printf("usage: %s [-fm] [-v2] [-mm] \n", - argv[0]); - return -1; + usage(); } if (!strcmp(argv[1], "-fm") || !strcmp(argv[1], "-v2")) { @@ -49,6 +61,14 @@ int main (int argc, char** argv) oname = argv[3]; descramble = 0; } + + if(!strcmp(argv[1], "-iriver")) { + /* iRiver code dealt with in the iriver.c code */ + iname = argv[2]; + oname = argv[3]; + iriver_decode(iname, oname, FALSE, STRIP_NONE); + return 0; + } /* open file and check size */ file = fopen(iname,"rb"); -- cgit v1.2.3