That was easy

Just modified to check all NCA files, not just the biggest one. I should add a counter though, so it can tell you if all files are good or not, it does echo each NCA result.


echo Checking $1 SCRIPT_DIR=“$( cd “$( dirname “${BASH_SOURCE[0]}” )” >/dev/null && pwd )” TEMP_DIR=temp KEYS=~/.switch/prod.keys FILE_EXTENSION=“${1##*.}” CHECK_LOG=check.log BASE_NAME=$(basename “$1”)

pushd $SCRIPT_DIR &> /dev/null

if [ ! -f ./hactool ]; then echo echo echo No hactool binary found! echo You must place hactool binary to the script directory echo echo exit 1 fi

if [ ! -f $KEYS ]; then echo echo echo No $KEYS file found! echo Get your keys first! Use kezplez on Switch or google it! echo echo exit 1 fi

if [ ! -d $TEMP_DIR ]; then echo Creating temp directory… mkdir $TEMP_DIR &> /dev/null fi

if [ “$FILE_EXTENSION” = “nsp” ]; then echo Extracting nsp… ./hactool -k “$KEYS” -x –intype=pfs0 –pfs0dir=$TEMP_DIR “$1” &> /dev/null else echo Extracting xci… ./hactool -k “$KEYS” -txci –securedir=$TEMP_DIR “$1” &> /dev/null fi

if [ $? -eq 0 ]; then echo “Extracting finished!” else echo echo ———————————————————————— echo echo SOMETHING GONE WRONG! echo echo file is not Switch game or contain forbidden symbols echo rename your game file to simple name without special symbols echo echo ———————————————————————— echo exit 1 fi

NCAS=ls $TEMP_DIR/*.nca TOTAL_NCAS=0 GOOD_NCAS=0 while read -r line; do echo Checking $line… ./hactool -k “$KEYS” -y “$line” > $CHECK_LOG 2>/dev/null

if grep -Fq "Fixed-Key Signature (GOOD)" $CHECK_LOG; then
    (( GOOD_NCAS++ ))
    printf "$GREEN"
    printf "\n------------------------------------------------------------------------\n\n"
    printf "$BASE_NAME $line is GOOD!"
    printf "\n\n------------------------------------------------------------------------\n"
    printf "$RED"
    printf "\n------------------------------------------------------------------------\n\n"
    printf "$BASE_NAME $line is CORRUPTED!"
    printf "\n\n------------------------------------------------------------------------\n"
(( TOTAL_NCAS++ ))

done <<< “$NCAS” if (( GOOD_NCAS == TOTAL_NCAS )); then printf “$GREEN” printf “\n————————————————————————\n\n” printf “All $TOTAL_NCAS good.” printf “\n\n————————————————————————\n” else printf “$RED” printf “\n————————————————————————\n\n” printf “Only $GOOD_NCAS good.” printf “\n\n————————————————————————\n” fi echo -n Calculating md5… echo -en “\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b” if ! type “md5sum” &> /dev/null; then echo MD5: $(md5 -q “$1”) else echo MD5: $(md5sum “$1”) fi


echo Cleaning things up… rm -rf $TEMP_DIR rm $CHECK_LOG

popd &> /dev/null

There’s the modified script if you want it.

You can find the newest version here.