summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2003-10-27 18:04:28 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2003-10-27 18:04:28 +0000
commited11bd3281bdd84bac19b0758d1bf357bc043e82 (patch)
treea7b13d84dcc697f0f85d908c79cb73d458f5f010 /tools
parent266f411ff3f101392fe7f1780a9ca1ec86165417 (diff)
downloadrockbox-ed11bd3281bdd84bac19b0758d1bf357bc043e82.tar.gz
rockbox-ed11bd3281bdd84bac19b0758d1bf357bc043e82.tar.bz2
rockbox-ed11bd3281bdd84bac19b0758d1bf357bc043e82.zip
Updated the scramble/descramble for the V2 recorder
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3992 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools')
-rw-r--r--tools/descramble.c4
-rw-r--r--tools/scramble.c15
2 files changed, 14 insertions, 5 deletions
diff --git a/tools/descramble.c b/tools/descramble.c
index 2469db0d21..d28e18a951 100644
--- a/tools/descramble.c
+++ b/tools/descramble.c
@@ -30,11 +30,11 @@ int main (int argc, char** argv)
FILE* file;
if (argc < 3) {
- printf("usage: %s [-fm] <input file> <output file>\n",argv[0]);
+ printf("usage: %s [-fm] [-v2] <input file> <output file>\n",argv[0]);
return -1;
}
- if (argv[1][0] == '-') { /* assume any parameter is -fm :-) */
+ if (!strcmp(argv[1], "-fm") || !strcmp(argv[1], "-v2")) {
headerlen = 24;
iname = argv[2];
oname = argv[3];
diff --git a/tools/scramble.c b/tools/scramble.c
index ca3cea5a58..95709c0618 100644
--- a/tools/scramble.c
+++ b/tools/scramble.c
@@ -30,16 +30,25 @@ int main (int argc, char** argv)
unsigned char *oname = argv[2];
int headerlen = 6;
FILE* file;
+ int version;
if (argc < 3) {
- printf("usage: %s [-fm] <input file> <output file>\n",argv[0]);
+ printf("usage: %s [-fm] [-v2] <input file> <output file>\n",argv[0]);
return -1;
}
- if (argv[1][0] == '-') { /* assume any parameter is -fm :-) */
+ if(!strcmp(argv[1], "-fm")) {
headerlen = 24;
iname = argv[2];
oname = argv[3];
+ version = 4;
+ }
+
+ if(!strcmp(argv[1], "-v2")) {
+ headerlen = 24;
+ iname = argv[2];
+ oname = argv[3];
+ version = 2;
}
/* open file */
@@ -106,7 +115,7 @@ int main (int argc, char** argv)
header[6] = (crc >> 8) & 0xff;
header[7] = crc & 0xff;
- header[11] = 4; /* ??? */
+ header[11] = version;
header[15] = headerlen; /* really? */