summaryrefslogtreecommitdiff
path: root/tools/descramble.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2005-01-24 09:01:48 +0000
committerDaniel Stenberg <daniel@haxx.se>2005-01-24 09:01:48 +0000
commitadaae249ef397a65d7d77c378e2050f0d61144a7 (patch)
tree6fe5259adbe1f8ebe4b5af8eb602f020b546561a /tools/descramble.c
parent99dbd7c5e99a972dd56b120100edd84b83cc4e3e (diff)
downloadrockbox-adaae249ef397a65d7d77c378e2050f0d61144a7.zip
rockbox-adaae249ef397a65d7d77c378e2050f0d61144a7.tar.gz
rockbox-adaae249ef397a65d7d77c378e2050f0d61144a7.tar.bz2
rockbox-adaae249ef397a65d7d77c378e2050f0d61144a7.tar.xz
iRiver scramble and descramble code from Dave Cooper
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5649 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools/descramble.c')
-rw-r--r--tools/descramble.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/tools/descramble.c b/tools/descramble.c
index 7ed3213..7376190 100644
--- a/tools/descramble.c
+++ b/tools/descramble.c
@@ -20,6 +20,20 @@
#include <stdio.h>
#include <stdlib.h>
+#include "iriver.h"
+
+void usage(void)
+{
+ printf("usage: descramble [options] <input file> <output file>\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] <input file> <output file>\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");