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
This commit is contained in:
Barry Wardell 2007-03-20 22:18:35 +00:00
parent 9a9aebb99e
commit 7cd559dde0
3 changed files with 20 additions and 13 deletions

View file

@ -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",

View file

@ -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

16
tools/configure vendored
View file

@ -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=""