Tuesday, February 15, 2011

Pure Siesta Flow #15

$ hd -n 112 Siesta_Flow_v1.6.dfu
00000000 4e 56 53 31 80 10 00 00 80 0f 04 00 00 00 00 00 |NVS1............|
00000010 4c 44 52 53 00 20 04 00 a0 45 02 00 00 00 00 00 |LDRS. .. E......|
00000020 4c 44 4c 4b 20 66 06 00 e0 23 00 00 00 00 00 00 |LDLK f..à#......|
00000030 4c 44 4c 5a c0 8a 06 00 de 0a 08 00 00 00 00 00 |LDLZÀ...Þ.......|
00000040 4c 4b 47 5a 30 97 0e 00 73 08 0a 00 00 00 00 00 |LKGZ0...s.......|
00000050 53 51 46 53 10 a1 18 00 00 10 27 00 00 00 00 00 |SQFS.¡....'.....|
00000060 46 52 45 45 10 b1 3f 00 f0 4e 02 00 00 00 00 00 |FREE.±?.ðN......|
00000070

$ NVS1_START=$((0x1080)) && echo $NVS1_START
4224

$ NVS1_LENGTH=$((0x040f80)) && echo $NVS1_LENGTH
266112

$ NVS1_END=$(($NVS1_START + $NVS1_LENGTH)) && echo $NVS1_END
270336

$ LDRS_START=$((0x042000)) && echo $LDRS_START
270336

$ LDRS_LENGTH=$((0x0245a0)) && echo $LDRS_LENGTH
148896

$ LDRS_END=$(($LDRS_START + $LDRS_LENGTH)) && echo $LDRS_END
419232

$ LDLK_START=$((0x066620)) && echo $LDLK_START
419360

$ LDLK_LENGTH=$((0x23e0)) && echo $LDLK_LENGTH
9184

$ LDLK_END=$(($LDLK_START + $LDLK_LENGTH)) && echo $LDLK_END
428544

$ LDLZ_START=$((0x068ac0)) && echo $LDLZ_START
428736

$ LDLZ_LENGTH=$((0x080ade)) && echo $LDLZ_LENGTH
527070

$ LDLZ_END=$(($LDLZ_START + $LDLZ_LENGTH)) && echo $LDLZ_END
955806

$ LKGZ_START=$((0x0e9730)) && echo $LKGZ_START
956208

$ LKGZ_LENGTH=$((0x0a0873)) && echo $LKGZ_LENGTH
657523

$ LKGZ_END=$(($LKGZ_START + $LKGZ_LENGTH)) && echo $LKGZ_END
1613731

$ SQFS_START=$((0x18a110)) && echo $SQFS_START
1614096

$ SQFS_LENGTH=$((0x271000)) && echo $SQFS_LENGTH
2560000

$ SQFS_END=$(($SQFS_START + $SQFS_LENGTH)) && echo $SQFS_END
4174096

$ FREE_START=$((0x3fb110)) && echo $FREE_START
4174096

$ FREE_LENGTH=$((0x024ef0)) && echo $FREE_LENGTH
151280

$ FREE_END=$(($FREE_START + $FREE_LENGTH)) && echo $FREE_END
4325376

$ FILE_LENGTH=$(du -b Siesta_Flow_v1.6.dfu | cut -f1) && echo $FILE_LENGTH
3906160

$ DFUSIG_LENGTH=16 && echo $DFUSIG_LENGTH
16

$ hd Siesta_Flow_v1.6.dfu | awk '/hsqs/ {print $1}'
00123b70

$ SQFS_START_REAL=$((0x123b70)) && echo $SQFS_START_REAL
1194864

$ echo $(($SQFS_START - $SQFS_START_REAL))
419232

$ echo $(($FREE_END - $FILE_LENGTH + $DFUSIG_LENGTH))
419232

$ echo $LDRS_END
419232

$ OFFSET=419232 && echo $OFFSET
419232

$ LDLK_START_REAL=$(($LDLK_START - $OFFSET)) && echo $LDLK_START_REAL
128

$ LDLZ_START_REAL=$(($LDLZ_START - $OFFSET)) && echo $LDLZ_START_REAL
9504

$ LKGZ_START_REAL=$(($LKGZ_START - $OFFSET)) && echo $LKGZ_START_REAL
536976

$ FREE_START_REAL=$(($FREE_START - $OFFSET)) && echo $FREE_START_REAL
3754864

$ dd if=Siesta_Flow_v1.6.dfu ibs=1 skip=$LDLK_START_REAL count=32 2> /dev/null | file -
/dev/stdin: Hitachi SH big-endian COFF object, not stripped

$ dd if=Siesta_Flow_v1.6.dfu of=Siesta_Flow_v1.6.ldlk ibs=1 skip=$LDLK_START_REAL count=$LDLK_LENGTH
9184+0 records in
17+1 records out
9184 bytes (9.2 kB) copied, 0.0031439 s, 2.9 MB/s

$ dd if=Siesta_Flow_v1.6.dfu ibs=1 skip=$LDLZ_START_REAL count=32 2> /dev/null | file -
/dev/stdin: data

$ dd if=Siesta_Flow_v1.6.dfu of=Siesta_Flow_v1.6.ldlz ibs=1 skip=$LDLZ_START_REAL count=$LDLZ_LENGTH
527070+0 records in
1029+1 records out
527070 bytes (527 kB) copied, 0.192992 s, 2.7 MB/s

$ dd if=Siesta_Flow_v1.6.dfu ibs=1 skip=$LKGZ_START_REAL count=32 2> /dev/null | file -/dev/stdin: data

$ dd if=Siesta_Flow_v1.6.dfu of=Siesta_Flow_v1.6.lkgz ibs=1 skip=$LKGZ_START_REAL count=$LKGZ_LENGTH
657523+0 records in
1284+1 records out
657523 bytes (658 kB) copied, 0.246891 s, 2.7 MB/s

$ dd if=Siesta_Flow_v1.6.dfu of=Siesta_Flow_v1.6.dfusig ibs=1 skip=$(($FILE_LENGTH - $DFUSIG_LENGTH)) count=$DFUSIG_LENGTH
16+0 records in
0+1 records out
16 bytes (16 B) copied, 5.7253e-05 s, 279 kB/s

No comments:

Post a Comment