You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trezor-firmware/firmware-fingerprint.sh

19 lines
322 B

#!/bin/bash
set -e
if [ -z "$1" ]; then
echo "Please provide filename as argument"
exit 1
fi
MAGIC=`head -c +4 $1`
if [ "x$MAGIC" != "xTRZR" ]; then
echo "Missing magic characters 'TRZR', invalid firmware"
exit 1
fi
echo "---------------------"
echo "Firmware fingerprint:"
tail -c +257 $1 | sha256sum