Modified launcher TMD wasn't written, and HWInfo reading was broken.

This commit is contained in:
Lillian Skinner 2026-03-28 13:17:56 -04:00
parent 647ae53632
commit d06223ef97

View File

@ -93,14 +93,28 @@ export MTOOLSRC=./mtoolsrc
# The status variable will contain the region byte of the launcher TID. # The status variable will contain the region byte of the launcher TID.
# #
# Probably not a bad idea to confirm that the TID is for an known region. # Probably not a bad idea to confirm that the TID is for an known region.
HWINFO_STATUS=$(python hwinfo.py --consoleid 084109149469a108 --hwinfo TJH101232355.dat verify)
if [[ "$2" == "" ]]; then nogba_consoleid=$(echo $3 | tac -rs .. | echo "$(tr -d '\n')")
echo ">>> Region not found! Setting as 'ALL'." python hwinfo.py --consoleid $nogba_consoleid --hwinfo $2 verify
echo ">>> Factory firmware will be used." if [[ "$2" != "" ]]; then
REGION_CODE="ALL" if [[ "$CONSOLE_SIGNING" == "dev" ]]; then
else HWINFO_STATUS=$(python hwinfo.py --consoleid $nogba_consoleid --hwinfo $2 --dev verify)
else
HWINFO_STATUS=$(python hwinfo.py --consoleid $nogba_consoleid --hwinfo $2 verify)
fi
if [[ "$HWINFO_STATUS" == "Signature is valid" ]] && [[ "$2" != "" ]]; then
REGION_CODE=$(xxd -p -s 160 -l 1 "$2") REGION_CODE=$(xxd -p -s 160 -l 1 "$2")
echo ">>> Region is $REGION_CODE" echo ">>> Region is $REGION_CODE"
else
echo ">>> HWInfo is bad, so region was not found! Setting as ALL."
echo ">>> Factory firmware will be used."
REGION_CODE="ALL"
fi
else
echo ">>> HWInfo is bad, so region was not found! Setting as ALL."
echo ">>> Factory firmware will be used."
REGION_CODE="ALL"
fi fi
# Make system folders # Make system folders
@ -153,8 +167,8 @@ while IFS= read -r FILE; do
# This is only needed for region specific firmware. Since ALL/HNAA has the backup unlaunch as a TMD, it will automatically trigger. # This is only needed for region specific firmware. Since ALL/HNAA has the backup unlaunch as a TMD, it will automatically trigger.
if [[ "$FILE" == *"00030017"* ]] && [[ "$FILE" == *"title.tmd" ]]; then if [[ "$FILE" == *"00030017"* ]] && [[ "$FILE" == *"title.tmd" ]]; then
cp "./donor/$CONSOLE_SIGNING/software/$FILE" "./tmp.tmd" cp "./donor/$CONSOLE_SIGNING/software/$FILE" "./tmp.tmd"
echo "47" | dd of="./tmp.tmd" bs=1 seek=400 conv=notrunc status=none printf "G" | dd of="./tmp.tmd" bs=1 seek=400 conv=notrunc status=none
mcopy -D o "./tmd.tmd" "d:/$FILE" mcopy -D o "./tmp.tmd" "d:/$FILE"
else else
mcopy -D o "./donor/$CONSOLE_SIGNING/software/$FILE" "d:/$FILE" mcopy -D o "./donor/$CONSOLE_SIGNING/software/$FILE" "d:/$FILE"
fi fi
@ -169,10 +183,10 @@ while IFS= read -r FILE; do
echo ">>> Writing ticket..." echo ">>> Writing ticket..."
# Encrypt ticket to console. # Encrypt ticket to console.
./twltool syscrypt --consoleid $3 --in "./donor/$CONSOLE_SIGNING/software/$FILE" --out "./tmp.tik" --encrypt ./twltool syscrypt --consoleid $3 --in "./donor/$CONSOLE_SIGNING/software/$FILE" --out "./tmp.tik" --encrypt
mcopy "./tmp.tik" "d:/$FILE" mcopy -D o "./tmp.tik" "d:/$FILE"
else else
echo ">>> Moving title datas..." echo ">>> Moving title datas..."
mcopy "./donor/$CONSOLE_SIGNING/software/$FILE" "d:/$FILE" mcopy -D o "./donor/$CONSOLE_SIGNING/software/$FILE" "d:/$FILE"
fi fi
done < "./donor/$CONSOLE_SIGNING/software/ALL.txt" done < "./donor/$CONSOLE_SIGNING/software/ALL.txt"
@ -180,13 +194,6 @@ done < "./donor/$CONSOLE_SIGNING/software/ALL.txt"
makemdirs "title/00030017/484e4141/content/title.tmd" "d:" makemdirs "title/00030017/484e4141/content/title.tmd" "d:"
mcopy -D o "./donor/hb/HNAALaunch.tmd" "d:/title/00030017/484e4141/content/title.tmd" mcopy -D o "./donor/hb/HNAALaunch.tmd" "d:/title/00030017/484e4141/content/title.tmd"
nogba_consoleid=$(echo $3 | tac -rs .. | echo "$(tr -d '\n')")
if [[ "$CONSOLE_SIGNING" == "dev" ]]; then
HWINFO_STATUS=$(python hwinfo.py --consoleid $nogba_consoleid --hwinfo $2 --dev verify)
else
HWINFO_STATUS=$(python hwinfo.py --consoleid $nogba_consoleid --hwinfo $2 verify)
fi
if [[ "$HWINFO_STATUS" == "Signature is invalid" ]] || [[ "$2" == "" ]]; then if [[ "$HWINFO_STATUS" == "Signature is invalid" ]] || [[ "$2" == "" ]]; then
echo ">>> HWInfo is bad! HNAA unlaunch will be needed." echo ">>> HWInfo is bad! HNAA unlaunch will be needed."
else else