summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2004-03-17 23:43:42 +0000
committerBjörn Stenberg <bjorn@haxx.se>2004-03-17 23:43:42 +0000
commit452702dac155df9a6929ad229e778dc69c8727c4 (patch)
tree8c9cd201e03906bd0ed2219960f8057fe13a7a55 /tools
parentc5067bf5ac854f4884eeb7c92df60ebbcc303dd0 (diff)
downloadrockbox-452702dac155df9a6929ad229e778dc69c8727c4.tar.gz
rockbox-452702dac155df9a6929ad229e778dc69c8727c4.tar.bz2
rockbox-452702dac155df9a6929ad229e778dc69c8727c4.zip
Multimedia scrambling was wrong: Checksum is for xor:ed data
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4401 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools')
-rw-r--r--tools/scramble.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/scramble.c b/tools/scramble.c
index 8e3f7395a5..712f8ff728 100644
--- a/tools/scramble.c
+++ b/tools/scramble.c
@@ -187,14 +187,14 @@ int main (int argc, char** argv)
{
int xorlen = strlen(xorstring);
- /* calculate checksum */
- for (i=0; i<slen; i++)
- crc += outbuf[i];
-
/* xor data */
for (i=0; i<slen; i++)
outbuf[i] ^= xorstring[i & (xorlen-1)];
+ /* calculate checksum */
+ for (i=0; i<slen; i++)
+ crc += outbuf[i];
+
header[0] = header[2] = 'Z';
header[1] = header[3] = version;
int2le(length, &header[4]);