Tutorial  Updated

Extract and Decrypt games, NAND backups, and SD contents with ninfs

This is a tutorial that shows you how to use ninfs (formerly fuse-3ds) to extract the contents of games, NAND backups, and SD card contents. This tutorial is a work in progress; please post a reply if something is confusing or needs a correction.

This supports Windows, macOS, and Linux. This tutorial mostly focuses on the GUI on Windows. For macOS/Linux steps plus CLI/installable-module usage, see the README and latest release at the repository.

What sets ninfs apart from others like ctrtool is that it doesn't need to decrypt separately first. Instead, files are decrypted as needed. For example, if you mount a CIA, you can see all of the files in it, and you only need to copy out what you need. This makes it much faster and more efficient, especially for larger games where it can take a while (and several gigabytes of space) to decrypt!

Want to see a video demonstration? Here is one with Pokémon Ultra Moon, using fuse-3ds v1.0.
In this short video, I show that the CIA is encrypted, then I use ninfs to mount it and browse its contents in Windows/File Explorer. I can also use the decrypted.cxi file to immediately start playing it in Citra.
(Note that slowness is due to the virtual machine, speed would be faster on a normal computer!)

Getting started

Windows users simply need two things:
  • Install the latest release of WinFsp
  • Download the latest release of ninfs at GitHub or the GBAtemp Download Center
    • You should download the win64 version if you're using 64-bit Windows.
Please see the latest release notes for macOS and Linux (+ alternative steps for Windows).

You also need the ARM9 bootROM. You can use boot9strap to dump it by holding START+SELECT+X at boot, and finding it at /boot9strap/boot9.bin on the SD card. You can find boot9strap setup at 3DS Hacks Guide.

For newer digital games (2015+), you also need a SeedDB. Check out the SeedDB list.

Setting up boot9/SeedDB

You will need boot9.bin or boot9_prot.bin, and seeddb.bin. This will be placed at %APPDATA%\3ds on Windows, and `~/.3ds` on macOS/Linux.

If one of the files could not be found, an error will be displayed.
mainwindow-err-win.png

Both boot9 and SeedDB use similar steps for setup. This part shows boot9 steps, but it is the same for SeedDB.

If you click "Fix boot9", you will see a dialog allowing you to choose the boot9 file, and the searched paths.
b9-missing-win.png

Click "Select boot9 to copy..." then find the boot9.bin or boot9_prot.bin file. If it is valid, it will be copied.
b9-copied-win.png

Using the GUI

Run ninfs (either the exe, or the module if you installed it). A console window will appear, then a GUI a few seconds later.
mainwindow-win.png

First, choose the type that you want at the top:
  • CTR Cart Image (".3ds", ".cci")
  • CDN contents (directory with "cetk", "tmd", and contents)
  • CTR Importable Archive (".cia")
  • Executable Filesystem (".exefs", "exefs.bin")
  • Nintendo 3DS NAND backup ("nand.bin")
    • Using a directory instead of drive letter is highly recommended for this!
    • You need the OTP for this if the NAND backup does not have essential.exefs embedded by GodMode9. If you have essential.exefs as a separate file, you can extract it from that. If the Counter can't be automatically generated, you also need the CID.
    • You can write to the NAND. In the GUI, you need to enable this option. Otherwise, the mount will be read-only.
  • NCCH (".cxi", ".cfa", ".ncch", ".app")
  • Read-only Filesystem (".romfs", "romfs.bin")
  • SD Card Contents ("Nintendo 3DS" from an SD card)
    • You need movable.sed from the system whose SD card contents you want to browse. You can get it from essential.exefs, or by copying it from CTRNAND -> private -> movable.sed.
    • You can write to the SD contents. In the GUI, you need to enable this option. Otherwise, the mount will be read-only.
  • 3DSX Homebrew (".3dsx")
  • Titles directory ("title" from NAND or SD)
    • To browse SD card titles, the contents must be decrypted first. You can use the SD Card Contents mount first to do that, then use this one.
  • Nintendo DSi NAND backup ("nand_dsi.bin")
  • Nintendo DS ROM image (".nds", ".srl")
  • Nintendo Switch NAND backup ("rawnand.bin")
Once you choose the type, you need to choose the file (or directory) that you want to mount. This would be the game, NAND, or "Nintendo 3DS" SD card folder that you want.

Finally, click "Mount". If there are no errors, Windows Explorer/File Explorer will automatically open at the mount. Some example contents are shown below.
ciamount-win.png
ncchmount-win.png
nandmount-win.png
Now you can copy out the files you want.
  • If you mounted CCI, CDN, CIA, NCCH, or Titledir, you can see "decrypted.cxi" (or "decrypted.cfa" for non-executable contents) which acts like a decrypted version of the game. You can use it in applications that require decrypted contents like Citra.
  • For NAND, you can use a tool like OSFMount to mount partitions like CTRNAND, TWLN, and TWLP. Make sure you used directory mount, not drive letter.
    If you enabled writing, you can also write back to the partitions. They will be re-encrypted as you write.
  • For SD, you can browse the decrypted contents, and use something like the titledir mount to browse the installed games. You can also write to it, and the files you write will be re-encrypted.
    You can extract game saves and extdata with a tool like 3ds-save-tool.
Once you are done, click "Unmount". The mount will be removed.

Add to context/right-click menu

You can add "Mount with ninfs" to the context menu when you right-click on files. It will try to automatically detect the file type and show it in the GUI, so you can just click Mount.

Open ninfs, click "Help & Extras", then click "Add to menu". Read the dialog, then click "Add entry" or "Remove entry" to add or remove the context menu entry.

If you move or rename the EXE, you will need to re-add it.

Troubleshooting

  • I am using Windows 7, 8, or 8.1 and am getting "The procedure entry point ucrtbase.terminate could not be located in the dynamic link library api-ms-win-crt-runtime-l1-1-0.dll.".
  • I am on Windows 7 and am getting an error saying the driver is not signed when trying to install WinFsp.
    I am on Windows 7 and am getting "Cannot create WinFsp-FUSE file system: unspecified error."
 
Last edited by ihaveahax,

Kwyjor

Well-Known Member
Member
Joined
May 23, 2018
Messages
4,323
Trophies
1
XP
4,465
Country
Canada
The save files have CMACs in them, using a key that's based off the one in movable.sed. So either they need to be fixed by GodMode9 when you copy them in, or it can be done on PC.
So, the CMAC is separate from the encryption that gets applied when copying a file back to an SD card using fuse3DS, right? (I can't seem to find much clear documentation on this in particular, unfortunately. My Google-fu may be weak today.)
 

ihaveahax

Well-Known Member
OP
Member
Joined
Apr 20, 2015
Messages
6,070
Trophies
2
XP
7,845
Country
United States
So, the CMAC is separate from the encryption that gets applied when copying a file back to an SD card using fuse3DS, right? (I can't seem to find much clear documentation on this in particular, unfortunately. My Google-fu may be weak today.)
The raw save file (when you view it through an SD mount, or through GodMode9's "[A:] SYSNAND SD", etc.) has a CMAC as the first 0x10 bytes. It is basically used to ensure the file is not modified or corrupted. The key used is based off the one from movable.sed. More details can be found at https://www.3dbrew.org/wiki/DISA_and_DIFF

It sounds like the steelminer script would automatically fix this. If not, a quick script could be made.
 

KallyB_

Member
Newcomer
Joined
Jun 9, 2018
Messages
17
Trophies
0
Age
24
XP
73
Country
United Kingdom
I'm having an issue with your program at the moment. I'm trying to install HiyaCFW on my DSi XL, and I'm following the guide at http://dsi.cfw.guide/guide/installing-hiyacfw/
But when I get to SDNAND Creation, I can't mount my DSi's NAND... It pops up with the error "Failed to mount. Please check the output.
I don't understand, because it is a Valid NAND and I've followed the steps to the T.
I'll include a screenshot of the error.

Any help?
 

Attachments

  • Screenshot (2).png
    Screenshot (2).png
    64.7 KB · Views: 281

ihaveahax

Well-Known Member
OP
Member
Joined
Apr 20, 2015
Messages
6,070
Trophies
2
XP
7,845
Country
United States
I'm having an issue with your program at the moment. I'm trying to install HiyaCFW on my DSi XL, and I'm following the guide at http://dsi.cfw.guide/guide/installing-hiyacfw/
But when I get to SDNAND Creation, I can't mount my DSi's NAND... It pops up with the error "Failed to mount. Please check the output.
I don't understand, because it is a Valid NAND and I've followed the steps to the T.
I'll include a screenshot of the error.

Any help?
You didn’t put in the right Console ID. If you made the backup with fwtool 2.0, you don’t need to put in any Console ID.
 

KallyB_

Member
Newcomer
Joined
Jun 9, 2018
Messages
17
Trophies
0
Age
24
XP
73
Country
United Kingdom
Thanks for the reply! Does my Console ID have the layout FWxxxxxxxxxxx?

--------------------- MERGED ---------------------------

I tried it again with my console ID as FWxxxxxxxxxxxx, and now it comes up with a new error, which I've attached.
 

Attachments

  • Screenshot (3).png
    Screenshot (3).png
    32.6 KB · Views: 231

ihaveahax

Well-Known Member
OP
Member
Joined
Apr 20, 2015
Messages
6,070
Trophies
2
XP
7,845
Country
United States
Thanks for the reply! Does my Console ID have the layout FWxxxxxxxxxxx?

--------------------- MERGED ---------------------------

I tried it again with my console ID as FWxxxxxxxxxxxx, and now it comes up with a new error, which I've attached.
Console ID is a 16-character value and it does not have FW because W is not a hex character. Try not putting in one?
 

KallyB_

Member
Newcomer
Joined
Jun 9, 2018
Messages
17
Trophies
0
Age
24
XP
73
Country
United Kingdom
Console ID is a 16-character value and it does not have FW because W is not a hex character. Try not putting in one?

Do you know how I could find my console ID? I dumped a .bin that is titled "CID" which is console ID I'm guessing, but I don't know what to do with it...
 

ihaveahax

Well-Known Member
OP
Member
Joined
Apr 20, 2015
Messages
6,070
Trophies
2
XP
7,845
Country
United States
Do you know how I could find my console ID? I dumped a .bin that is titled "CID" which is console ID I'm guessing, but I don't know what to do with it...
Did you try without putting in a Console ID first? fwTool 2.0 includes it in the nand.bin. Otherwise you can re-dump it (do it via flipnote-lenny), or extract it from an exported DSiware somehow.
 

KallyB_

Member
Newcomer
Joined
Jun 9, 2018
Messages
17
Trophies
0
Age
24
XP
73
Country
United Kingdom
Did you try without putting in a Console ID first? fwTool 2.0 includes it in the nand.bin. Otherwise you can re-dump it (do it via flipnote-lenny), or extract it from an exported DSiware somehow.
Yeah, I tried it without the ID, but it came up with the same error...
I think i used version 1.6 of FwTool, so I need the console ID.
But can I flash my clean NAND back to my DSi, then update FwTools and back up the NAND again, so I wouldn't need the console ID?
 

ihaveahax

Well-Known Member
OP
Member
Joined
Apr 20, 2015
Messages
6,070
Trophies
2
XP
7,845
Country
United States
Yeah, I tried it without the ID, but it came up with the same error...
I think i used version 1.6 of FwTool, so I need the console ID.
But can I flash my clean NAND back to my DSi, then update FwTools and back up the NAND again, so I wouldn't need the console ID?
Console ID can be dumped with fwTool 2.0 (included in flipnote-lenny) or you can use dsi_srl_export on some exported DSiware to get it from there.
 

KallyB_

Member
Newcomer
Joined
Jun 9, 2018
Messages
17
Trophies
0
Age
24
XP
73
Country
United Kingdom
Console ID can be dumped with fwTool 2.0 (included in flipnote-lenny) or you can use dsi_srl_export on some exported DSiware to get it from there.
But since I have already installed unlaunch, doesn't that mean that my NAND isn't clean? Should I uninstall unlaunch and then back up my NAND so it's 100% stock?
 
Last edited by KallyB_,

jerbear64

Well-Known Member
Member
Joined
Dec 10, 2011
Messages
304
Trophies
1
Age
24
XP
381
Country
United States
But since I have already installed unlaunch, doesn't that mean that my NAND isn't clean? Should I uninstall unlaunch and then back up my NAND so it's 100% stock?
Your NAND isn't "clean", but Unlaunch itself is a very non-intrusive exploit. It's quite small and just attaches itself to the launcher's TMD file, and removing it from a NAND backup is as easy as trimming the launcher TMD back to size. There's no on-device tools to do this yet, though, but I ultimately wouldn't lose any sleep over having Unlaunch in a new NAND backup if you were to make one.

If you want to use the old one, I'll echo what Hax said in that the best course of action is probably using dsi_srl_extract on a DSiWare you have.

If you have Unlaunch 0.5 or 0.6, it's not safe to go to Data Management for this process, but otherwise if you're on 0.7 or above it's fine (and you should be if you're following the guide).

Go to Data Management, and copy any DSiWare to your SD card.

https://cdn.discordapp.com/attachments/440267909965676547/460454964582416394/dsi_srl_extract.zip is a prepackaged dsi_srl_extract with a Python script that will take any .bin file it finds and grab your Console ID from it. Here it is in .EXE form if you don't have Python 3.

Extract that to your PC somewhere, go to private/ds/title on your SD card, take any .bin file from there (which would be the DSiWare you exported earlier), put it in the dsi_srl_extract directory, and run the console_id .py or .EXE file. That'll spit out a console_id.txt file containing your Console ID.

Open the console_id.txt, copy the contents of it into fuse-3ds's Console ID input box, and with any luck you'll have your NAND mounted.
 

KallyB_

Member
Newcomer
Joined
Jun 9, 2018
Messages
17
Trophies
0
Age
24
XP
73
Country
United Kingdom
Your NAND isn't "clean", but Unlaunch itself is a very non-intrusive exploit. It's quite small and just attaches itself to the launcher's TMD file, and removing it from a NAND backup is as easy as trimming the launcher TMD back to size. There's no on-device tools to do this yet, though, but I ultimately wouldn't lose any sleep over having Unlaunch in a new NAND backup if you were to make one.

If you want to use the old one, I'll echo what Hax said in that the best course of action is probably using dsi_srl_extract on a DSiWare you have.

If you have Unlaunch 0.5 or 0.6, it's not safe to go to Data Management for this process, but otherwise if you're on 0.7 or above it's fine (and you should be if you're following the guide).

Go to Data Management, and copy any DSiWare to your SD card.

https://cdn.discordapp.com/attachments/440267909965676547/460454964582416394/dsi_srl_extract.zip is a prepackaged dsi_srl_extract with a Python script that will take any .bin file it finds and grab your Console ID from it. Here it is in .EXE form if you don't have Python 3.

Extract that to your PC somewhere, go to private/ds/title on your SD card, take any .bin file from there (which would be the DSiWare you exported earlier), put it in the dsi_srl_extract directory, and run the console_id .py or .EXE file. That'll spit out a console_id.txt file containing your Console ID.

Open the console_id.txt, copy the contents of it into fuse-3ds's Console ID input box, and with any luck you'll have your NAND mounted.


Oh boy. Thanks for all that detail. I've already flashed my "clean" NAND backup, and was just about to use ihaveamac's flipnote-lenny link to backup my NAND yet again, so I don't have to use the console ID.
But if that doesn't work, I'll be sure to use your method (Which looks like you spent a lot of time gathering - Thanks! :D)

I'll post back if I am successful with either method.
 

KallyB_

Member
Newcomer
Joined
Jun 9, 2018
Messages
17
Trophies
0
Age
24
XP
73
Country
United Kingdom
Agh. So close.... I used FwTool to make another backup, then tried that in fuse-3ds, with success.
I then followed the rest of the guide and installed HiyaCFW.
When I booted up the DSi, it came up with the settings screen, and when I'd finished with that and saved the settings, it froze on a white screen! It doesn't boot with the SD card inserted, no matter which settings are selected.

Thank you both for your suggestions so far. Could you help me get over this final step?
 
Last edited by KallyB_,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    BigOnYa @ BigOnYa: I haven't played my Switch n a month or so, just been playing Xbox, and just picked to play lil...