summaryrefslogtreecommitdiffstats
path: root/utils/AMS/hacking/amsinfo.c
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2010-03-14 23:35:01 +0000
committerRafaël Carré <rafael.carre@gmail.com>2010-03-14 23:35:01 +0000
commite32f28b740c9bfef25a5ccbe961ea45e605f4d25 (patch)
treea0204b624efe9acaaefabc5b08dd1beb6694c3e4 /utils/AMS/hacking/amsinfo.c
parent63f0b2b8e9f71537da61c63932ad37e6ff511997 (diff)
downloadrockbox-e32f28b740c9bfef25a5ccbe961ea45e605f4d25.tar.gz
rockbox-e32f28b740c9bfef25a5ccbe961ea45e605f4d25.tar.bz2
rockbox-e32f28b740c9bfef25a5ccbe961ea45e605f4d25.zip
amsinfo: do not assume library blocks always have the same size
otg_functio is now correctly extracted of Clip+ firmware git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25188 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/AMS/hacking/amsinfo.c')
-rw-r--r--utils/AMS/hacking/amsinfo.c27
1 files changed, 2 insertions, 25 deletions
diff --git a/utils/AMS/hacking/amsinfo.c b/utils/AMS/hacking/amsinfo.c
index d3f03bc18a..ff92175e64 100644
--- a/utils/AMS/hacking/amsinfo.c
+++ b/utils/AMS/hacking/amsinfo.c
@@ -44,24 +44,6 @@ char BLUE[] = { 0x1b, 0x5b, 0x31, 0x3b, '3', '4', 0x6d, '\0' };
# define color(a)
#endif
-#define LIB_OFFSET 160 /* FIXME (see below) */
-/* The alignement of library blocks (in number of 0x200 bytes blocks)
- * alignement - md5sum - filename - model
- * 120 : fc9dd6116001b3e6a150b898f1b091f0 m200p-4.1.08A.bin M200
- * 128 : 82e3194310d1514e3bbcd06e84c4add3 m200p.bin Fuze
- * 160 : c12711342169c66e209540cd1f27cd26 m300f.bin CLIP
- *
- * Note : the size of library blocks is variable:
- *
- * For m200p-4.1.08A.bin it's always 0x1e000 blocks = 240 * 0x200
- *
- * For m200p.bin it can be 0x20000 (256*0x200) or 0x40000 (512*0x200)
- * (for "acp_decoder" and "sd_reload__" blocks)
- *
- * For m300f.bin it can be 0x28000 (320*0x200) or 0x14000 (160 * 0x200)
- *
- */
-
#define bug(...) do { fprintf(stderr,"ERROR: "__VA_ARGS__); exit(1); } while(0)
#define bugp(a) do { perror("ERROR: "a); exit(1); } while(0)
@@ -331,9 +313,7 @@ static void print_block(size_t off, type t)
break;
#endif
case LIB:
- s = LIB_OFFSET * 0x200;
- while(s < get32le(off+12))
- s <<= 1;
+ s = get32le(off+12);
color(RED);
printf("library block 0x%.6x\t->\t0x%.6x\t\"%s\"\n",
(unsigned int)s, (unsigned int)(off+s),
@@ -430,10 +410,7 @@ static size_t verify_block(size_t off)
if(ok) /* library block */
{
t = LIB;
- s = LIB_OFFSET * 0x200;
- while(s < get32le(off+12)) /* of course the minimum is the size
- * specified in the block header */
- s <<= 1;
+ s = get32le(off+12);
}
else
t = UNKNOWN;