Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Ninfs 3DS: Difference between revisions

From GameBrew
No edit summary
m (Text replacement - "↵Category:Support the author" to "")
 
(33 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Infobox 3DS Homebrews
{{Infobox 3DS Homebrews
|title=Ninfs
|title=Ninfs
|image=Ninfs.png
|image=ninfs02.png
|description=FUSE filesystem Python scripts for Nintendo console files.
|description=FUSE filesystem Python scripts for Nintendo console files. Formerly named fuse-3ds.
|author=ihaveamac
|author=ihaveamac
|lastupdated=2021/06/22
|lastupdated=2024/02/25
|type=PC Utilities
|type=File Operation
|version=2.0a6
|version=2.0
|license=Mixed
|license=MIT
|download=https://dlhb.gamebrew.org/3dshomebrew/ninfv2.0a6.7z
|download=https://dlhb.gamebrew.org/3dshomebrews/ninfs.7z
|website=https://github.com/ihaveamac/ninfs
|website=https://github.com/ihaveamac/ninfs
|source=https://github.com/ihaveamac/ninfs
|source=https://github.com/ihaveamac/ninfs
|donation=https://ihaveahax.net/view/Donations
}}
}}
<youtube>d6KZdaAcpO0</youtube>
== ninfs ==
ninfs (formerly fuse-3ds) is a FUSE program to extract data from Nintendo game consoles. It works by presenting a virtual filesystem with the contents of your games, NAND, or SD card contents, and you can browse and copy out just the files that you need.
ninfs (formerly fuse-3ds) is a FUSE program to extract data from Nintendo game consoles. It works by presenting a virtual filesystem with the contents of your games, NAND, or SD card contents, and you can browse and copy out just the files that you need.


Windows, macOS, and Linux are supported.
Requires Python 3.8.0+. Supports Windows (recommended 10 or later), macOS, and Linux.
 
https://dlhb.gamebrew.org/3dshomebrew/ciamount-mac.png
 
== Supported types ==
 
* Nintendo 3DS:
** CTR Cart Image (&quot;&quot;.3ds&quot;&quot;, &quot;&quot;.cci&quot;&quot;)
** CDN contents (&quot;&quot;cetk&quot;&quot;, &quot;&quot;tmd&quot;&quot;, and contents)
** CTR Importable Archive (&quot;&quot;.cia&quot;&quot;)
** Executable Filesystem (&quot;&quot;.exefs&quot;&quot;, &quot;&quot;exefs.bin&quot;&quot;)
** Nintendo 3DS NAND backup (&quot;&quot;nand.bin&quot;&quot;)
** NCCH (&quot;&quot;.cxi&quot;&quot;, &quot;&quot;.cfa&quot;&quot;, &quot;&quot;.ncch&quot;&quot;, &quot;&quot;.app&quot;&quot;)
** Read-only Filesystem (&quot;&quot;.romfs&quot;&quot;, &quot;&quot;romfs.bin&quot;&quot;)
** SD Card Contents (&quot;&quot;Nintendo 3DS&quot;&quot; from SD)
** 3DSX Homebrew (&quot;&quot;.3dsx&quot;&quot;)
* Nintendo DS / DSi
** Nintendo DSi NAND backup (&quot;&quot;nand_dsi.bin&quot;&quot;)
** Nintendo DS ROM image (&quot;&quot;.nds&quot;&quot;, &quot;&quot;.srl&quot;&quot;)
* Nintendo Switch
** Nintendo Switch NAND backup (&quot;&quot;rawnand.bin&quot;&quot;)
 
== Example uses ==


==Features==
* Mount a NAND backup and browse CTRNAND, TWLNAND, and others, and write back to them without having to extract and decrypt them first.
* Mount a NAND backup and browse CTRNAND, TWLNAND, and others, and write back to them without having to extract and decrypt them first.
* Browse decrypted SD card contents. Dump installed games and saves, or copy contents between two system's SD contents.
* Browse decrypted SD card contents. Dump installed games and saves, or copy contents between two system's SD contents.
* Extract a game's files out of a CIA, CCI (&quot;&quot;.3ds&quot;&quot;), NCCH, RomFS, raw CDN contents, just by mounting them and browsing its files. Or use the virtual decrypted file and start playing the game in [https://citra-emu.org Citra] right away.
* Extract a game's files out of a CIA, CCI (".3ds"), NCCH, RomFS, raw CDN contents, just by mounting them and browsing its files. Or use the virtual decrypted file and start playing the game in [https://citra-emu.org/ Citra] right away.
 
== Setup ==
 
For 3DS types, The ARM9 bootROM is required. You can dump it using boot9strap, which can be set up by [https://3ds.hacks.guide 3DS Hacks Guide]. To dump the bootROM, hold START+SELECT+X when you boot up your 3DS. It is checked in order of:


==Installation==
===Initial setup===
For 3DS types, the ARM9 bootROM is required. You can dump it using [[boot9strap 3DS|boot9strap]] (hold Start+Select+X on boot), which can be set up by [https://3ds.hacks.guide 3DS Hacks Guide]. It is checked in order of:
* <code>--boot9</code> argument (if set)
* <code>--boot9</code> argument (if set)
* <code>BOOT9_PATH</code> environment variable (if set)
* <code>BOOT9_PATH</code> environment variable (if set)
Line 57: Line 32:
* <code>~/3ds/boot9.bin</code>
* <code>~/3ds/boot9.bin</code>


<code>boot9_prot.bin</code> can also be used in all of these locations.
Notes:
 
* <code>boot9_prot.bin</code> can also be used in all of these locations.
&quot;&quot;<code>~</code>&quot;&quot; means the user's home directory. &quot;&quot;<code>~/3ds</code>&quot;&quot; would mean <code>/Users/username/3ds</code> on macOS and <code>C:\Users\username\3ds</code> on Windows.
* "<code>~</code>" means the user's home directory.  
 
* "<code>~/3ds</code>" would mean <code>/Users/username/3ds</code> on macOS and <code>C:\Users\username\3ds</code> on Windows.
CDN, CIA, and NCCH mounting may need [https://github.com/ihaveamac/3DS-rom-tools/wiki/SeedDB-list SeedDB] for mounting NCCH containers of newer games (2015+) that use seeds.<br />
SeedDB is checked in order of:


CDN, CIA, and NCCH mounting may need [https://github.com/ihaveamac/3DS-rom-tools/wiki/SeedDB-list SeedDB] for mounting NCCH containers of newer games (2015+) that use seeds. SeedDB is checked in order of:
* <code>--seeddb</code> argument (if set)
* <code>--seeddb</code> argument (if set)
* <code>SEEDDB_PATH</code> environment variable (if set)
* <code>SEEDDB_PATH</code> environment variable (if set)
Line 71: Line 45:
* <code>~/3ds/seeddb.bin</code>
* <code>~/3ds/seeddb.bin</code>


Python 3.6.1+ and pycryptodomex are required. PySide2 is required for the GUI.
===How to install===
 
* [https://github.com/ihaveamac/ninfs?tab=readme-ov-file#windows Windows]
* [https://github.com/fusepy/fusepy fusepy] is pre-included until [https://github.com/pleiszenburg/refuse refuse] has a fully stable release.
* [https://github.com/ihaveamac/ninfs?tab=readme-ov-file#macos macOS]
 
* [https://github.com/ihaveamac/ninfs?tab=readme-ov-file#linux Linux]
=== Windows ===
 
Windows 7 or later is required.
 
(GUI in progress of being re-created.) Python does not have to be installed, but [http://www.secfs.net/winfsp/download/ WinFsp] is still required.
 
==== Install with existing Python ====
 
* Install the latest version of [https://www.python.org/downloads/ Python 3]. The x86-64 version is preferred on 64-bit Windows.
** Alternatively, use [https://www.microsoft.com/en-us/p/python-37/9nj46sx7x90p Python 3.7 from the Microsoft Store]. Note that <code>python</code> or <code>python3</code> must be used, not <code>py -3</code>.
* Install the latest version of [http://www.secfs.net/winfsp/download/ WinFsp].
* Install ninfs with <code>py -3 -m pip install --upgrade https://github.com/ihaveamac/ninfs/archive/master.zip</code>.
** With GUI support: <code>py -3 -m pip install --upgrade https://github.com/ihaveamac/ninfs/archive/master.zip#egg=ninfs[gui]</code>
 
=== macOS ===
 
(GUI in progress of being re-created.) Python does not have to be installed, but [https://osxfuse.github.io/ FUSE for macOS] is still required.
 
==== Install with existing Python ====
 
Versions of macOS supported by Apple are highly recommended. OS X Mavericks is the oldest version that should work.
 
* Install the latest version of Python 3. The recommended way is [https://brew.sh Homebrew]. You can also use an installer from [https://www.python.org/downloads/ python.org] or a tool like [https://github.com/pyenv/pyenv pyenv].
* Install the latest version of [https://github.com/osxfuse/osxfuse/releases/latest FUSE for macOS].
* Install ninfs with <code>python3 -m pip install --upgrade https://github.com/ihaveamac/ninfs/archive/master.zip</code>.
** With GUI support: <code>python3 -m pip install --upgrade https://github.com/ihaveamac/ninfs/archive/master.zip#egg=ninfs[gui]</code>
 
=== Linux ===
 
* Arch Linux: ninfs is available in the AUR: [https://aur.archlinux.org/packages/ninfs/ normal], [https://aur.archlinux.org/packages/ninfs-gui/ with gui], [https://aur.archlinux.org/packages/ninfs-git/ git], [https://aur.archlinux.org/packages/ninfs-gui-git/ git with gui]
* Recent distributions should have Python 3.6.1 or later pre-installed, or included in its repositories. If not, you can use an extra repository (e.g. [https://launchpad.net/%7Edeadsnakes/+archive/ubuntu/ppa deadsnakes's PPA] for Ubuntu), [https://www.python.org/downloads/source/ build from source], or use a tool like [https://github.com/pyenv/pyenv pyenv].
* Most distributions should have fuse enabled/installed by default. Use your package manager if it isn't.
* Install ninfs with <code>python3 -m pip install --upgrade --user https://github.com/ihaveamac/ninfs/archive/2.0.zip</code>.
** <code>--user</code> is not needed if you are using a virtual environment.
** With GUI support: <code>python3 -m pip install --upgrade --user https://github.com/ihaveamac/ninfs/archive/2.0.zip#egg=ninfs[gui]</code>
* You can add a desktop entry with <code>python3 -m ninfs --install-desktop-entry</code>. If you want to install to a location other than the default (<code>$XDG_DATA_HOME</code>), you can add another argument with a path like <code>/usr/local/share</code>.
 
== Usage ==
 
=== Graphical user interface ===
 
A GUI can be used, if ninfs was installed with GUI support, by specifying the type to be <code>gui</code> (e.g. Windows: <code>py -3 -mninfs gui</code>, *nix: <code>python3 -mninfs gui</code>). The GUI controls mounting and unmounting.
 
=== Command line ===
 
Run a mount script by using &quot;&quot;<code>mount_&lt;type&gt;</code>&quot;&quot; (e.g. <code>mount_cci game.3ds mountpoint</code>). Use <code>-h</code> to view arguments for a script.
 
If it doesn't work, the other way is to use <code>&lt;python-cmd&gt; -mninfs &lt;type&gt;</code> (e.g. Windows: <code>py -3 -mninfs cci game.3ds mountpoint</code>, *nix: <code>python3 -mninfs cci game.3ds mountpoint</code>).


Windows users can use a drive letter like <code>F:</code> as a mountpoint, or use <code>*</code> and a drive letter will be automatically chosen.
==User guide==
===Supported  file types===
Nintendo 3DS:
* CTR Cart Image - .3ds, .cci.
* CDN contents - cetk, tmd, and contents.
* CTR Importable Archive - .cia.
* Executable Filesystem - .exefs, exefs.bin.
* Nintendo 3DS NAND backup - nand.bin.
* NCCH - .cxi, .cfa, .ncch, .app.
* Read-only Filesystem - .romfs, romfs.bin.
* SD Card Contents - Nintendo 3DS from SD.
* Installed SD Title Contents - *.tmd and *.app files.
* 3DSX Homebrew - .3dsx.  


Developer-unit contents are encrypted with different keys, which can be used with <code>--dev</code> with CCI, CDN, CIA, NANDCTR, NCCH, and SD.
Nintendo DS/DSi:
* Nintendo DSi NAND backup - nand_dsi.bin.
* Nintendo DS ROM image - .nds, .srl.


==== Unmounting ====
iQue Player:
* iQue Player NAND backup (read-only) - nand.bin.


* Windows: Press <kbd>Ctrl</kbd> + <kbd>C</kbd> in the command prompt/PowerShell window.
Nintendo Switch:
* macOS: Two methods:
* Nintendo Switch NAND backup - rawnand.bin.
** Right-click on the mount and choose &quot;&quot;Eject “''drive name''”&quot;&quot;.
** Run from terminal: <code>diskutil unmount /path/to/mount</code>
* Linux: Run from terminal: <code>fusermount -u /path/to/mount</code>


=== Examples ===
===Graphical user interface===
A GUI can be used by specifying the type to be <code>gui</code>. It controls mounting and unmounting. Examples:
* Windows - <code>py -3 -mninfs gui</code>
* *nix - <code>python3 -mninfs gui</code>.


* 3DS game card dump:<br />
===Command line===
<code>mount_cci game.3ds mountpoint</code>
Mounting:
* Contents downloaded from CDN:<br />
* Run a mount script by using "<code>mount_<type></code>" (e.g. <code>mount_cci game.3ds mountpoint</code>).  
<code>mount_cdn cdn_directory mountpoint</code>
* Use <code>-h</code> to view arguments for a script.
* CDN contents with a specific decrypted titlekey:<br />
* If it doesn't work, the other way is to use <code><python-cmd> -mninfs <type></code>. Examples:
<code>mount_cdn --dec-key 3E3E6769742E696F2F76416A65423C3C cdn_directory mountpoint</code>
** Windows - <code>py -3 -mninfs cci game.3ds mountpoint</code>  
* CIA:<br />
** *nix - <code>python3 -mninfs cci game.3ds mountpoint</code>
<code>mount_cia game.cia mountpoint</code>
* Windows users can use a drive letter like <code>F:</code> as a mountpoint. Or use <code>*</code> and a drive letter will be automatically chosen.
* ExeFS:<br />
* Developer-unit contents are encrypted with different keys, which can be used with <code>--dev</code> with CCI, CDN, CIA, NANDCTR, NCCH, and SD.
<code>mount_exefs exefs.bin mountpoint</code>
* 3DS NAND backup with <code>essential.exefs</code> embedded:<br />
<code>mount_nandctr nand.bin mountpoint</code>
* 3DS NAND backup with an OTP file (Counter is automatically generated):<br />
<code>mount_nandctr --otp otp.bin nand.bin mountpoint</code>
* 3DS NAND backup with OTP and CID files:<br />
<code>mount_nandctr --otp otp.bin --cid nand_cid.bin nand.bin mountpoint</code>
* 3DS NAND backup with OTP file and a CID hexstring:<br />
<code>mount_nandctr --otp otp.bin --cid 7468616E6B7334636865636B696E6721 nand.bin mountpoint</code>
* DSi NAND backup (Counter is automatically generated):<br />
<code>mount_nandtwl --console-id 4E696E74656E646F nand_dsi.bin mountpoint</code>
* DSi NAND backup with a Console ID hexstring and specified CID hexstring:<br />
<code>mount_nandtwl --console-id 4E696E74656E646F --cid 576879446F657344536945786973743F nand_dsi.bin mountpoint</code>
* DSi NAND backup with a Console ID file and specified CID file:<br />
<code>mount_nandtwl --console-id ConsoleID.bin --cid CID.bin nand_dsi.bin mountpoint</code>
* Switch NAND backup<br />
<code>mount_nandhac --keys prod.keys rawnand.bin mountpoint</code>
* Switch NAND backup in multiple parts<br />
<code>mount_nandhac --keys prod.keys -S rawnand.bin.00 mountpoint</code>
* NCCH container (.app, .cxi, .cfa, .ncch):<br />
<code>mount_ncch content.cxi mountpoint</code>
* RomFS:<br />
<code>mount_romfs romfs.bin mountpoint</code>
* <code>Nintendo 3DS</code> directory from an SD card:<br />
<code>mount_sd --movable movable.sed &quot;&quot;/path/to/Nintendo 3DS&quot;&quot; mountpoint</code>
* <code>Nintendo 3DS</code> directory from an SD card with an SD key hexstring:<br />
<code>mount_sd --sd-key 504C415900000000504F4B454D4F4E21 &quot;&quot;/path/to/Nintendo 3DS&quot;&quot; mountpoint</code>
* Nintendo DS ROM image (NDS/SRL, <code>mount_nds</code> also works):<br />
<code>mount_srl game.nds mountpoint</code>
* 3DSX homebrew application:<br />
<code>mount_threedsx boot.3dsx mountpoint</code>


== Useful tools ==
Unmounting:
* Windows - Press Ctrl+C in the command prompt/PowerShell window.
* Linux - Run from terminal <code>fusermount -u /path/to/mount</code>
* macOS (two methods):
** Right-click on the mount and choose "Eject "drive name"".
** Run from terminal <code>diskutil unmount /path/to/mount</code>


* wwylele's [https://github.com/wwylele/3ds-save-tool 3ds-save-tool] can be used to extract game saves and extra data (DISA and DIFF, respectively).
===Examples===
** wwylele's [https://github.com/wwylele/save3ds save3ds] is a FUSE mount for 3DS save files. Currently only supports macOS and Linux.
# 3DS game card dump.
* [https://www.osforensics.com/tools/mount-disk-images.html OSFMount] for Windows can mount FAT12/FAT16 partitions in NAND backups.
mount_cci game.3ds mountpoint
# Contents downloaded from CDN.
mount_cdn cdn_directory mountpoint
# CDN contents with a specific decrypted titlekey.
mount_cdn --dec-key 3E3E6769742E696F2F76416A65423C3C cdn_directory mountpoint</code>
 
# CIA.
mount_cia game.cia mountpoint
# ExeFS.
mount_exefs exefs.bin mountpoint
# 3DS NAND backup with essential.exefs embedded.
mount_nandctr nand.bin mountpoint
# 3DS NAND backup with an OTP file (Counter is automatically generated).
mount_nandctr --otp otp.bin nand.bin mountpoint
# 3DS NAND backup with OTP and CID files.
mount_nandctr --otp otp.bin --cid nand_cid.bin nand.bin mountpoint
# 3DS NAND backup with OTP file and a CID hexstring.
mount_nandctr --otp otp.bin --cid 7468616E6B7334636865636B696E6721 nand.bin mountpoint
# DSi NAND backup (Counter is automatically generated).
mount_nandtwl --console-id 5345445543454D45 nand_dsi.bin mountpoint
# DSi NAND backup with a Console ID hexstring and specified CID hexstring.
mount_nandtwl --console-id 5345445543454D45 --cid 576879446F657344536945786973743F nand_dsi.bin mountpoint
# DSi NAND backup with a Console ID file and specified CID file.
mount_nandtwl --console-id ConsoleID.bin --cid CID.bin nand_dsi.bin mountpoint
# iQue Player NAND backup.
mount_nandbb nand.bin mountpoint
# Switch NAND backup.
mount_nandhac --keys prod.keys rawnand.bin mountpoint
# Switch NAND backup in multiple parts.
mount_nandhac --keys prod.keys -S rawnand.bin.00 mountpoint
# Switch NAND encrypted partition dump.
mount_nandhac --keys prod.keys --partition SYSTEM SYSTEM.bin mountpoint
# NCCH container (.app, .cxi, .cfa, .ncch).
mount_ncch content.cxi mountpoint
# RomFS.
mount_romfs romfs.bin mountpoint
# Nintendo 3DS directory from an SD card.
mount_sd --movable movable.sed "/path/to/Nintendo 3DS" mountpoint
# Nintendo 3DS directory from an SD card with an SD key hexstring.
mount_sd --sd-key 504C415900000000504F4B454D4F4E21 "/path/to/Nintendo 3DS" mountpoint
# Nintendo DS ROM image (NDS/SRL, mount_nds also works).
mount_srl game.nds mountpoint
 
# 3DSX homebrew application.
mount_threedsx boot.3dsx mountpoint


== Related tools ==
===Useful tools===
* wwylele's [[3DS_Save_File_Extraction_Tools|3ds-save-tool]] can be used to extract game saves and extra data (DISA and DIFF, respectively).
* wwylele's [[Save3DS|save3ds]] is a tool to interact with 3DS save files and extdata. Extracting and importing works on all platforms. The FUSE part only works on macOS and Linux.
* [https://www.osforensics.com/tools/mount-disk-images.html OSFMount] for Windows can mount FAT12/FAT16/FAT32 partitions in NAND backups.


===Related tools===
* roothorick's [https://gitlab.com/roothorick/busehac BUSEHAC] is a Linux driver for encrypted Nintendo Switch NANDs.
* roothorick's [https://gitlab.com/roothorick/busehac BUSEHAC] is a Linux driver for encrypted Nintendo Switch NANDs.
* Maschell's [https://github.com/Maschell/fuse-wiiu fuse-wiiu] can be used to mount Wii U contents.
* Maschell's [https://github.com/Maschell/fuse-wiiu fuse-wiiu] can be used to mount Wii U contents.
* koolkdev's [https://github.com/koolkdev/wfslib wfslib] has wfs-fuse to mount the Wii U mlc dumps and usb devices.
* koolkdev's [https://github.com/koolkdev/wfslib wfslib] has wfs-fuse to mount the Wii U mlc dumps and usb devices.


== License/Credits ==
==Screenshots==
https://dlhb.gamebrew.org/3dshomebrews/ninfs3.png


* <code>ninfs</code> is under the MIT license.
==Media==
** <code>fuse.py</code> is under the ISC license ([https://github.com/fusepy/fusepy/blob/b5f87a1855119d55c755c2c4c8b1da346365629d/setup.py taken from <code>setup.py</code>]).
'''fuse-3ds demonstration with Pokémon Ultra Moon''' ([https://www.youtube.com/watch?v=d6KZdaAcpO0 ihaveamac]) <br>
** <code>hac/aes.cpp</code> and <code>hac/aes.hpp</code> are from @openluopworld's [https://github.com/openluopworld/aes_128 aes_128] commit <code>b5b7f55</code>, and uses the MIT License.
<youtube>d6KZdaAcpO0</youtube>
** <code>hac/_crypto.cpp</code> AES-XTS part by @luigoalma, based on @plutooo's [https://gist.github.com/plutooo/fd4b22e7f533e780c1759057095d7896 crypto module]; Python module implementation initially by me(@ihaveamac).


Special thanks to @Stary2001 for help with NAND crypto (especially TWL), and @d0k3 for SD crypto.
==Changelog==
'''v2.0'''
* Fix corruption with New 3DS CTRNAND.
** This mainly affected standalone builds. Other installation methods that didn't use pyctr 0.7.3 were not affected.


OTP code is from [https://github.com/Stary2001/3ds_tools/blob/10b74fee927f66865b97fd73b3e7392e81a3099f/three_ds/aesengine.py Stary2001/3ds_tools], and is under the MIT license.
'''v2.0a11'''
* Accept non-ASCII game titles for SRL/NDS (some homebrew applications do this).
* Windows Installer: update pre-included WinFsp.
** The installer does not update WinFsp for you, if you want to update it, you must do it separately.
* Linux: creating desktop entry now includes the full path to the python3 executable.
* Python 3.8 or later is required, this does not affect standalone builds.
* Update pyctr requirement to 0.7.x (standalone builds use 0.7.3).
** RomFS performance is improved, especially for titles that contain a large amount of files or directories.
** Fix setting TWLNAND keys for devunit NANDs.
** For other changes related to pyctr 0.7.x: https://github.com/ihaveamac/pyctr/blob/0.7/CHANGELOG.md
* Other various internal changes.


Warning: Using the GUI on macOS 10.14.6 will crash WindowServer and force you back to the login screen. The issue can be followed here: [http://github.com/pyinstaller/pyinstaller/issues/4334 http://github.com/pyinstaller/pyinstaller/issues/4334]
'''v2.0a10'''
* Windows/GUI: Fix tkinter failing to find tcl/tk when installed in paths that contain non-Latin characters.
* nandhac: Fix problems loading multipart images on Linux when the mount process is not in the foreground.
* macOS: Try to load fuse-t if macFUSE can't be found ([https://github.com/ihaveamac/ninfs/issues/103 #103]).
* fuse-t is an alternative to macFUSE that doesn't depend on a kernel extension, making it easier to install on modern macOS. It should work just as well but please file issues.
* macOS: Only display filename in volume name and not the containing directory for mounts that do this.


Changes since v1.6.1 SD: Properly decrypt contents of backup folder NANDHAC: Support &quot;&quot;raw&quot;&quot; partition-based emuMMC images with -R/--raw-emummc Display application name for CIA, CCI, and NCCH in mount title on macOS Allow assuming contents are decrypted for CCI and NCCH Major internal changes and rewriting Remove titledir mount - better tools will be coming later to search for installed titles Other things, probably Changes since v1.7b1 Display application name for CCI in mount title on macOS Allow assuming contents are decrypted for CCI and NCCH Interested in filling out a quick survey on how you use ninfs? Click here!
'''v2.0a9'''
* Mac application is now signed and notarized by Apple.
* Fix not showing all drive letters in the Windows GUI mount, only A and B.
* Always set write bit in mounts (except SD).
* This makes it easier to deal with files that have been copied out of the mount, since chmod won't be required to set the write bit.
* Include Internet Access Policy for Little Snitch.
* Fix DMG build not properly copying the application.
* Update WinFSP url.


Important note This is not a full release, so some things may still be broken. Please file issues if this happens.
==Credits==
ninfs is under the MIT license. fuse.py is under the ISC license (taken from [https://github.com/fusepy/fusepy/blob/b5f87a1855119d55c755c2c4c8b1da346365629d/setup.py setup.py]).


NAND and SD mounts allow writing. Keep backups before writing to these, in the event an unknown bug corrupts data.
Special thanks to @Jhynjhiruu for adding support for iQue Player NAND backups.


There is a Windows tutorial for ninfs on GBAtemp. README also explains how to use it via command line and on non-Windows platforms. If you are unsure about something, you can ask at Nintendo Homebrew on Discord, or the GBAtemp thread.
Special thanks to @Stary2001 for help with NAND crypto (especially TWL), and @d0k3 for SD crypto.


The signatures are created with the PGP key 90725113CA578EAA.
OTP code is from [https://github.com/Stary2001/3ds_tools/blob/10b74fee927f66865b97fd73b3e7392e81a3099f/three_ds/aesengine.py Stary2001/3ds_tools], and is under the MIT license.
 
Usage Windows and macOS users can download the standalone applications attached to this release, which works without needing Python installed. WinFsp for Windows or FUSE for macOS must still be installed.
 
Linux users (and users who prefer to use their installed Python) can install this release via pip, or by downloading the &quot;&quot;Source code&quot;&quot; archive. Python 3.6.1 or later is required. Read the README for more setup and usage details.
 
<syntaxhighlight>
 
'''Command line install'''
 
Windows
 
py -3 -mpip install --upgrade https://github.com/ihaveamac/ninfs/releases/download/v1.7b2/ninfs-1.7b2-src.zip
With GUI support: py -3 -m pip install --upgrade https://github.com/ihaveamac/ninfs/releases/download/v1.7b2/ninfs-1.7b2-src.zip#egg=ninfs[gui]
 
macOS
 
FUSE for macOS is required.
 
python3 -mpip install --upgrade https://github.com/ihaveamac/ninfs/releases/download/v1.7b2/ninfs-1.7b2-src.zip
With GUI support: python3 -m pip install --upgrade https://github.com/ihaveamac/ninfs/releases/download/v1.7b2/ninfs-1.7b2-src.zip#egg=ninfs[gui]
 
Linux
 
python3 -mpip install --upgrade --user https://github.com/ihaveamac/ninfs/releases/download/v1.7b2/ninfs-1.7b2-src.zip
--user is not required if you are using a virtualenv.
With GUI support: python3 -m pip install --upgrade --user https://github.com/ihaveamac/ninfs/releases/download/v1.7b2/ninfs-1.7b2-src.zip#egg=ninfs[gui]


</syntaxhighlight>
==External links==
* GitHub - https://github.com/ihaveamac/ninfs
* GBAtemp - https://gbatemp.net/threads/extract-and-decrypt-games-nand-backups-and-sd-contents-with-ninfs.499994

Latest revision as of 04:33, 17 Mayıs 2024

Ninfs
Ninfs02.png
General
Authorihaveamac
TypeFile Operation
Version2.0
LicenseMIT License
Last Updated2024/02/25
Links
Download
Website
Source
Support Author

ninfs (formerly fuse-3ds) is a FUSE program to extract data from Nintendo game consoles. It works by presenting a virtual filesystem with the contents of your games, NAND, or SD card contents, and you can browse and copy out just the files that you need.

Requires Python 3.8.0+. Supports Windows (recommended 10 or later), macOS, and Linux.

Features

  • Mount a NAND backup and browse CTRNAND, TWLNAND, and others, and write back to them without having to extract and decrypt them first.
  • Browse decrypted SD card contents. Dump installed games and saves, or copy contents between two system's SD contents.
  • Extract a game's files out of a CIA, CCI (".3ds"), NCCH, RomFS, raw CDN contents, just by mounting them and browsing its files. Or use the virtual decrypted file and start playing the game in Citra right away.

Installation

Initial setup

For 3DS types, the ARM9 bootROM is required. You can dump it using boot9strap (hold Start+Select+X on boot), which can be set up by 3DS Hacks Guide. It is checked in order of:

  • --boot9 argument (if set)
  • BOOT9_PATH environment variable (if set)
  • %APPDATA%\3ds\boot9.bin (Windows-specific)
  • ~/Library/Application Support/3ds/boot9.bin (macOS-specific)
  • ~/.3ds/boot9.bin
  • ~/3ds/boot9.bin

Notes:

  • boot9_prot.bin can also be used in all of these locations.
  • "~" means the user's home directory.
  • "~/3ds" would mean /Users/username/3ds on macOS and C:\Users\username\3ds on Windows.

CDN, CIA, and NCCH mounting may need SeedDB for mounting NCCH containers of newer games (2015+) that use seeds. SeedDB is checked in order of:

  • --seeddb argument (if set)
  • SEEDDB_PATH environment variable (if set)
  • %APPDATA%\3ds\seeddb.bin (Windows-specific)
  • ~/Library/Application Support/3ds/seeddb.bin (macOS-specific)
  • ~/.3ds/seeddb.bin
  • ~/3ds/seeddb.bin

How to install

User guide

Supported file types

Nintendo 3DS:

  • CTR Cart Image - .3ds, .cci.
  • CDN contents - cetk, tmd, and contents.
  • CTR Importable Archive - .cia.
  • Executable Filesystem - .exefs, exefs.bin.
  • Nintendo 3DS NAND backup - nand.bin.
  • NCCH - .cxi, .cfa, .ncch, .app.
  • Read-only Filesystem - .romfs, romfs.bin.
  • SD Card Contents - Nintendo 3DS from SD.
  • Installed SD Title Contents - *.tmd and *.app files.
  • 3DSX Homebrew - .3dsx.

Nintendo DS/DSi:

  • Nintendo DSi NAND backup - nand_dsi.bin.
  • Nintendo DS ROM image - .nds, .srl.

iQue Player:

  • iQue Player NAND backup (read-only) - nand.bin.

Nintendo Switch:

  • Nintendo Switch NAND backup - rawnand.bin.

Graphical user interface

A GUI can be used by specifying the type to be gui. It controls mounting and unmounting. Examples:

  • Windows - py -3 -mninfs gui
  • *nix - python3 -mninfs gui.

Command line

Mounting:

  • Run a mount script by using "mount_<type>" (e.g. mount_cci game.3ds mountpoint).
  • Use -h to view arguments for a script.
  • If it doesn't work, the other way is to use <python-cmd> -mninfs <type>. Examples:
    • Windows - py -3 -mninfs cci game.3ds mountpoint
    • *nix - python3 -mninfs cci game.3ds mountpoint
  • Windows users can use a drive letter like F: as a mountpoint. Or use * and a drive letter will be automatically chosen.
  • Developer-unit contents are encrypted with different keys, which can be used with --dev with CCI, CDN, CIA, NANDCTR, NCCH, and SD.

Unmounting:

  • Windows - Press Ctrl+C in the command prompt/PowerShell window.
  • Linux - Run from terminal fusermount -u /path/to/mount
  • macOS (two methods):
    • Right-click on the mount and choose "Eject "drive name"".
    • Run from terminal diskutil unmount /path/to/mount

Examples

# 3DS game card dump.
mount_cci game.3ds mountpoint

# Contents downloaded from CDN.
mount_cdn cdn_directory mountpoint

# CDN contents with a specific decrypted titlekey.
mount_cdn --dec-key 3E3E6769742E696F2F76416A65423C3C cdn_directory mountpoint
 
# CIA.
mount_cia game.cia mountpoint

# ExeFS.
mount_exefs exefs.bin mountpoint

# 3DS NAND backup with essential.exefs embedded.
mount_nandctr nand.bin mountpoint

# 3DS NAND backup with an OTP file (Counter is automatically generated).
mount_nandctr --otp otp.bin nand.bin mountpoint

# 3DS NAND backup with OTP and CID files.
mount_nandctr --otp otp.bin --cid nand_cid.bin nand.bin mountpoint

# 3DS NAND backup with OTP file and a CID hexstring.
mount_nandctr --otp otp.bin --cid 7468616E6B7334636865636B696E6721 nand.bin mountpoint

# DSi NAND backup (Counter is automatically generated).
mount_nandtwl --console-id 5345445543454D45 nand_dsi.bin mountpoint

# DSi NAND backup with a Console ID hexstring and specified CID hexstring.
mount_nandtwl --console-id 5345445543454D45 --cid 576879446F657344536945786973743F nand_dsi.bin mountpoint

# DSi NAND backup with a Console ID file and specified CID file.
mount_nandtwl --console-id ConsoleID.bin --cid CID.bin nand_dsi.bin mountpoint

# iQue Player NAND backup.
mount_nandbb nand.bin mountpoint

# Switch NAND backup.
mount_nandhac --keys prod.keys rawnand.bin mountpoint

# Switch NAND backup in multiple parts.
mount_nandhac --keys prod.keys -S rawnand.bin.00 mountpoint

# Switch NAND encrypted partition dump.
mount_nandhac --keys prod.keys --partition SYSTEM SYSTEM.bin mountpoint

# NCCH container (.app, .cxi, .cfa, .ncch).
mount_ncch content.cxi mountpoint

# RomFS.
mount_romfs romfs.bin mountpoint

# Nintendo 3DS directory from an SD card.
mount_sd --movable movable.sed "/path/to/Nintendo 3DS" mountpoint

# Nintendo 3DS directory from an SD card with an SD key hexstring.
mount_sd --sd-key 504C415900000000504F4B454D4F4E21 "/path/to/Nintendo 3DS" mountpoint

# Nintendo DS ROM image (NDS/SRL, mount_nds also works).
mount_srl game.nds mountpoint
 
# 3DSX homebrew application.
mount_threedsx boot.3dsx mountpoint

Useful tools

  • wwylele's 3ds-save-tool can be used to extract game saves and extra data (DISA and DIFF, respectively).
  • wwylele's save3ds is a tool to interact with 3DS save files and extdata. Extracting and importing works on all platforms. The FUSE part only works on macOS and Linux.
  • OSFMount for Windows can mount FAT12/FAT16/FAT32 partitions in NAND backups.

Related tools

  • roothorick's BUSEHAC is a Linux driver for encrypted Nintendo Switch NANDs.
  • Maschell's fuse-wiiu can be used to mount Wii U contents.
  • koolkdev's wfslib has wfs-fuse to mount the Wii U mlc dumps and usb devices.

Screenshots

ninfs3.png

Media

fuse-3ds demonstration with Pokémon Ultra Moon (ihaveamac)

Changelog

v2.0

  • Fix corruption with New 3DS CTRNAND.
    • This mainly affected standalone builds. Other installation methods that didn't use pyctr 0.7.3 were not affected.

v2.0a11

  • Accept non-ASCII game titles for SRL/NDS (some homebrew applications do this).
  • Windows Installer: update pre-included WinFsp.
    • The installer does not update WinFsp for you, if you want to update it, you must do it separately.
  • Linux: creating desktop entry now includes the full path to the python3 executable.
  • Python 3.8 or later is required, this does not affect standalone builds.
  • Update pyctr requirement to 0.7.x (standalone builds use 0.7.3).
  • Other various internal changes.

v2.0a10

  • Windows/GUI: Fix tkinter failing to find tcl/tk when installed in paths that contain non-Latin characters.
  • nandhac: Fix problems loading multipart images on Linux when the mount process is not in the foreground.
  • macOS: Try to load fuse-t if macFUSE can't be found (#103).
  • fuse-t is an alternative to macFUSE that doesn't depend on a kernel extension, making it easier to install on modern macOS. It should work just as well but please file issues.
  • macOS: Only display filename in volume name and not the containing directory for mounts that do this.

v2.0a9

  • Mac application is now signed and notarized by Apple.
  • Fix not showing all drive letters in the Windows GUI mount, only A and B.
  • Always set write bit in mounts (except SD).
  • This makes it easier to deal with files that have been copied out of the mount, since chmod won't be required to set the write bit.
  • Include Internet Access Policy for Little Snitch.
  • Fix DMG build not properly copying the application.
  • Update WinFSP url.

Credits

ninfs is under the MIT license. fuse.py is under the ISC license (taken from setup.py).

Special thanks to @Jhynjhiruu for adding support for iQue Player NAND backups.

Special thanks to @Stary2001 for help with NAND crypto (especially TWL), and @d0k3 for SD crypto.

OTP code is from Stary2001/3ds_tools, and is under the MIT license.

External links

Advertising: