1 #!/system/bin/sh 2 DEV=/dev/block/mmcblk0p16 3 4 CMD=$1 5 BASE=0x200000 6 BASE_MAIN=0xac00000 7 8 case $CMD in 9 cp1) 10 echo dump cp1 11 let addr=$BASE 12 echo $addr 13 hexdump -s $addr -n 4096 $DEV;; 14 cp2) 15 echo dump cp2 16 let addr=$BASE+0x200000 17 hexdump -s $addr -n 4096 $DEV;; 18 cp) 19 echo dump cp1 and cp2 20 let addr=$BASE 21 hexdump -s $addr -n 409 $DEV 22 let addr=$BASE+0x200000 23 hexdump -s $addr -n 4096 $DEV;; 24 cp1_all) 25 echo dump cp1 all 26 let addr=$BASE 27 hexdump -s $addr -n 20480 $DEV;; 28 cp2_all) 29 echo dump cp2 all 30 let addr=$BASE+0x200000 31 hexdump -s $addr -n 20480 $DEV;; 32 cp_all) 33 echo dump cp1 and cp2 all 34 let addr=$BASE 35 hexdump -s $addr -n 20480 $DEV 36 let addr=$BASE+0x200000 37 hexdump -s $addr -n 20480 $DEV;; 38 blk) 39 let addr=$BASE_MAIN+$2*0x200000+$3*0x1000 40 hexdump -s $addr -n 4096 $DEV 41 echo ;; 42 inode) 43 let addr=$BASE_MAIN+$2*0x200000+$3*0x1000 44 for i in `seq $3 511` 45 do 46 hexdump -s $addr -n 8 $DEV 47 let end=$addr+0x0ff0 48 hexdump -s $end -n 16 $DEV 49 let addr=$addr+0x1000 50 done 51 echo ;; 52 *) 53 let addr=$1*0x1000 54 let segno=$addr-$BASE_MAIN 55 let segno=$segno/0x200000 56 let off=$addr-$BASE_MAIN 57 let off=$off%0x200000/0x1000 58 echo $segno, $off 59 hexdump -s $addr -n 4096 $DEV 60 echo ;; 61 esac 62