fuse-3ds - FUSE Filesystem Python scripts for Nintendo 3DS files

Discussion in '3DS - ROM Hacking, Translations and Utilities' started by ihaveamac, Sep 7, 2017.

  1. TheMCNerd2017

    TheMCNerd2017 Advanced Member

    Newcomer
    74
    14
    Jun 21, 2017
    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.

    Log from Safe Mode

    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.

    Log from Normal Mode

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

    ihaveamac GBAtemp Guru

    Member
    5,583
    6,285
    Apr 20, 2015
    United States
    Tigard, OR
    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.
     
  3. TheMCNerd2017

    TheMCNerd2017 Advanced Member

    Newcomer
    74
    14
    Jun 21, 2017
    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.
     
    Last edited by TheMCNerd2017, Oct 4, 2017
  4. ihaveamac
    OP

    ihaveamac GBAtemp Guru

    Member
    5,583
    6,285
    Apr 20, 2015
    United States
    Tigard, OR
    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.
     
  5. TheMCNerd2017

    TheMCNerd2017 Advanced Member

    Newcomer
    74
    14
    Jun 21, 2017
    United States
    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.
     
  6. billziss

    billziss Newbie

    Newcomer
    5
    6
    Oct 4, 2017
    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).
     
  7. ihaveamac
    OP

    ihaveamac GBAtemp Guru

    Member
    5,583
    6,285
    Apr 20, 2015
    United States
    Tigard, OR
    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.
     
  8. billziss

    billziss Newbie

    Newcomer
    5
    6
    Oct 4, 2017
    United States
    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).
     
  9. ihaveamac
    OP

    ihaveamac GBAtemp Guru

    Member
    5,583
    6,285
    Apr 20, 2015
    United States
    Tigard, OR
  10. ihaveamac
    OP

    ihaveamac GBAtemp Guru

    Member
    5,583
    6,285
    Apr 20, 2015
    United States
    Tigard, OR
    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.
     
    d0k3 and VinsCool like this.
  11. billziss

    billziss Newbie

    Newcomer
    5
    6
    Oct 4, 2017
    United States
    Just to let everyone know that with the help of people from Avast, the reported BSOD has been resolved. The fix is in the master branch of the WinFsp project and should be included in the v1.2B2 binary release, hopefully out sometime next week.
     
    Last edited by billziss, Oct 20, 2017
    TheMCNerd2017, VinsCool and ihaveamac like this.
  12. ihaveamac
    OP

    ihaveamac GBAtemp Guru

    Member
    5,583
    6,285
    Apr 20, 2015
    United States
    Tigard, OR
  13. billziss

    billziss Newbie

    Newcomer
    5
    6
    Oct 4, 2017
    United States
    Indeed :)

    This includes the reported BSOD fix and some other fixes and improvements. I encourage everyone to try the latest release, especially those who had problems with Avast+WinFsp before.
     
  14. TheMCNerd2017

    TheMCNerd2017 Advanced Member

    Newcomer
    74
    14
    Jun 21, 2017
    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.
     
  15. billziss

    billziss Newbie

    Newcomer
    5
    6
    Oct 4, 2017
    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, Nov 1, 2017
  16. TheMCNerd2017

    TheMCNerd2017 Advanced Member

    Newcomer
    74
    14
    Jun 21, 2017
    United States
    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.
     
  17. Xyphoseos

    Xyphoseos Hack or no games

    Member
    1,179
    113
    Jun 29, 2016
    France
    Rivière
    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
     
  18. ihaveamac
    OP

    ihaveamac GBAtemp Guru

    Member
    5,583
    6,285
    Apr 20, 2015
    United States
    Tigard, OR
    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 ihaveamac, Dec 2, 2017
    Xyphoseos likes this.
  19. Xyphoseos

    Xyphoseos Hack or no games

    Member
    1,179
    113
    Jun 29, 2016
    France
    Rivière
    I only have otp.bin and nand.bin :(
     
  20. ihaveamac
    OP

    ihaveamac GBAtemp Guru

    Member
    5,583
    6,285
    Apr 20, 2015
    United States
    Tigard, OR
    if you don't have the nand cid, you can't use this unfortunately. do you not have access to the console? is the essentials backup not in the nand?
     
Loading...