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 /bootloader | |
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
Diffstat (limited to 'bootloader')
-rw-r--r-- | bootloader/main-pp.c | 15 |
1 files changed, 11 insertions, 4 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", |