diff options
author | Barry Wardell <rockbox@barrywardell.net> | 2007-03-20 22:18:35 +0000 |
---|---|---|
committer | Barry Wardell <rockbox@barrywardell.net> | 2007-03-20 22:18:35 +0000 |
commit | 7cd559dde0c5511edda6d0268233002cd8fc0bdc (patch) | |
tree | ddd58b490555f91489b256a40b02c26756983d35 | |
parent | 9a9aebb99e7de9c4c2226eab341f947a88c7ae36 (diff) | |
download | rockbox-7cd559dde0c5511edda6d0268233002cd8fc0bdc.tar.gz 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.c | 15 | ||||
-rw-r--r-- | firmware/target/arm/crt0-pp.S | 2 | ||||
-rwxr-xr-x | tools/configure | 16 |
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 @@ | |||
32 | #include <string.h> | 32 | #include <string.h> |
33 | 33 | ||
34 | /* Locations and sizes in hidden partition on Sansa */ | 34 | /* Locations and sizes in hidden partition on Sansa */ |
35 | #ifdef SANSA_E200 | ||
35 | #define PPMI_SECTOR_OFFSET 1024 | 36 | #define PPMI_SECTOR_OFFSET 1024 |
36 | #define PPMI_SECTORS 1 | 37 | #define PPMI_SECTORS 1 |
37 | #define MI4_HEADER_SECTORS 1 | 38 | #define MI4_HEADER_SECTORS 1 |
39 | #define NUM_PARTITIONS 2 | ||
40 | |||
41 | #else | ||
38 | #define MI4_HEADER_SIZE 0x200 | 42 | #define MI4_HEADER_SIZE 0x200 |
43 | #define NUM_PARTITIONS 1 | ||
44 | |||
45 | #endif | ||
39 | 46 | ||
40 | /* mi4 header structure */ | 47 | /* mi4 header structure */ |
41 | struct mi4header_t { | 48 | struct mi4header_t { |
@@ -185,7 +192,7 @@ static int tea_find_key(struct mi4header_t *mi4header, int fd) | |||
185 | if(rc < 8 ) | 192 | if(rc < 8 ) |
186 | return EREAD_IMAGE_FAILED; | 193 | return EREAD_IMAGE_FAILED; |
187 | 194 | ||
188 | printf("Trying key:"); | 195 | printf("Searching for key:"); |
189 | 196 | ||
190 | for (i=0; i < NUM_KEYS && (key_found<0) ; i++) { | 197 | for (i=0; i < NUM_KEYS && (key_found<0) ; i++) { |
191 | key[0] = tea_keytable[i].key[0]; | 198 | key[0] = tea_keytable[i].key[0]; |
@@ -212,7 +219,7 @@ static int tea_find_key(struct mi4header_t *mi4header, int fd) | |||
212 | key_found = i; | 219 | key_found = i; |
213 | printf("%s...found", tea_keytable[i].name); | 220 | printf("%s...found", tea_keytable[i].name); |
214 | } else { | 221 | } else { |
215 | printf("%s...failed", tea_keytable[i].name); | 222 | /* printf("%s...failed", tea_keytable[i].name); */ |
216 | } | 223 | } |
217 | } | 224 | } |
218 | 225 | ||
@@ -382,7 +389,7 @@ int load_mi4(unsigned char* buf, char* firmware, unsigned int buffer_size) | |||
382 | printf("%s key used", tea_keytable[key_index].name); | 389 | printf("%s key used", tea_keytable[key_index].name); |
383 | 390 | ||
384 | /* Check decryption was successfull */ | 391 | /* Check decryption was successfull */ |
385 | if(le2int(&buf[mi4header.length-4]) != 0xaa55aa55) | 392 | if(le2int(&buf[mi4header.length-mi4header.plaintext-4]) != 0xaa55aa55) |
386 | { | 393 | { |
387 | return EREAD_IMAGE_FAILED; | 394 | return EREAD_IMAGE_FAILED; |
388 | } | 395 | } |
@@ -508,7 +515,7 @@ void* main(void) | |||
508 | 515 | ||
509 | /* Just list the first 2 partitions since we don't have any devices yet | 516 | /* Just list the first 2 partitions since we don't have any devices yet |
510 | that have more than that */ | 517 | that have more than that */ |
511 | for(i=0; i<2; i++) | 518 | for(i=0; i<NUM_PARTITIONS; i++) |
512 | { | 519 | { |
513 | pinfo = disk_partinfo(i); | 520 | pinfo = disk_partinfo(i); |
514 | printf("Partition %d: 0x%02x %ld MB", | 521 | 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: | |||
54 | 54 | ||
55 | b pad_skip | 55 | b pad_skip |
56 | 56 | ||
57 | .space 50*4 /* (more than enough) space for exception vectors */ | 57 | .space 60*4 /* (more than enough) space for exception vectors and mi4 magic */ |
58 | 58 | ||
59 | pad_skip: | 59 | pad_skip: |
60 | #ifdef SANSA_E200 | 60 | #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 | |||
1164 | target="-DIRIVER_H10" | 1164 | target="-DIRIVER_H10" |
1165 | memory=32 # always | 1165 | memory=32 # always |
1166 | arm7tdmicc | 1166 | arm7tdmicc |
1167 | tool="$rootdir/tools/scramble -add=h10" | 1167 | tool="$rootdir/tools/scramble -mi4v3 -model=h10 -type=RBOS" |
1168 | bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" | 1168 | bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" |
1169 | bmp2rb_native="$rootdir/tools/bmp2rb -f 4" | 1169 | bmp2rb_native="$rootdir/tools/bmp2rb -f 4" |
1170 | output="rockbox.h10" | 1170 | output="rockbox.mi4" |
1171 | appextra="recorder:gui" | 1171 | appextra="recorder:gui" |
1172 | archosrom="" | 1172 | archosrom="" |
1173 | flash="" | 1173 | flash="" |
@@ -1190,10 +1190,10 @@ EOF | |||
1190 | target="-DIRIVER_H10_5GB" | 1190 | target="-DIRIVER_H10_5GB" |
1191 | memory=32 # always | 1191 | memory=32 # always |
1192 | arm7tdmicc | 1192 | arm7tdmicc |
1193 | tool="$rootdir/tools/scramble -add=h10_5gb" | 1193 | tool="$rootdir/tools/scramble -mi4v2 -model=h105 -type=RBOS" |
1194 | bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" | 1194 | bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" |
1195 | bmp2rb_native="$rootdir/tools/bmp2rb -f 5" | 1195 | bmp2rb_native="$rootdir/tools/bmp2rb -f 5" |
1196 | output="rockbox.h10" | 1196 | output="rockbox.mi4" |
1197 | appextra="recorder:gui" | 1197 | appextra="recorder:gui" |
1198 | archosrom="" | 1198 | archosrom="" |
1199 | flash="" | 1199 | flash="" |
@@ -1216,10 +1216,10 @@ EOF | |||
1216 | target="-DSANSA_E200" | 1216 | target="-DSANSA_E200" |
1217 | memory=32 # supposedly | 1217 | memory=32 # supposedly |
1218 | arm7tdmicc | 1218 | arm7tdmicc |
1219 | tool="$rootdir/tools/scramble -add=e200" | 1219 | tool="$rootdir/tools/scramble -mi4v3 -model=e200 -type=RBOS" |
1220 | bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" | 1220 | bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" |
1221 | bmp2rb_native="$rootdir/tools/bmp2rb -f 4" | 1221 | bmp2rb_native="$rootdir/tools/bmp2rb -f 4" |
1222 | output="rockbox.e200" | 1222 | output="rockbox.mi4" |
1223 | appextra="recorder:gui" | 1223 | appextra="recorder:gui" |
1224 | archosrom="" | 1224 | archosrom="" |
1225 | flash="" | 1225 | flash="" |
@@ -1245,10 +1245,10 @@ EOF | |||
1245 | target="-DSANSA_E200" | 1245 | target="-DSANSA_E200" |
1246 | memory=32 # supposedly | 1246 | memory=32 # supposedly |
1247 | arm7tdmicc | 1247 | arm7tdmicc |
1248 | tool="$rootdir/tools/scramble -add=e200" | 1248 | tool="$rootdir/tools/scramble -mi4v3 -model=e20r -type=RBOS" |
1249 | bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" | 1249 | bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" |
1250 | bmp2rb_native="$rootdir/tools/bmp2rb -f 4" | 1250 | bmp2rb_native="$rootdir/tools/bmp2rb -f 4" |
1251 | output="rockbox.e200" | 1251 | output="rockbox.mi4" |
1252 | appextra="recorder:gui" | 1252 | appextra="recorder:gui" |
1253 | archosrom="" | 1253 | archosrom="" |
1254 | flash="" | 1254 | flash="" |