ROM Hack ninfs - FUSE filesystem Python scripts for Nintendo console files

ihaveahax

Well-Known Member
OP
Member
Joined
Apr 20, 2015
Messages
5,985
Trophies
2
XP
6,856
Country
United States
ninfs (formerly fuse-3ds) is a collection of scripts that create virtual filesystems using FUSE (Filesystem in Userspace) for Unix-like operating systems, with Windows support through WinFsp.

This enables you to read decrypted contents directly from the source files without extracting (especially useful with large files), and write back data which is automatically re-encrypted. Since it is a virtual filesystem, you can browse it with your file manager (Windows/File Explorer, Finder, some Linux file browser) and use any tools to read from them as if they were normal files (e.g. mount ctrnand/twln/twlp, browse and edit all from/to the raw NAND). All crypto is done by the script transparently to the program.

mainwindow-win.png

Simple GUI to easily use ninfs. Can also be used via a command line.

Some possible use cases:
  • Mount NAND and browse CTRNAND, TWLNAND, TWLPHOTO. Dump, read, and modify files inside these partitions without dumping the full partition first.
  • Browse decrypted SD contents. Dump installed games and saves, or copy contents between two systems SD files by just copying files.
  • Extract decrypted files out of the contents of a CIA without extracting the initial contents first (i.e. don't need to extract large contents to then extract the RomFS/ExeFS, mount the CIA then extract the RomFS/ExeFS directly).
  • Recursive mounting means you only need to mount a CIA, or CCI (".3ds"), or CDN directory, and you will automatically be able to see the NCCH mount, and RomFS/ExeFS mounts inside.
  • NCCH has a virtual decrypted file, allowing you to use it in applications that require decrypted files, like Citra!
  • More will be here when more file types can be mounted!
Requires Python 3.6.1+ and pycryptodomex. appJar is required for the GUI. See repository README for more details.
Windows, macOS and Linux are fully supported.

More details on usage can be found at the source repository:
https://github.com/ihaveamac/ninfs

Get the releases at:
GitHub (Windows & Mac) or GBAtemp Download Center (Windows)

See a Windows tutorial at:
Extract and Decrypt games, NAND backups, and SD contents with ninfs

See example screenshots:
ciamount-win.png
ncchmount-win.png
nandmount-win.png
 
Last edited by ihaveahax,

zoogie

playing around in the dsiware
Developer
Joined
Nov 30, 2014
Messages
8,380
Trophies
2
XP
13,605
Country
Micronesia, Federated States of
Nice! I currently use OSFmount and will be glad to replace it with something more convenient.
 

ihaveahax

Well-Known Member
OP
Member
Joined
Apr 20, 2015
Messages
5,985
Trophies
2
XP
6,856
Country
United States
Nice! I currently use OSFmount and will be glad to replace it with something more convenient.
OSFMount or something would still be needed to mount decrypted FAT partitions, and even then I couldn't get Windows to work properly when writing back to the NAND. hence why mounting is read-only on Windows.
 
  • Like
Reactions: zoogie

Shadowhand

Slim, Alternative Dev.
Member
Joined
Feb 27, 2016
Messages
522
Trophies
0
Age
29
XP
1,861
Country
United Kingdom
Looks very nice, I like FUSE, but I don't get this. Is this only PC?
As in, do I have to dump my NAND image and to be able to use this?
 

ihaveahax

Well-Known Member
OP
Member
Joined
Apr 20, 2015
Messages
5,985
Trophies
2
XP
6,856
Country
United States
Looks very nice, I like FUSE, but I don't get this. Is this only PC?
As in, do I have to dump my NAND image and to be able to use this?
well yes, it's a PC tool. and for NAND, you would have to dump it (create the essentials backup with gm9 to make this easier!). or if you have a hardmod, you can probably read directly from the NAND when plugged in.
 

Shadowhand

Slim, Alternative Dev.
Member
Joined
Feb 27, 2016
Messages
522
Trophies
0
Age
29
XP
1,861
Country
United Kingdom
well yes, it's a PC tool. and for NAND, you would have to dump it (create the essentials backup with gm9 to make this easier!). or if you have a hardmod, you can probably read directly from the NAND when plugged in.
I see. But as far as I can understand, I can use this to manage my save games without having to use JKSM to export them first?
 

ihaveahax

Well-Known Member
OP
Member
Joined
Apr 20, 2015
Messages
5,985
Trophies
2
XP
6,856
Country
United States
I see. But as far as I can understand, I can use this to manage my save games without having to use JKSM to export them first?
raw saves are stored in a really annoying format (DISA) which needs a separate tool. the only one I know of is 3dsfuse, and I'm not sure how well it works with digital saves. I think some others are currently being worked on though.
 

TheMCNerd2017

Well-Known Member
Member
Joined
Jun 21, 2017
Messages
200
Trophies
0
XP
494
Country
United States
You should have also stated that we need "pip" installed as well, to get some of the requirements, especially since the Python installer does not install pip by default.
 
Last edited by TheMCNerd2017,

ihaveahax

Well-Known Member
OP
Member
Joined
Apr 20, 2015
Messages
5,985
Trophies
2
XP
6,856
Country
United States
You should have also stated that we need "pip" installed as well, to get some of the requirements, especially since the Python installer does not install pip by default.
py 3.4+ should have it installed by default. I figured that most people who would be using this would already have pip.
 

TheMCNerd2017

Well-Known Member
Member
Joined
Jun 21, 2017
Messages
200
Trophies
0
XP
494
Country
United States
py 3.4+ should have it installed by default. I figured that most people who would be using this would already have pip.
Well it was not installed when I installed Python 3.6 on my PC. I had to re-download the installer(because I delete installers to save disk space), run it, click on modify, and have it install pip from there.
 

TheMCNerd2017

Well-Known Member
Member
Joined
Jun 21, 2017
Messages
200
Trophies
0
XP
494
Country
United States
OK, sorry for bugging you again, but I managed to get everything working, except for actually mounting the NAND image. Gives me an error saying the mouse point is in use, even though no running applications are using the folder, and nothing is mounted using the folder.

Do you have any idea why it's doing this?
 

ihaveahax

Well-Known Member
OP
Member
Joined
Apr 20, 2015
Messages
5,985
Trophies
2
XP
6,856
Country
United States
OK, sorry for bugging you again, but I managed to get everything working, except for actually mounting the NAND image. Gives me an error saying the mouse point is in use, even though no running applications are using the folder, and nothing is mounted using the folder.

Do you have any idea why it's doing this?
make sure the directory is empty. if you're on windows, make sure the folder is on an NTFS drive. or use a drive letter as a mount point.
 

TheMCNerd2017

Well-Known Member
Member
Joined
Jun 21, 2017
Messages
200
Trophies
0
XP
494
Country
United States
make sure the directory is empty. if you're on windows, make sure the folder is on an NTFS drive. or use a drive letter as a mount point.
The folder is empty and on an NTFS drive. I'll try using a drive letter and see if that works. I use Avast Antivirus if that matters.
EDIT: Tried using a drive letter, and it seemed to work. My open Explorer window locked up when attempting to right-click though, and the mounted image does not appear in My Computer with my other drives.
 
Last edited by TheMCNerd2017,

ihaveahax

Well-Known Member
OP
Member
Joined
Apr 20, 2015
Messages
5,985
Trophies
2
XP
6,856
Country
United States
The folder is empty and on an NTFS drive. I'll try using a drive letter and see if that works. I use Avast Antivirus if that matters.
EDIT: Tried using a drive letter, and it seemed to work. My open Explorer window locked up when attempting to right-click though, and the mounted image does not appear in My Computer with my other drives.
this is really weird. what windows version? 32-/64-bit?

try saving the output. do something like "py -3 mount_nand.py nand.bin F: --do 2>err.log".
 

TheMCNerd2017

Well-Known Member
Member
Joined
Jun 21, 2017
Messages
200
Trophies
0
XP
494
Country
United States
this is really weird. what windows version? 32-/64-bit?

try saving the output. do something like "py -3 mount_nand.py nand.bin F: --do 2>err.log".
Sorry for the late reply, I went out to eat. Either way, here is the info that you probably want.

My OS is 64-bit. I added the --do flag to the end of the command, and the command did not complete. It never said that the service started like it should. Also, a log file was produced and windows keeps spamming "Windows Explorer has stopped working" popups. I have included the contents of the log below.

DEBUG:fuse.log-mixin:-> init / ()
DEBUG:fuse.log-mixin:<- init None
DEBUG:fuse.log-mixin:-> statfs / ()
DEBUG:fuse.log-mixin:<- statfs {'f_bsize': 4096, 'f_blocks': 241408, 'f_bavail': 0, 'f_bfree': 0, 'f_files': 12}
DEBUG:fuse.log-mixin:-> getattr / (None,)
DEBUG:fuse.log-mixin:<- getattr {'st_mode': 16749, 'st_nlink': 2, 'st_ctime': 1507067022, 'st_mtime': 1507067120, 'st_atime': 1507067166, 'st_uid': 4294967295, 'st_gid': 4294967295}
The service python has been started.
DEBUG:fuse.log-mixin:-> getattr /avast! sandbox (None,)
DEBUG:fuse.log-mixin:<- getattr '[Errno 2] No such file or directory'
DEBUG:fuse.log-mixin:-> getattr /avast! sandbox (None,)
DEBUG:fuse.log-mixin:<- getattr '[Errno 2] No such file or directory'
DEBUG:fuse.log-mixin:-> getattr /avast! sandbox (None,)
DEBUG:fuse.log-mixin:<- getattr '[Errno 2] No such file or directory'
DEBUG:fuse.log-mixin:-> getattr /avast! sandbox (None,)
DEBUG:fuse.log-mixin:<- getattr '[Errno 2] No such file or directory'
DEBUG:fuse.log-mixin:-> getattr /avast! sandbox (None,)
DEBUG:fuse.log-mixin:<- getattr '[Errno 2] No such file or directory'
DEBUG:fuse.log-mixin:-> getattr /autorun.inf (None,)
DEBUG:fuse.log-mixin:<- getattr '[Errno 2] No such file or directory'
DEBUG:fuse.log-mixin:-> getattr /## aswSnx private storage (None,)
DEBUG:fuse.log-mixin:<- getattr '[Errno 2] No such file or directory'
DEBUG:fuse.log-mixin:-> getattr /AutoRun.inf (None,)
DEBUG:fuse.log-mixin:<- getattr '[Errno 2] No such file or directory'
DEBUG:fuse.log-mixin:-> getattr /## aswSnx private storage (None,)
DEBUG:fuse.log-mixin:-> getattr / (None,)
DEBUG:fuse.log-mixin:<- getattr '[Errno 2] No such file or directory'
DEBUG:fuse.log-mixin:<- getattr {'st_mode': 16749, 'st_nlink': 2, 'st_ctime': 1507067022, 'st_mtime': 1507067120, 'st_atime': 1507067166, 'st_uid': 197608, 'st_gid': 197121}
DEBUG:fuse.log-mixin:-> getattr /## aswSnx private storage (None,)
DEBUG:fuse.log-mixin:-> getattr / (None,)
DEBUG:fuse.log-mixin:<- getattr '[Errno 2] No such file or directory'
DEBUG:fuse.log-mixin:<- getattr {'st_mode': 16749, 'st_nlink': 2, 'st_ctime': 1507067022, 'st_mtime': 1507067120, 'st_atime': 1507067166, 'st_uid': 197608, 'st_gid': 197121}
DEBUG:fuse.log-mixin:-> getattr /## aswSnx private storage (None,)
DEBUG:fuse.log-mixin:-> opendir / ()
DEBUG:fuse.log-mixin:<- getattr '[Errno 2] No such file or directory'
DEBUG:fuse.log-mixin:<- opendir 0
DEBUG:fuse.log-mixin:-> statfs / ()
DEBUG:fuse.log-mixin:-> statfs / ()
DEBUG:fuse.log-mixin:<- statfs {'f_bsize': 4096, 'f_blocks': 241408, 'f_bavail': 0, 'f_bfree': 0, 'f_files': 12}
DEBUG:fuse.log-mixin:<- statfs {'f_bsize': 4096, 'f_blocks': 241408, 'f_bavail': 0, 'f_bfree': 0, 'f_files': 12}
DEBUG:fuse.log-mixin:-> releasedir / (0,)
DEBUG:fuse.log-mixin:<- releasedir None
DEBUG:fuse.log-mixin:-> getattr / (None,)
DEBUG:fuse.log-mixin:<- getattr {'st_mode': 16749, 'st_nlink': 2, 'st_ctime': 1507067022, 'st_mtime': 1507067120, 'st_atime': 1507067166, 'st_uid': 197608, 'st_gid': 197121}
DEBUG:fuse.log-mixin:-> getattr / (None,)
DEBUG:fuse.log-mixin:<- getattr {'st_mode': 16749, 'st_nlink': 2, 'st_ctime': 1507067022, 'st_mtime': 1507067120, 'st_atime': 1507067166, 'st_uid': 197608, 'st_gid': 197121}
DEBUG:fuse.log-mixin:-> opendir / ()
DEBUG:fuse.log-mixin:<- opendir 0
DEBUG:fuse.log-mixin:-> releasedir / (0,)
DEBUG:fuse.log-mixin:<- releasedir None
 

ihaveahax

Well-Known Member
OP
Member
Joined
Apr 20, 2015
Messages
5,985
Trophies
2
XP
6,856
Country
United States
Sorry for the late reply, I went out to eat. Either way, here is the info that you probably want.

My OS is 64-bit. I added the --do flag to the end of the command, and the command did not complete. It never said that the service started like it should. Also, a log file was produced and windows keeps spamming "Windows Explorer has stopped working" popups. I have included the contents of the log below.

<log>
it did start, the message just got saved to the log instead.

avast (and something else?) seems to try and be using getattr on a nonexistent item:
Code:
DEBUG:fuse.log-mixin:-> getattr /avast! sandbox (None,)
DEBUG:fuse.log-mixin:<- getattr '[Errno 2] No such file or directory'
DEBUG:fuse.log-mixin:-> getattr /avast! sandbox (None,)
DEBUG:fuse.log-mixin:<- getattr '[Errno 2] No such file or directory'
DEBUG:fuse.log-mixin:-> getattr /avast! sandbox (None,)
DEBUG:fuse.log-mixin:<- getattr '[Errno 2] No such file or directory'
DEBUG:fuse.log-mixin:-> getattr /avast! sandbox (None,)
DEBUG:fuse.log-mixin:<- getattr '[Errno 2] No such file or directory'
DEBUG:fuse.log-mixin:-> getattr /avast! sandbox (None,)
DEBUG:fuse.log-mixin:<- getattr '[Errno 2] No such file or directory'
DEBUG:fuse.log-mixin:-> getattr /autorun.inf (None,)
DEBUG:fuse.log-mixin:<- getattr '[Errno 2] No such file or directory'
DEBUG:fuse.log-mixin:-> getattr /## aswSnx private storage (None,)
DEBUG:fuse.log-mixin:<- getattr '[Errno 2] No such file or directory'
DEBUG:fuse.log-mixin:-> getattr /AutoRun.inf (None,)
DEBUG:fuse.log-mixin:<- getattr '[Errno 2] No such file or directory'
DEBUG:fuse.log-mixin:-> getattr /## aswSnx private storage (None,)
DEBUG:fuse.log-mixin:-> getattr / (None,)
I'm not sure if this is causing the system to freeze.

maybe try the same thing with a folder as a mount point. I want to see the error here.
 

TheMCNerd2017

Well-Known Member
Member
Joined
Jun 21, 2017
Messages
200
Trophies
0
XP
494
Country
United States
it did start, the message just got saved to the log instead.

avast (and something else?) seems to try and be using getattr on a nonexistent item:
Code:
DEBUG:fuse.log-mixin:-> getattr /avast! sandbox (None,)
DEBUG:fuse.log-mixin:<- getattr '[Errno 2] No such file or directory'
DEBUG:fuse.log-mixin:-> getattr /avast! sandbox (None,)
DEBUG:fuse.log-mixin:<- getattr '[Errno 2] No such file or directory'
DEBUG:fuse.log-mixin:-> getattr /avast! sandbox (None,)
DEBUG:fuse.log-mixin:<- getattr '[Errno 2] No such file or directory'
DEBUG:fuse.log-mixin:-> getattr /avast! sandbox (None,)
DEBUG:fuse.log-mixin:<- getattr '[Errno 2] No such file or directory'
DEBUG:fuse.log-mixin:-> getattr /avast! sandbox (None,)
DEBUG:fuse.log-mixin:<- getattr '[Errno 2] No such file or directory'
DEBUG:fuse.log-mixin:-> getattr /autorun.inf (None,)
DEBUG:fuse.log-mixin:<- getattr '[Errno 2] No such file or directory'
DEBUG:fuse.log-mixin:-> getattr /## aswSnx private storage (None,)
DEBUG:fuse.log-mixin:<- getattr '[Errno 2] No such file or directory'
DEBUG:fuse.log-mixin:-> getattr /AutoRun.inf (None,)
DEBUG:fuse.log-mixin:<- getattr '[Errno 2] No such file or directory'
DEBUG:fuse.log-mixin:-> getattr /## aswSnx private storage (None,)
DEBUG:fuse.log-mixin:-> getattr / (None,)
I'm not sure if this is causing the system to freeze.

maybe try the same thing with a folder as a mount point. I want to see the error here.
OK, I will attempt to use a folder as the mouse point. By the way, the system itself isn't freezing as I can still open applications from Task Manager and restart explorer through there.
 
General chit-chat
Help Users
    KenniesNewName @ KenniesNewName: BioShock the collection free on epic