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/scramble.c | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) (limited to 'tools/scramble.c') diff --git a/tools/scramble.c b/tools/scramble.c index 4e3addfc26..df6c5ac084 100644 --- a/tools/scramble.c +++ b/tools/scramble.c @@ -20,6 +20,8 @@ #include #include +#include "iriver.h" + void int2le(unsigned int val, unsigned char* addr) { addr[0] = val & 0xFF; @@ -36,6 +38,22 @@ void int2be(unsigned int val, unsigned char* addr) addr[3] = val & 0xFF; } +void usage(void) +{ + printf("usage: scramble [options] [xor string]\n"); + printf("options:\n" + "\t-fm Archos FM recorder format\n" + "\t-v2 Archos V2 recorder format\n" + "\t-ofm Archos Ondio FM recorder format\n" + "\t-osp Archos Ondio SP format\n" + "\t-neo SSI Neo format\n" + "\t-mm=X Archos Multimedia format (X values: A=JBMM, B=AV1xx, C=AV3xx)\n" + "\t-iriver iRiver format\n" + "\nNo option results in Archos standard player/recorder format.\n"); + + exit(1); +} + int main (int argc, char** argv) { unsigned long length,i,slen; @@ -51,16 +69,7 @@ int main (int argc, char** argv) enum { none, scramble, xor } method = scramble; if (argc < 3) { - printf("usage: %s [options] [xor string]\n",argv[0]); - printf("options:\n"); - printf("\t-fm Archos FM recorder format\n"); - printf("\t-v2 Archos V2 recorder format\n"); - printf("\t-ofm Archos Ondio FM recorder format\n"); - printf("\t-osp Archos Ondio SP format\n"); - printf("\t-neo SSI Neo format\n"); - printf("\t-mm=X Archos Multimedia format (X values: A=JBMM, B=AV1xx, C=AV3xx)\n"); - printf("\nNo option results in Archos standard player/recorder format.\n"); - return -1; + usage(); } if(!strcmp(argv[1], "-fm")) { @@ -111,6 +120,14 @@ int main (int argc, char** argv) } } + else if(!strcmp(argv[1], "-iriver")) { + /* iRiver code dealt with in the iriver.c code */ + iname = argv[2]; + oname = argv[3]; + iriver_encode(iname, oname, FALSE); + return 0; + } + /* open file */ file = fopen(iname,"rb"); if (!file) { -- cgit v1.2.3