Skip to content

Instantly share code, notes, and snippets.

@john-peterson
Last active July 2, 2023 20:34
Show Gist options
  • Save john-peterson/064c75803def76c88160aea903084408 to your computer and use it in GitHub Desktop.
Save john-peterson/064c75803def76c88160aea903084408 to your computer and use it in GitHub Desktop.
Merge base and update NSP into a single file. We used to call it slipstream when we used windows
mkdir .switch base update exefs romfs nca nsp
basensp=diablo3.nsp
updatensp=diablo3u.nsp
cp .local/share/yuzu/keys/prod.keys .switch/
sed 's/|[^|]*$//' .local/share/yuzu/keys/title.keys | sed 's/|/=/' > .switch/title.keys
hactool -t pfs0 $basensp --outdir base
hactool -t pfs0 $updatensp --outdir update
for i in base/*.nca; do type=$(hactool --disablekeywarns $i | grep -oP "(?<=Content Type:\s{23}).*"); echo $i $type; if [ $type == "Program" ]; then basenca=$i; fi; done
for i in update/*.nca; do type=$(hactool --disablekeywarns $i | grep -oP "(?<=Content Type:\s{23}).*"); echo $i $type; if [ $type == "Program" ]; then updatenca=$i; elif [ $type == "Control" ]; then controlnca=$i; fi; done
# parse Title ID from base program NCA
titleid=$(hactool --disablekeywarns $basenca | grep -oP "(?<=Title ID:\s{27}).*")
# extract base and update NCAs into romfs end exefs
hactool --basenca $basenca $updatenca --romfsdir romfs --exefsdir exefs
# pack romfs and exefs into one NCA
hacpack --type nca --ncatype program --plaintext --exefsdir=exefs --romfsdir romfs --titleid $titleid --outdir nca
patchednca=$(ls nca)
# generate meta NCA from patched NCA and control NCA
hacpack --type="nca" --ncatype="meta" --titletype="application" --programnca="nca/$patchednca" --controlnca="$controlnca" --titleid="$titleid" --outdir="nca"
# pack all three NCAs into an NSP
hacpack --type="nsp" --ncadir="nca" --titleid="$titleid" --outdir="nsp"
@john-peterson
Copy link
Author

./yuzu-mainline-20230623-3a991f3ae.AppImage -f -g /home/dev/diablo3c.nsp
Unhandled SIGSEGV at rip 0x00000000008d4023
Segmentation fault (core dumped)

SOMEHOW I suspected that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment