summaryrefslogtreecommitdiffstats
path: root/utils/AMS/hacking
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2008-09-29 09:27:35 +0000
committerDave Chapman <dave@dchapman.com>2008-09-29 09:27:35 +0000
commit0326055f9153f6635623f9698c5f1186be5e7c4a (patch)
treec92caba34368716d8ddc8ef3c59aecf943ce9eb4 /utils/AMS/hacking
parent11ef4ce1f9500ca1bd5651bc0e0dc49bf0dfbd2d (diff)
downloadrockbox-0326055f9153f6635623f9698c5f1186be5e7c4a.tar.gz
rockbox-0326055f9153f6635623f9698c5f1186be5e7c4a.tar.bz2
rockbox-0326055f9153f6635623f9698c5f1186be5e7c4a.zip
We don't know how to increase the firmware size, so abort instead of creating a bricking firmware. Suggested by Rafaël Carré (funman).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18663 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/AMS/hacking')
-rw-r--r--utils/AMS/hacking/mkamsboot.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/utils/AMS/hacking/mkamsboot.c b/utils/AMS/hacking/mkamsboot.c
index a6e4e01532..30ca66e43b 100644
--- a/utils/AMS/hacking/mkamsboot.c
+++ b/utils/AMS/hacking/mkamsboot.c
@@ -195,17 +195,13 @@ int main(int argc, char* argv[])
fprintf(stderr,"New total size of firmware - 0x%08x\n",new_length);
if (firmware_paddedsize != new_paddedsize) {
- /* Move everything after the firmare block "bootloader_size"
- bytes forward to make room for the bootloader */
+ /* We don't know how to safely increase the firmware size, so abort */
- fprintf(stderr,"Calling memmove(buf + 0x%08x,buf + 0x%08x,0x%08x)\n",
- 0x400 + new_paddedsize,
- 0x400 + firmware_paddedsize,
- (int)len - firmware_paddedsize);
+ fprintf(stderr,
+ "[ERR] Bootloader too large (%d bytes - %d bytes available), aborting.\n",
+ bootloader_size, firmware_paddedsize - firmware_size);
- memmove(buf + 0x400 + new_paddedsize,
- buf + 0x400 + firmware_paddedsize,
- len - firmware_paddedsize);
+ return 1;
}
ldr = get_uint32le(&buf[0x400]);