# HG changeset patch # User Mychaela Falconia # Date 1686290829 0 # Node ID 12810ff4aa9240f57416d0e8df5d28718c2d086c # Parent acfe834e174f2efdd8face20b025c85bfac511f8 c1xx-analyze-image: initial version diff -r acfe834e174f -r 12810ff4aa92 sh/c1xx-analyze-image --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sh/c1xx-analyze-image Fri Jun 09 06:07:09 2023 +0000 @@ -0,0 +1,50 @@ +#!/bin/sh + +if [ $# != 1 ] +then + echo "usage: $0 flashdump.bin" 1>&2 + exit 1 +fi + +if [ ! -f "$1" ] +then + echo "Error: $1 does not exist or is not a regular file" 1>&2 + exit 1 +fi + +length=`wc -c $1 | cut -d ' ' -f 1` + +case "$length" in + 2097152) + echo 'Flash dump file size is 2 MiB' + echo 'Is it a small-flash C11x/12x phone?' + flash=2m + cal_offset=0x1FC000 + ;; + 4194304) + echo 'Flash dump file size is 4 MiB' + echo 'Possible Compal phones: C11x/12x, C139/140, SE J100' + flash=4m + cal_offset=0x3FC000 + ;; + 8388608) + echo 'Flash dump file size is 8 MiB' + echo 'Is it a Motorola C155/156 phone?' + flash=8m + cal_offset=0x7E0000 + ;; + *) + echo "Error: file length of $1 is not understood" 1>&2 + exit 1 +esac + +set -e + +echo 'Parsing for RF calibration records' +c1xx-calextr -a rfasc -b rfbin "$1" $cal_offset + +if [ ! -d rfbin/rx -o ! -d rfbin/tx ] +then + echo "Error: no RF calibration records found" 1>&2 + exit 1 +fi