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