summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBarry Wardell <rockbox@barrywardell.net>2007-03-20 22:18:35 +0000
committerBarry Wardell <rockbox@barrywardell.net>2007-03-20 22:18:35 +0000
commit7cd559dde0c5511edda6d0268233002cd8fc0bdc (patch)
treeddd58b490555f91489b256a40b02c26756983d35
parent9a9aebb99e7de9c4c2226eab341f947a88c7ae36 (diff)
downloadrockbox-7cd559dde0c5511edda6d0268233002cd8fc0bdc.tar.gz
rockbox-7cd559dde0c5511edda6d0268233002cd8fc0bdc.tar.bz2
rockbox-7cd559dde0c5511edda6d0268233002cd8fc0bdc.zip
Oops, the mi4 magic was being looked for in the wrong place when decrypting. Also decrease verbosity of PP bootloader a bit.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12865 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--bootloader/main-pp.c15
-rw-r--r--firmware/target/arm/crt0-pp.S2
-rwxr-xr-xtools/configure16
3 files changed, 20 insertions, 13 deletions
diff --git a/bootloader/main-pp.c b/bootloader/main-pp.c
index 0ed69d5181..2999c3e3ac 100644
--- a/bootloader/main-pp.c
+++ b/bootloader/main-pp.c
@@ -32,10 +32,17 @@
#include <string.h>
/* Locations and sizes in hidden partition on Sansa */
+#ifdef SANSA_E200
#define PPMI_SECTOR_OFFSET 1024
#define PPMI_SECTORS 1
#define MI4_HEADER_SECTORS 1
+#define NUM_PARTITIONS 2
+
+#else
#define MI4_HEADER_SIZE 0x200
+#define NUM_PARTITIONS 1
+
+#endif
/* mi4 header structure */
struct mi4header_t {
@@ -185,7 +192,7 @@ static int tea_find_key(struct mi4header_t *mi4header, int fd)
if(rc < 8 )
return EREAD_IMAGE_FAILED;
- printf("Trying key:");
+ printf("Searching for key:");
for (i=0; i < NUM_KEYS && (key_found<0) ; i++) {
key[0] = tea_keytable[i].key[0];
@@ -212,7 +219,7 @@ static int tea_find_key(struct mi4header_t *mi4header, int fd)
key_found = i;
printf("%s...found", tea_keytable[i].name);
} else {
- printf("%s...failed", tea_keytable[i].name);
+ /* printf("%s...failed", tea_keytable[i].name); */
}
}
@@ -382,7 +389,7 @@ int load_mi4(unsigned char* buf, char* firmware, unsigned int buffer_size)
printf("%s key used", tea_keytable[key_index].name);
/* Check decryption was successfull */
- if(le2int(&buf[mi4header.length-4]) != 0xaa55aa55)
+ if(le2int(&buf[mi4header.length-mi4header.plaintext-4]) != 0xaa55aa55)
{
return EREAD_IMAGE_FAILED;
}
@@ -508,7 +515,7 @@ void* main(void)
/* Just list the first 2 partitions since we don't have any devices yet
that have more than that */
- for(i=0; i<2; i++)
+ for(i=0; i<NUM_PARTITIONS; i++)
{
pinfo = disk_partinfo(i);
printf("Partition %d: 0x%02x %ld MB",
diff --git a/firmware/target/arm/crt0-pp.S b/firmware/target/arm/crt0-pp.S
index bbeace1b60..362d736b49 100644
--- a/firmware/target/arm/crt0-pp.S
+++ b/firmware/target/arm/crt0-pp.S
@@ -54,7 +54,7 @@ start:
b pad_skip
-.space 50*4 /* (more than enough) space for exception vectors */
+.space 60*4 /* (more than enough) space for exception vectors and mi4 magic */
pad_skip:
#ifdef SANSA_E200
diff --git a/tools/configure b/tools/configure
index a691c98d7f..2343f35105 100755
--- a/tools/configure
+++ b/tools/configure
@@ -1164,10 +1164,10 @@ EOF
target="-DIRIVER_H10"
memory=32 # always
arm7tdmicc
- tool="$rootdir/tools/scramble -add=h10"
+ tool="$rootdir/tools/scramble -mi4v3 -model=h10 -type=RBOS"
bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
- output="rockbox.h10"
+ output="rockbox.mi4"
appextra="recorder:gui"
archosrom=""
flash=""
@@ -1190,10 +1190,10 @@ EOF
target="-DIRIVER_H10_5GB"
memory=32 # always
arm7tdmicc
- tool="$rootdir/tools/scramble -add=h10_5gb"
+ tool="$rootdir/tools/scramble -mi4v2 -model=h105 -type=RBOS"
bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
- output="rockbox.h10"
+ output="rockbox.mi4"
appextra="recorder:gui"
archosrom=""
flash=""
@@ -1216,10 +1216,10 @@ EOF
target="-DSANSA_E200"
memory=32 # supposedly
arm7tdmicc
- tool="$rootdir/tools/scramble -add=e200"
+ tool="$rootdir/tools/scramble -mi4v3 -model=e200 -type=RBOS"
bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
- output="rockbox.e200"
+ output="rockbox.mi4"
appextra="recorder:gui"
archosrom=""
flash=""
@@ -1245,10 +1245,10 @@ EOF
target="-DSANSA_E200"
memory=32 # supposedly
arm7tdmicc
- tool="$rootdir/tools/scramble -add=e200"
+ tool="$rootdir/tools/scramble -mi4v3 -model=e20r -type=RBOS"
bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
- output="rockbox.e200"
+ output="rockbox.mi4"
appextra="recorder:gui"
archosrom=""
flash=""