Homebrew RELEASE NSPack - GUI for hacPack - make your own legal NSPs!

  • Thread starter Thread starter XorTroll
  • Start date Start date
  • Views Views 32,685
  • Replies Replies 51
  • Likes Likes 12
Thoon™
Hopefully in time for Christmas... adding a few "features" such as
- Keygen -> SDK -> min firmware version
- The ability to sign with your own private key pems for nca header (program) and acid.
View attachment 545429
Wow nice! You're adding new features?!
Could you by any chance add the most epic feature that me and some other lurkers here want for ages? That is: Change the title ID of a game (+ matching update/dlc) so that I can install games like MK8D or BotW multiple times next to each other and use different mods on each. I know this can be worked around with by mod manager but I don't like the approach of renaming/moving files around. Having a dedicated icon on the homescreen that launches a certain mod would be awesome!
 
Wow nice! You're adding new features?!
Could you by any chance add the most epic feature that me and some other lurkers here want for ages? That is: Change the title ID of a game (+ matching update/dlc) so that I can install games like MK8D or BotW multiple times next to each other and use different mods on each. I know this can be worked around with by mod manager but I don't like the approach of renaming/moving files around. Having a dedicated icon on the homescreen that launches a certain mod would be awesome!
That is the plan, as I have been doing this manually with hex editing to create game mod packages such as Legend of Linkle: Breath of the Wild I made some time back. Also useful if a particular mod only works on a particular update, ex. CTGP Deluxe. Unpack the update deltas with the base, add mod, modify some stuff in hex, repack with new title ID.
Stage 1, which will be this release just closely matches required firmware and SDK of the unpacked game (notes will need to taken for the repack to match)
I believe there are also some npdm items that need updating too, I just haven't gotten there yet. Finished up the code for implementing --sdkversion from hacpack. Also updated and tested a new switch for hacpack
--requiredsystemversion (I will probably shorten this switch) for meta nca that works.
Still need to work on private keys for signing. That feature may not make it into the GUI by Christmas, but it works in the hacPack CLI.
 
  • Like
Reactions: lordelan
That is the plan, as I have been doing this manually with hex editing to create game mod packages such as Legend of Linkle: Breath of the Wild I made some time back. Also useful if a particular mod only works on a particular update, ex. CTGP Deluxe. Unpack the update deltas with the base, add mod, modify some stuff in hex, repack with new title ID.
Stage 1, which will be this release just closely matches required firmware and SDK of the unpacked game (notes will need to taken for the repack to match)
I believe there are also some npdm items that need updating too, I just haven't gotten there yet. Finished up the code for implementing --sdkversion from hacpack. Also updated and tested a new switch for hacpack
--requiredsystemversion (I will probably shorten this switch) for meta nca that works.
Still need to work on private keys for signing. That feature may not make it into the GUI by Christmas, but it works in the hacPack CLI.
No rush with that but if it EVER comes, I'd be very happy!
 
So far, so good.
1766023153128.png

No rush with that but if it EVER comes, I'd be very happy!
NSPack v0.3CE
1st stage is complete, this just adds Firmware and SDK options.
Not sure if Keygen, Firmware, SDK relations are correct. Most info came from here.
I just used the RickRoll nsp floating around as its small and just a video player.
Built with this release, installed it, and launched just fine. Jammed out to a little Rick Astley for a moment.
I have not fully tested this yet with an extracted game, adding a mod, and repacking, but should work in theory.
Next step is to incorporate signing with user provided keys.
or maybe tutorial going from game dump to CTGPDX standalone.
 
Last edited by FlyingPoo,
So far, so good.
View attachment 546071

NSPack v0.3CE
1st stage is complete, this just adds Firmware and SDK options.
Not sure if Keygen, Firmware, SDK relations are correct. Most info came from here.
I just used the RickRoll nsp floating around as its small and just a video player.
Built with this release, installed it, and launched just fine. Jammed out to a little Rick Astley for a moment.
I have not fully tested this yet with an extracted game, adding a mod, and repacking, but should work in theory.
Next step is to incorporate signing with user provided keys.
or maybe tutorial going from game dump to CTGPDX standalone.
ripping games and/or merging horribly bloated updates sounds cool too
 
Unpacked it into folders using LayeredFS. Rebuilt it in NSP. When I launch it on the Switch, it gives an error: "The software was closed because an error occurred.". I installed the update on top, and it launches fine.
(186).png
 
  • Like
Reactions: Zerus
Here is a PowerShell script that uses hactool to combine Base and Update -> extracted. Good if you are changing titleIDs and want to combine a specific update before adding mods. It might help you @telecom. No idea where I found it, plan to incorporate it with other extracting options in the GUI in its own window. Probably wont get to it until after Christmas.

Bash:
# Check if arguments are provided
if ($args.Count -lt 2) {
    Write-Host "Usage: extract.ps1 <Base NSP> <Update NSP>"
    Write-Host "Example: extract.ps1 BotW.nsp BotWu.nsp"
    exit
}

# Assign arguments to variables
$basensp = $args[0]
$updatensp = $args[1]

# Create necessary directories
mkdir base, update, exefs, romfs -ErrorAction SilentlyContinue

# Extract base and update NSPs
.\hactool --disablekeywarns -t pfs0 $basensp --outdir base
.\hactool --disablekeywarns -t pfs0 $updatensp --outdir update

# Find base program NCA
$basenca = ""
Get-ChildItem base\*.nca | ForEach-Object {
    $type = .\hactool --disablekeywarns $_.FullName | Select-String -Pattern "(?<=Content Type:\s{23}).*" | ForEach-Object { $_.Matches.Value }
    Write-Output "$($_.FullName) $type"
    if ($type -eq "Program") { $basenca = $_.FullName }
}

# Find update program and control NCA
$updatenca = ""
$controlnca = ""
Get-ChildItem update\*.nca | ForEach-Object {
    $type = .\hactool --disablekeywarns $_.FullName | Select-String -Pattern "(?<=Content Type:\s{23}).*" | ForEach-Object { $_.Matches.Value }
    Write-Output "$($_.FullName) $type"
    if ($type -eq "Program") { $updatenca = $_.FullName }
    if ($type -eq "Control") { $controlnca = $_.FullName }
}

# Extract base and update NCAs into romfs and exefs
.\hactool --basenca $basenca $updatenca --romfsdir romfs --exefsdir exefs

Rules on Nintendo Switch TitleIDs:
  • Always 16-digit, typically starting with 0100
  • Base ID always ends in 000
  • Updates always end in 800
  • DLC is always the Base ID with the 4th to last nibble increased by 0x1 and the last three nibbles can be 000-FFF

Example with BotW
Base: 01007EF00011E000
Update: 01007EF00011E800
DLC1: 01007EF00011F001
DLC2: 01007EF00011F002

This is true across all titles.
If it helps, Base TitleID's 4th to last nibble is always even, DLC's 4th to last nibble is always odd.

If combining a Base with an Update, use a Base TitleID rule on the repack.
DLC, especially unlockers, require additional care if changing the TitleID. I had some weird experiences with BotW when I changed its TitleID. Tried a few different approaches: combining the data: it would show up in game, but menus would ask to purchase it. I ended up just repacking the DLC under what would become the new DLC TitleID (some changes in NPDM I believe were also necessary, but I dont recall).
 
Last edited by FlyingPoo,
It turns out the problem was with control.nacp.
- I repacked all files into NSP, including the original control.nacp, using the hacpack.exe console. Everything runs.
- I repacked all files into NSP, including control.nca (created with NSPack). Doesn't work.
- I repacked all files into NSP, including control.nca (the control.nacp was extracted from the .nca created with NSPack). Doesn't work.
- I repacked all files into NSP, including control.nca (the control.nacp created with the nacptool.exe console) using hacpack.exe. Everything runs.

Code:
Tools\nacptool.exe --create %GAME_TITLE% %AUTHOR% %VERSION_DEC% ^
  output ^
  --titleid="%tid%" ^
  --display-version="%DISPLAY_VERSION%" ^
  --isbn="ISBN" ^
  --application-error-code-category="Category" ^
  --supported-language="AmericanEnglish" ^
  --startup-mode=Default ^
  --application-type=Application ^
  --startup-user-account=0 ^
  --user-account-switch-lock=0 ^
  --user-account-save-data-size=0 ^
  --save-data-owner-id=0 ^
  --device-save-data-size=0 ^
  --add-on-content-type=0 ^
  --add-on-content-base-id=0 ^
  --runtime-add-on-content-install=Deny ^
  --logo-type=LicensedByNintendo ^
  --logo-handling=Auto ^
  --parental-control=0 ^
  --application-attribute=0 ^
  --runtime-parameter-delivery=Deny ^
  --bcat-delivery-cache-storage-size=0
 
Last edited by telecom,
Interesting. I extracted the base with the update deltas with the PowerShell script above and rebuilt it as base title ID (logo field not necessary), installed with DBI and it launched with no issues., I just have my own logo set I use. I did discover I need to expand the TitleID field 1 character as it only displays 15 of the 16 characters then line wraps only showing a 0 if using all 16 characters. Oops.
Edit: Updated release fixing Title ID field.

ionfurynspack-png.549040

20260102_234550.jpg
 

Attachments

  • IonFuryNSPack.png
    IonFuryNSPack.png
    1.3 MB · Views: 61
Last edited by FlyingPoo,
  • Like
Reactions: Zerus and lordelan
If the "Ask for a user account to launch" checkbox is disabled, an error appears when launching the game.

I tested everything on firmware 20.5.0.
Now I tried it on another device with a clean firmware version 19.0.1 and created a new user. The "Ask for a user account to launch" checkbox no longer affects the game's launch.
Strange...:mellow:
Post automatically merged:

The "Allow screenshots" checkbox does the opposite and prevents you from taking screenshots.
Post automatically merged:

Can you store more information in .nsxml? NCA assets (Keyset Files path), control NCA (Name, Author, Version), Program NCA (ExeFS, RomFS, logo paths)
 
Last edited by telecom,
  • Like
Reactions: lordelan
i made a forwarder for super mario sunshine and for some reason it crashes when i skip cutscenes by pressing the minus ( - )button. any idea what's causing this?

i also get an atmosphere crash v22.0.0|AMS 1.11.1|E
 
Last edited by Zerus,

Site & Scene News

Popular threads in this forum