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

TheMCNerd2017

Well-Known Member
Member
Joined
Jun 21, 2017
Messages
200
Trophies
0
XP
514
Country
United States
OK, I tried mounting to a folder, both in Safe Mode and normal mode, and here are the results...

Safe Mode didn't work, since services required for the python script to function are disabled by default. Here is the log, although it is not helpful.

Cannot create WinFsp-FUSE file system: unspecified error.
Traceback (most recent call last):
File "E:\My Stuff\3DS Stuff\Mount_NAND_SD\MyO3DS\mount_nand.py", line 521, in <module>
fuse = FUSE(NANDImage(), a.mount_point, foreground=a.fg or a.do, fsname=os.path.realpath(a.nand), ro=readonly, **opts)
File "C:\Users\Nicholas\AppData\Local\Programs\Python\Python36-32\lib\site-packages\fuse.py", line 542, in __init__
raise RuntimeError(err)
RuntimeError: 1

So then I attempted it while in normal mode, which did not work either. The error log it outputted complained about the directory being in use. This time, however, right-click menu would not cause explorer to crash.

Cannot create WinFsp-FUSE file system: mount point in use.
Traceback (most recent call last):
File "E:\My Stuff\3DS Stuff\Mount_NAND_SD\MyO3DS\mount_nand.py", line 521, in <module>
fuse = FUSE(NANDImage(), a.mount_point, foreground=a.fg or a.do, fsname=os.path.realpath(a.nand), ro=readonly, **opts)
File "C:\Users\Nicholas\AppData\Local\Programs\Python\Python36-32\lib\site-packages\fuse.py", line 542, in __init__
raise RuntimeError(err)
RuntimeError: 1

Seems like something may be actively blocking the image from being mounted.
 

ihaveahax

Well-Known Member
OP
Member
Joined
Apr 20, 2015
Messages
6,069
Trophies
2
XP
7,805
Country
United States
OK, I tried mounting to a folder, both in Safe Mode and normal mode, and here are the results...

Safe Mode didn't work, since services required for the python script to function are disabled by default. Here is the log, although it is not helpful.

Cannot create WinFsp-FUSE file system: unspecified error.
Traceback (most recent call last):
File "E:\My Stuff\3DS Stuff\Mount_NAND_SD\MyO3DS\mount_nand.py", line 521, in <module>
fuse = FUSE(NANDImage(), a.mount_point, foreground=a.fg or a.do, fsname=os.path.realpath(a.nand), ro=readonly, **opts)
File "C:\Users\Nicholas\AppData\Local\Programs\Python\Python36-32\lib\site-packages\fuse.py", line 542, in __init__
raise RuntimeError(err)
RuntimeError: 1

So then I attempted it while in normal mode, which did not work either. The error log it outputted complained about the directory being in use. This time, however, right-click menu would not cause explorer to crash.

Cannot create WinFsp-FUSE file system: mount point in use.
Traceback (most recent call last):
File "E:\My Stuff\3DS Stuff\Mount_NAND_SD\MyO3DS\mount_nand.py", line 521, in <module>
fuse = FUSE(NANDImage(), a.mount_point, foreground=a.fg or a.do, fsname=os.path.realpath(a.nand), ro=readonly, **opts)
File "C:\Users\Nicholas\AppData\Local\Programs\Python\Python36-32\lib\site-packages\fuse.py", line 542, in __init__
raise RuntimeError(err)
RuntimeError: 1

Seems like something may be actively blocking the image from being mounted.
try running command prompt in administrator mode. this shouldn't be required (point of FUSE is it's in user space) but it's worth a shot.
 

TheMCNerd2017

Well-Known Member
Member
Joined
Jun 21, 2017
Messages
200
Trophies
0
XP
514
Country
United States
try running command prompt in administrator mode. this shouldn't be required (point of FUSE is it's in user space) but it's worth a shot.
I was running command prompt in admin mode all of the previous times as well as the times above. Also, when mounting to a drive letter, it actually appeared in my computer, but attempting to access the virtual drive caused the computer to BSOD with BBCode 50.

I searched BBCode 50 on Google, and it seems to be related to Faulty Hardware, although a corrupted NTFS volume or Antivirus can trigger the error. I also used a tool to see exactly what caused the BSOD to come up, and a file called winfsp-x64.sys was one of the drivers that caused the crash. Seems to be related to WinFsp considering the name.

EDIT: Just figured it out. It's Avast causing the issue as well as other antivirus products like AVG. Other people are having the problem with winfsp, which is what your script uses. https://github.com/billziss-gh/winfsp/issues/97 is where I found this out. Unfortunately, the creators of Avast simply do not care and have not fixed the issue, even though they have been notified by several people about this. Perhaps until the creators of Avast start listening to incompatibilities and fix this issue, you should state in the OP that the script wont work and can possibly cause the computer to crash if Avast is installed.
 
Last edited by TheMCNerd2017,

ihaveahax

Well-Known Member
OP
Member
Joined
Apr 20, 2015
Messages
6,069
Trophies
2
XP
7,805
Country
United States
I was running command prompt in admin mode all of the previous times as well as the times above. Also, when mounting to a drive letter, it actually appeared in my computer, but attempting to access the virtual drive caused the computer to BSOD with BBCode 50.

I searched BBCode 50 on Google, and it seems to be related to Faulty Hardware, although a corrupted NTFS volume or Antivirus can trigger the error. I also used a tool to see exactly what caused the BSOD to come up, and a file called winfsp-x64.sys was one of the drivers that caused the crash. Seems to be related to WinFsp considering the name.

EDIT: Just figured it out. It's Avast causing the issue as well as other antivirus products like AVG. Other people are having the problem with winfsp, which is what your script uses. https://github.com/billziss-gh/winfsp/issues/97 is where I found this out. Unfortunately, the creators of Avast simply do not care and have not fixed the issue, even though they have been notified by several people about this. Perhaps until the creators of Avast start listening to incompatibilities and fix this issue, you should state in the OP that the script wont work and can possibly cause the computer to crash if Avast is installed.
have you tried not running it in administrator mode? or if you do it in admin, add "-o allow_other".

I suppose I'll add that then if it's a common issue. in the mean time I don't know what else to tell you.
 

TheMCNerd2017

Well-Known Member
Member
Joined
Jun 21, 2017
Messages
200
Trophies
0
XP
514
Country
United States
have you tried not running it in administrator mode? or if you do it in admin, add "-o allow_other".

I suppose I'll add that then if it's a common issue. in the mean time I don't know what else to tell you.
Doesn't matter if you run it as admin or not, I have tried it several times. It's an incompatibility with Avast and one of your script's dependencies. I am probably going to write up a post about this on the 3dshacks subreddit informing people about the issue.
 

billziss

Member
Newcomer
Joined
Oct 4, 2017
Messages
5
Trophies
0
Age
52
XP
58
Country
United States
Hi, I am Bill Zissimopoulos the author of WinFsp. By an extraordinary coincidence (my son got his very first 2ds recently and I was looking for related hacking/tools) I found this page.

There is indeed an incompatibility of WinFsp with Avast. I have contacted the Avast people with a detailed bug report about this, but have not heard back from them. I will try pinging them again, but it would be good if we had a solid contact with them in order to get some traction.

BTW, this problem will happen regardless if you run the file system as administrator or not. In general you should avoid running a file system as administrator, because you cannot access administrator drives as a normal user (i.e. they will not be visible in Explorer).
 

ihaveahax

Well-Known Member
OP
Member
Joined
Apr 20, 2015
Messages
6,069
Trophies
2
XP
7,805
Country
United States
Hi, I am Bill Zissimopoulos the author of WinFsp. By an extraordinary coincidence (my son got his very first 2ds recently and I was looking for related hacking/tools) I found this page.

There is indeed an incompatibility of WinFsp with Avast. I have contacted the Avast people with a detailed bug report about this, but have not heard back from them. I will try pinging them again, but it would be good if we had a solid contact with them in order to get some traction.

BTW, this problem will happen regardless if you run the file system as administrator or not. In general you should avoid running a file system as administrator, because you cannot access administrator drives as a normal user (i.e. they will not be visible in Explorer).
surprised to see you here, but that's pretty cool.

I'm not entirely familiar with WinFsp (or FUSE) yet. I never caught things like this because most of my Windows testing is done inside a win7 virtual machine with no AV (didn't bother setting one up due to the limited things I do in it). I do most of my actual development and testing on macOS.

I knew that it should always be run from a normal user (hence filesystem in userspace), but ¯\_(ツ)_/¯

but anyway, hope that gets fixed soon. I don't really want to tell people to remove their AV just to use this.
 

billziss

Member
Newcomer
Joined
Oct 4, 2017
Messages
5
Trophies
0
Age
52
XP
58
Country
United States
but anyway, hope that gets fixed soon. I don't really want to tell people to remove their AV just to use this.

I agree. I have pinged the Avast people again, hopefully we will get some response this time. I also have a theory on why this may be happening, but if my theory is correct there is nothing I can do on the WinFsp side to fix it. In fact if my theory is correct, the problem could also happen with NTFS and FAT in some rare circumstances.

I also note that Microsoft's own Windows Defender does not exhibit this issue (but I have been told that Avast may be better at catching malware).
 

ihaveahax

Well-Known Member
OP
Member
Joined
Apr 20, 2015
Messages
6,069
Trophies
2
XP
7,805
Country
United States
a few more scripts have been added: https://github.com/ihaveamac/fuse-3ds
  • CCI (".3ds"): show virtual files of the different partitions, plus cardinfo and devinfo.
  • RomFS: browse the entire RomFS contents in a virtual filesystem.
  • NCCH: the most important one, you can access decrypted NCCH sections now. this basically completes the whole chain now. you can mount several things in order (i.e. mount your SD contents, then mount the .app of the title you want, then mount the romfs to get some files out of it).
with that I'm considering this mostly complete now. most of the important formats can now be mounted: CCI, raw CDN contents, CIA, NAND, NCCH, RomFS, and SD. (ExeFS may come, but it's pretty small so I didn't get to it)

example usage for Windows to mount a Pokémon Moon CIA, then the NCCH, and RomFS to copy files out of it:
Code:
py -3 mount_cia.py 0004000000175E00.cia F:
py -3 mount_ncch.py F:\0000.00000002.ncch G:
py -3 mount_romfs.py G:\romfs.bin H:
copy H:\data\sound\*_xy_*.bcstm .
(to unmount each, press Ctrl+C in cmd)

special thanks to @d0k3 to helping me figure out how to read RomFS.
 
  • Like
Reactions: d0k3 and VinsCool

TheMCNerd2017

Well-Known Member
Member
Joined
Jun 21, 2017
Messages
200
Trophies
0
XP
514
Country
United States
Just tried installing the new version of WinFsp, and now Avast is causing the install to hang at starting the services. Apparently it doesn't trust the launcher-x64.exe file for some reason, which did not happen the last time with the previous version.
 

billziss

Member
Newcomer
Joined
Oct 4, 2017
Messages
5
Trophies
0
Age
52
XP
58
Country
United States
Sorry for late response. I do not check here regularly. Best to msg me on GitHub for such issues.

I do not know why Avast is stopping the services from starting. It does not do so on my systems, nor have I had this reported by anyone else so far. Perhaps it is a local problem?
 
Last edited by billziss,

TheMCNerd2017

Well-Known Member
Member
Joined
Jun 21, 2017
Messages
200
Trophies
0
XP
514
Country
United States
Sorry for late response. I do not check here regularly. Best to msg me on GitHub for such issues.

I do not know why Avast is stopping the services from starting. It does not do so on my systems, nor have I had this reported by anyone else so far. Perhaps it is a local problem?
It was the behavior shield claiming it was "really rare", and it sent the file to Avast's servers to be decompiled and tested for malware. I was able to load it just fine after a few hours.
 

ihaveahax

Well-Known Member
OP
Member
Joined
Apr 20, 2015
Messages
6,069
Trophies
2
XP
7,805
Country
United States
I don't know exactly whan I must to do to mount the nand image, I have nand.bin otp.bin and I'm on ubuntu 17.10
do you have the nand cid? you can dump this with gm9. you can also embed the essentials backup using it.

install the required dependencies:
Code:
pip3 install pycryptodomex git+https://github.com/billziss-gh/fusepy.git

clone or download the repository, then do:
Code:
python3 mount_nand.py --otp otp.bin --cid nandcid nand.bin mountdir
mountdir must already exist. if the essentials backup is embedded, --otp and --cid are not needed.
 
Last edited by ihaveahax,
  • Like
Reactions: Xyphoseos

Xyphoseos

Hack or no games
Member
Joined
Jun 29, 2016
Messages
1,832
Trophies
0
Age
23
Location
Rivière
XP
3,235
Country
France
do you have the nand cid? you can dump this with gm9. you can also embed the essentials backup using it.

install the required dependencies:
Code:
pip3 install pycryptodomex git+https://github.com/billziss-gh/fusepy.git

clone or download the repository, then do:
Code:
python3 mount_nand.py --otp otp.bin --cid nandcid nand.bin mountdir
mountdir must already exist. if the essentials backup is embedded, --otp and --cid are not needed.
I only have otp.bin and nand.bin :(
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • K3Nv2 @ K3Nv2:
    From what people say pvp isn't even worth it
  • BigOnYa @ BigOnYa:
    I just been playing offline, and they give you a few bots here n there on your team to help battle. I don't think it's as funny as the other games tho, more battle oriented than humor, which kinda sucks, but I'm still early in it
  • Xdqwerty @ Xdqwerty:
    @BigOnYa, doesnt the game have a campaign mode?
  • BigOnYa @ BigOnYa:
    Yea, and co-op, but you can also start a pvp session and battle just with friends. You get special skill cards (powers) the more you play. And higher value cards, but you can only enable so many cards at a time.
  • K3Nv2 @ K3Nv2:
    If you can find enough for it
  • BigOnYa @ BigOnYa:
    Toilet paper is considered the money, you collect and buy stuff with TP, kinda funny. Graphics are def better than the other games tho, I think they used Unity 5 engine.
  • Psionic Roshambo @ Psionic Roshambo:
    Look if I zoom in enough I can see the herpes!!!
    +1
  • BigOnYa @ BigOnYa:
    In fact I'm gonna go make a drink, roll a fatty n play some, good night to all!
    +2
  • Xdqwerty @ Xdqwerty:
    I bet most people at the time still watched it in black and white
  • SylverReZ @ SylverReZ:
    @Xdqwerty, Many of them did before colour television was common.
  • SylverReZ @ SylverReZ:
    Likely because black and white TV was in-expensive.
    +1
  • K3Nv2 @ K3Nv2:
    It certainly wasn't inexpensive it cost the same as a new car back then
  • K3Nv2 @ K3Nv2:
    How much did a 1965 color TV cost?

    For example, a 21-inch (diagonal) GE color television in 1965 had an advertised price of $499, which is equal to $4,724 in today's dollars, according to the federal government's inflation calculator.
    +1
  • Xdqwerty @ Xdqwerty:
    @K3Nv2, take into consideration how economy was back then
  • K3Nv2 @ K3Nv2:
    Yeah that's why they listed inflation rates
  • Xdqwerty @ Xdqwerty:
    Sorry didnt read that part
  • BakerMan @ BakerMan:
    @LeoTCK don't worry i knew he was joking
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    My first color TV was like 1984 or something lol
  • Psionic Roshambo @ Psionic Roshambo:
    19 inches it was glorious lol
  • SylverReZ @ SylverReZ:
    @Psionic Roshambo, If it doesn't fit, you should've gotten one smaller lol
    +1
  • SylverReZ @ SylverReZ:
    If a racoon can fit up to 8-inches then so be it
    SylverReZ @ SylverReZ: If a racoon can fit up to 8-inches then so be it