• Stars
    star
    429
  • Rank 100,647 (Top 2 %)
  • Language
    Python
  • License
    MIT License
  • Created about 7 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

FUSE filesystem Python scripts for Nintendo console files

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.

Windows, macOS, and Linux are supported.

Supported 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")

Example uses

  • 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.

Setup

For 3DS types, The ARM9 bootROM is required. You can dump it using boot9strap, which can be set up by 3DS Hacks Guide. To dump the bootROM, hold START+SELECT+X when you boot up your 3DS. 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

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

Python 3.6.1 or later is required.

Windows

Windows 8.1 or later is required.

Installer

An installer is provided in releases. It includes both ninfs and WinFsp, which is installed if required.

Standalone release

A standalone zip is also provided in releases. WinFsp must be installed separately.

Install with existing Python

  • Install the latest version of Python 3. The x86-64 version is preferred on 64-bit Windows.
    • Python from the Microsoft Store can also be used. If this is used, python3 must be used instead of py -3. This version has some limitations however, such as not being able to mount to directories.
  • Install the latest version of WinFsp.
  • Install ninfs with py -3 -m pip install --upgrade https://github.com/ihaveamac/ninfs/archive/2.0.zip

Windows on ARM

Official support for Windows on ARM will come eventually. In the mean time, running the x86 version has been tested and seems to work properly. Make sure to install the latest WinFSP version with ARM64 support.

macOS

Versions of macOS supported by Apple are highly recommended. macOS Sierra is the oldest version that should work. macFUSE is required.

No standalone build is available at the moment.

Install with existing Python

  • Install the latest version of Python 3. The recommended way is Homebrew. You can also use an installer from python.org or a tool like pyenv.
  • Install the latest version of macFUSE.
  • Install ninfs with python3 -m pip install --upgrade https://github.com/ihaveamac/ninfs/archive/2.0.zip

Linux

Arch Linux

(NOTE: git versions out of date while build process stabilizes)
ninfs is available in the AUR: normal, with gui, git, git with gui

Other distributions

  • Recent distributions (e.g. Ubuntu 18.04 and later) 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. deadsnakes's PPA for Ubuntu), build from source, or use a tool like pyenv.
  • Most distributions should have libfuse enabled/installed by default. Use your package manager if it isn't.
  • Install ninfs with python3 -m pip install --upgrade --user https://github.com/ihaveamac/ninfs/archive/2.0.zip
    • --user is not needed if you are using a virtual environment.
  • You can add a desktop entry with python3 -m ninfs --install-desktop-entry. If you want to install to a location other than the default ($XDG_DATA_HOME), you can add another argument with a path like /usr/local/share.
  • To use the GUI, tkinter needs to be installed. On Debian-/Ubuntu-based systems this is python3-tk. On Fedora this is python3-tkinter.

Usage

Graphical user interface

A GUI can be used by specifying the type to be gui (e.g. Windows: py -3 -mninfs gui, *nix: python3 -mninfs gui). The GUI controls mounting and unmounting.

Command line

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> (e.g. 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.
  • macOS: Two methods:
    • Right-click on the mount and choose "Eject β€œdrive name”".
    • Run from terminal: diskutil unmount /path/to/mount
  • Linux: Run from terminal: fusermount -u /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.

License/Credits

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.

More Repositories

1

custom-install

Installs a title directly to an SD card for the Nintendo 3DS
Python
545
star
2

3dsconv

Python script to convert Nintendo 3DS CCI (".cci", ".3ds") files to the CIA format
Python
499
star
3

3DS-rom-tools

Tools and guides for working with Nintendo 3DS games and applications
Python
316
star
4

ctr-no-timeoffset

Sets the time offset in Config Savegame to 0
Makefile
128
star
5

faketik

Generates fake tickets to make missing titles re-appear on 3DS.
Makefile
90
star
6

wiiu-things

some Wii U scripts and things
Python
51
star
7

switchfs

FUSE (Filesystem in Userspace) scripts for Nintendo Switch files
Python
49
star
8

nusserver

Custom Nintendo Update Server
Python
35
star
9

pyctr

Python library to interact with Nintendo 3DS files
Python
28
star
10

nuspacker

hard fork of https://bitbucket.org/timogus/nuspacker
Java
28
star
11

9.6-dbgen-xmls

XMLs for 3DS 9.6-crypto titles, for use with *hax 2.7+
20
star
12

discord-mod-mail

Simple mod-mail system for Discord
Python
15
star
13

mashers-gl-updater

program to download and update mashers's grid launcher thing
Lua
15
star
14

ctrnand-title-cia-gen

CIA generator for installed CTRNAND titles
Python
15
star
15

hardmod-b9s-installer

Installs boot9strap through hardmod
Python
13
star
16

screenshot-merge

screenshot merging tool for Nintendo 3DS
Lua
12
star
17

ez3ds

Nintendo 3DS hax helper for noobs
PHP
10
star
18

rebuild-title-database

Rebuilds the contents of title.db for Nintendo 3DS
Python
10
star
19

videoinject

crappy video injector for moflex videos
Python
10
star
20

GM9-lua-attempt

Fork of d0k3/GodMode9 with super experimental Lua support.
C
9
star
21

cmd-gen

Experimental script to generate CMD files for Nintendo 3DS SD titles
Python
9
star
22

panopticon

Log messages in Discord, a la IRC
Python
8
star
23

rc-nand-cleanup

Cleans up NAND titles after an old-style region-swap on Nintendo 3DS
C
7
star
24

dumptik

Dump all tickets from a Nintendo 3DS console
C
6
star
25

save-crypto-finder

Finds and tries to decrypt save files for Nintendo 3DS using a list of Title IDs
Python
6
star
26

panopticon-2

Discord message logger
Python
6
star
27

3DSFlow-downloader

download 3DSFlow banners for mashers's Grid Launcher
Lua
6
star
28

save-data-copy-tool

Copy save data between gamecard and digital versions of games on Nintendo 3DS
Makefile
6
star
29

firmbuilder-docker

Docker image to build Nintendo 3DS FIRM images
Dockerfile
5
star
30

steamos-docker

SteamOS Docker image base
Makefile
5
star
31

firmswap

Nintendo 3DS FIRM partition switcher in Python 3
Python
5
star
32

snes-vc-stuff

Python
4
star
33

seedhelper

A tool to assist users of the seedminer method in communicating. https://seedhelper.figgyc.uk
JavaScript
3
star
34

random-tools

random scripts
Python
3
star
35

gw-save-export-helper

Gateway Save Export Helper
Lua
3
star
36

search-3ds

Nintendo 3DS file searcher in Python
Python
3
star
37

Kurisu-Vita

Bot for Vita Hacking on Discord
Python
3
star
38

another-file-manager

file manager thing for Nintendo 3DS
Lua
3
star
39

mediawiki-extensions-BulkPageCreate

Create multiple pages at once
PHP
2
star
40

test812784

test
2
star
41

gen-title-info-entry

Experimental script to generate the Title Info Entry for title.db
Python
2
star
42

github-actions-sandbox

Python
2
star
43

FAIL

a stupid simple file container
Python
2
star
44

lumatest

2
star
45

downgrade-check

(outdated) check if you have downgraded your Nintendo 3DS properly
Lua
2
star
46

dynarmic

hard fork
C++
1
star
47

nur-packages

my NUR packages
Nix
1
star
48

nix-fusepy-context-test

Python
1
star
49

overwrite-wiiu-titlehash

Overwrite Wii U titlehash to force a system update
Python
1
star
50

ianburgwin.net

PHP
1
star
51

dockerhub-tagging-test

Shell
1
star
52

Mayuri

Tuturu~Discord moderation bot thing
Python
1
star
53

ninjhax2.5-less_services_test

hard fork of smealum's ninjhax2.x repo, testing service removal for boot rate
C
1
star
54

mediawiki-extensions-DownloadWithFilename

Download a file with a different name automatically while saving
PHP
1
star
55

discussion-test

Testing stuff
1
star