wfsdump - PC util for dumping WFS devices (WiiU File System)

Discussion in 'Wii U - Hacking & Backup Loaders' started by EyeKey, Jul 23, 2017.

  1. EyeKey
    OP

    EyeKey GBAtemp Regular

    Member
    194
    425
    Feb 10, 2017
    Israel
    After a lot of research and reversing of the proprietary file system, I finally released wfsdump - a tool for dumping the content of WFS devices. (MLC or USB). wfsdump is a is a quick command line tool that I created that wraps wfslib, the C++ library for WFS that I released among it.
    Right now this library only support reading files. Modifying WFS will require much more work and isn't planned right now, but may happen in the future. (I don't know if or when I will work on it).

    I don't have any plan to release GUI util right now. Feel free to make one using this library.


    The only thing that isn't supported right now are links, which are ignored currently by wfsdump.

    Download (Source)
    see also: wfs-fuse



    Usage
    wfsdump
    Code:
    wfsdump --help
    Code:
    Usage: wfsdump --input <input file> --output <output directory> --otp <opt path> [--seeprom <seeprom path>] [--mlc] [--usb] [--dump-path <directory to dump>] [--verbos]
    Allowed options:
      --help                 produce help message
      --input arg            input file
      --output arg           ouput directory
      --otp arg              otp file
      --seeprom arg          seeprom file (required if usb)
      --dump-path arg (=/)   directory to dump (default: "/")
      --mlc                  device is mlc (default: device is usb)
      --usb                  device is usb
      --verbos               verbos output
    Example
    Dump mlc from backup
    Code:
    wfsdump --input mlc.full.img --output dump_dir --otp otp.bin --mlc
    Dump USB device under Windows
    (Needed to be run with administrator previliges, so run from privileged command line)
    Code:
    wfsdump --input \\.\PhysicalDrive3 --output dump_dir --otp otp.bin --seeprom seeprom.bin
    You need to replace PhsyicalDrive3 with the correct device, you can figure it out with this PowerShell command
    Code:
    Get-WmiObject Win32_DiskDrive
    Dump USB device under Linux
    Code:
    sudo wfsdump --input /dev/sdb --output dump_dir --otp otp.bin --seeprom seeprom.bin

    Build
    Linux
    Install the requirements
    Code:
    sudo apt-get install g++ make libboost-dev libboost-system-dev libboost-filesystem-dev libboost-program-options-dev libcrypto++-dev
    Run the makefile
    Code:
    make wfsdump
    (or make if you want to build all the tools, requires also libfuse-dev)

    Visual Studio
    Visual Studio 2015 project file is provided. This project depends on the libraries boost and Crypto++. Configuration of those libraries include path and lib path is required.
     
    Last edited by EyeKey, Jul 27, 2017


  2. iAqua

    iAqua feel the... envy.

    Member
    GBAtemp Patron
    iAqua is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    2,721
    2,214
    Dec 7, 2015
    Canada
    Naisu!
     
    Jayro likes this.
  3. Peligropowers

    Peligropowers Newbie

    Newcomer
    4
    0
    Jul 16, 2017
    Spain
    Great news. Good work. Thanks.

    Enviado desde mi ALE-L21 mediante Tapatalk
     
  4. proflayton123

    proflayton123 Undeclared Shitposter 2.1

    Member
    5,705
    2,109
    Jan 11, 2016
    Japan
    日本
    Wonderful to see!

    Thanks and nice works!~
     
  5. VinsCool

    VinsCool Delusional

    Member
    GBAtemp Patron
    VinsCool is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    11,705
    27,733
    Jan 7, 2014
    Canada
    Another World
    Fantastic work! That will be really useful!
     
  6. The Real Jdbye

    The Real Jdbye Always Remember 30/07/08

    Member
    GBAtemp Patron
    The Real Jdbye is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    11,832
    5,004
    Mar 17, 2010
    Norway
    Alola
    Awesome work, I know lots of people have been waiting for a tool like this.
     
  7. GotKrypto67

    GotKrypto67 That one PHP guy

    Member
    380
    247
    Jul 21, 2015
    Saint Kitts and Nevis
    The Chamber of Kim
    Awesome. Thanks for your work!
     
  8. piratesephiroth

    piratesephiroth I wish I could read

    Member
    3,001
    1,616
    Sep 5, 2013
    Brazil
    beautiful
     
  9. nastys

    nastys ナースティス

    Member
    1,487
    863
    Aug 5, 2014
    Italy
    Earth
    A FUSE filesystem based on this would be awesome!
     
  10. C0mm4nd_

    C0mm4nd_ Aspirant Wii U homebrew dev :P

    Member
    697
    337
    Oct 9, 2016
    Italy
    Cool :)
     
  11. Valery0p

    Valery0p GBAtemp Regular

    Member
    257
    107
    Jan 16, 2017
    Italy
    Congratulations for your awesome program!
    This is the first step for something bigger on last fw...
    Sorry to bother you, but the MLC key is a per console unique key, right?
     
  12. C0mm4nd_

    C0mm4nd_ Aspirant Wii U homebrew dev :P

    Member
    697
    337
    Oct 9, 2016
    Italy
    yep
     
  13. Jayro

    Jayro MediCat DVD and Mini Windows 10 Developer

    Member
    GBAtemp Patron
    Jayro is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    4,850
    2,586
    Jul 23, 2012
    United States
    Octo Canyon
    This would be so cool implimented into a disc dumper, ripping games right to the USB harddrive, instead of SD card first, then having to install SD to USB.
     
    VinsCool and PokeAcer like this.
  14. piratesephiroth

    piratesephiroth I wish I could read

    Member
    3,001
    1,616
    Sep 5, 2013
    Brazil
    @EyeKey Could this be adapted to reencrypt the files (without modification) with a different key?
    I mean, could you skip the additional troublesome operations by keeping the the metadata (hashes, owners, permissions, IVs, etc) in a separate file and use that to reencrypt the dumped files?
     
    Last edited by piratesephiroth, Jul 24, 2017
  15. EyeKey
    OP

    EyeKey GBAtemp Regular

    Member
    194
    425
    Feb 10, 2017
    Israel
    I am not planning to do it. (it is open-source, so if someone else want to do it..).
    And right now I don't even parse everything in the filesystem, the Area object is pointing to few more metadata blocks that I don't read or parse at all, and they need to be reencrypted too, and I have no idea if they point to more metadata pages, they probably do.

    And another small thought, you don't even need to know the correct IV of each block to decrypt and reencrypt it correctly, because it is CBC, but you do need to know where each block start and end, and there are different sizes of blocks (0x1000, 0x2000, 0x8000). (So you need to parse the filesystem anyway...)
     
    Last edited by EyeKey, Jul 24, 2017
    piratesephiroth likes this.
  16. EyeKey
    OP

    EyeKey GBAtemp Regular

    Member
    194
    425
    Feb 10, 2017
    Israel
    Added Linux support.
     
    ihaveamac, C0mm4nd_ and nastys like this.
  17. ihaveamac

    ihaveamac GBAtemp Guru

    Member
    5,398
    5,842
    Apr 20, 2015
    United States
    Tigard, OR
    thanks for your work on the wfs format, I appreciate it.

    any chance of proper macOS support? I was trying to build this on 10.12.6 but ran into some errors... I used Homebrew to get the dependencies ("brew install boost cryptopp"), then tried to build wfslib/wfslib, and this is the output (note g++ is actually clang)
    Warning: Spoilers inside!
    to use actual g++ (from brew, replacing CXX with g++-7 in wfslib/wfslib/Makefile) results in no errors. but then wfslib/wfsdump doesn't build for some reason (regardless of compiler)
    Warning: Spoilers inside!
    I may just be missing something, I don't know.
     
  18. EyeKey
    OP

    EyeKey GBAtemp Regular

    Member
    194
    425
    Feb 10, 2017
    Israel
    Thank for your report, I have fixed those error, now you can compile this project with clang.
    About the second one, check out this: https://stackoverflow.com/questions...gram-options-on-mac-os-x-with-g-4-8-mac-ports
    you need to get the right variant of boost (but you should probably use clang)

    If you don't want to compile the new fuse app (will fail on mac?) just run "make wfsdump" to compile only wfsdump.
     
    Last edited by EyeKey, Jul 27, 2017
  19. ihaveamac

    ihaveamac GBAtemp Guru

    Member
    5,398
    5,842
    Apr 20, 2015
    United States
    Tigard, OR
    wfslib builds with clang now (no errors/warnings), but wfsdump now produces some new errors.
    Warning: Spoilers inside!
    I did also just try to build wfs-fuse and some of the errors seemed similar
    Warning: Spoilers inside!
     
    Last edited by ihaveamac, Jul 27, 2017
  20. EyeKey
    OP

    EyeKey GBAtemp Regular

    Member
    194
    425
    Feb 10, 2017
    Israel
    I think that I fixed it, can you try again?