I found a need for hactoolnet recently and struggled with the command line a bit until I got it, figure I post it here for future reference. A prior warning here, any modifications to the Nintendo Switch partition and any files within may result in data corruption, the worst case may be bricking the Switch. Now that we are aware of the risk, before attempting any of the steps below, make sure you have a good NAND backup as well as back up of the save files.
# 1. Read the save file from the User partition (e.g. User\save\000000000000000a). Note the CMAC Signature line is FAIL because we have not provided the proper key to verify its signature yet hactoolnet.exe -t save 000000000000000a
# 2. Extract the save file with the proper key file (-t keys.txt). The key file essentially is a copy of the prod.keys and title.keys combined if you have backed it up with Lockpick_RCM hactoolnet.exe -k keys.txt -t save --outdir output_folder 000000000000000a
# 3. Repack the extracted directory and sign it with the Switch's device key you like to transfer to. It needs an actual save file (e.g. 000000000000000a) to overwrite to, that's where it was confusing for me hactoolnet.exe -k keys.txt --sign --repack .\output_folder -t save 000000000000000a
# 4. Verify if the repacked/signed save file with the same key as in the last step. It should have "CMAC Signature (GOOD)" instead of "CMAC Signature (FAIL)" hactoolnet.exe -k keys.txt -t save 000000000000000a
Now we can put the save file (e.g. 000000000000000a) back to the User partition (e.g. User\save\000000000000000a) now. If we are putting in on a different Switch, just make sure to match the file name which you will overwrite.
Source
[1] Search in GBAtemp for "Edit OFW clean Switch save data from NAND backup/restoring via Fusee Gelee payloads", the author laid out a very detailed instruction and example for hactoolnet
LibHac is a .NET Framework and .NET Core library for reading and editing file formats used by the Nintendo Switch.
Supported formats
NCA
XCI
NAX0
PFS0/HFS0/NSP
RomFS
Save file
Package1
Package2
INI1/KIP1
CNMT
NACP
Ticket
PRODINFO
Switch NAND and SD card
Additional features
Save file editing and signing
PFS0 creation
Switch key derivation
Integrity verification of NCA, XCI, etc.
Personalized title key reading
Read, parse and display information about a Switch NAND or SD card
Extract NCA, RomFS and other formats directly from an SD card or NAND, including patched titles
And more!
hactoolnet
Hactoolnet is a tool that uses LibHac for viewing and extracting data from common Nintendo Switch file formats. It partially mimics hactool's interface.
Features
Dump the container formats that LibHac supports
A progress bar!
Save file signing
Dump RomFS directly from an XCI or SD card
Dump SD card titles as NSP files
Verify the integrity of all titles on a Switch SD card
Switch key derivation
Automatic integrity verification of NCA, XCI, etc.
Give information about the titles and applications on a Switch NAND or SD card
Extract NCA, RomFS and other formats directly from an SD card or NAND, including patched titles
Sony made a shocking announcement today, revealing that the company plans to move away from physical game releases in the future. Citing claims of how the industry is...
After much speculation, a lot of which being caused by dbrand's unceremonious reveal of their Companion Cube casing, the Steam Machine is finally available to order...
Nintendo's expected Summer showcase is here, offering up plenty of new announcements and exciting reveals. Let's see what they have in store in the latest Nintendo...
What once seemed like a far off dream, and after many, many community restarts throughout the years, the elusive Mother 1 / EarthBound Beginnings Remake, which is a...
Since being decompiled Super Mario 64 has seen a considerable amount of interest. We've had multiple PC ports, but the efforts beyond that are really astounding. It's...
Remember when you could get an Xbox Series S for $300? Those were the days. Microsoft has today announced the latest in their console price hikes, seeing their...
Happy June 15th! Well, this one was close enough. Atmosphere has been updated to add support for the latest Nintendo Switch firmware, 22.5.0. This means all of you...
The delays may be behind us, but the news isn't all good for Grand Theft Auto VI. Rockstar have today announced that pre-orders for the game will go live tomorrow, on...
Following an investigation over misleading commercial practices, today Nintendo has been imposed a fine of 35 million euros related to the controller malfunctions...
After much speculation and rumour, the fabled Nintendo Direct is upon us. Set to go live tomorrow, the 9th of June, at 3pm in the UK, it'll feature 50 minutes of...
Sony made a shocking announcement today, revealing that the company plans to move away from physical game releases in the future. Citing claims of how the industry is...
After much speculation, a lot of which being caused by dbrand's unceremonious reveal of their Companion Cube casing, the Steam Machine is finally available to order...
The delays may be behind us, but the news isn't all good for Grand Theft Auto VI. Rockstar have today announced that pre-orders for the game will go live tomorrow, on...
Remember when you could get an Xbox Series S for $300? Those were the days. Microsoft has today announced the latest in their console price hikes, seeing their...
Nintendo's expected Summer showcase is here, offering up plenty of new announcements and exciting reveals. Let's see what they have in store in the latest Nintendo...
With rumours circulating about a Nintendo Direct in the coming days and weeks, fans are left speculating and hoping as to what might be included. At the centre of all...
After much speculation and rumour, the fabled Nintendo Direct is upon us. Set to go live tomorrow, the 9th of June, at 3pm in the UK, it'll feature 50 minutes of...
Following an investigation over misleading commercial practices, today Nintendo has been imposed a fine of 35 million euros related to the controller malfunctions...
The end has come for the PlayStation 3 and the PlayStation Vita. After supporting the PSN Store on the PS3 and PS Vita since 2006 and 2011 respectively, Sony has...
Since being decompiled Super Mario 64 has seen a considerable amount of interest. We've had multiple PC ports, but the efforts beyond that are really astounding. It's...