[RELEASE] WFS File Injector

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

  1. EyeKey
    OP

    EyeKey GBAtemp Regular

    Member
    196
    428
    Feb 10, 2017
    Israel
    After @dimok released the WFS Block Injector and was able to install haxchi with it, it occurred to me that there is no need to allocate new file system blocks or change the directory tree to install haxchi (which is why I haven't add full modifying capabilities yet).
    So I added to wfslib basic editing capabilities. You can change the content and the size of any file, up to the already allocated size of the file on the disk.
    wfs-file-injector is a tool that wrap this capability and allow you to inject files.

    In the next few days I hope to release an automatic PC haxchi installer, but right now you can do it manually with this tool, just inject the correct rom.zip

    WARNING: It is very experimental, and may corrupt your file system. Use at your own risk and make sure to backup the image before.
    Download (Source)
    see also: wfsdump, wfs-fuse


    Code:
    Usage: wfs-file-injector --image <wfs image> --inject-file <file to inject> --inject-path <file path in wfs> --otp <opt path> [--seeprom <seeprom path>] [--mlc] [--usb]
    Allowed options:
      --help                produce help message
      --image arg           wfs image file
      --inject-file arg     file to inject
      --inject-path arg     wfs file path to replace
      --otp arg             otp file
      --seeprom arg         seeprom file (required if usb)
      --mlc                 device is mlc (default: device is usb)
      --usb                 device is usb
    Example:
    Inject rom.zip

    Code:
    wfsdump --image usb.img --inject-file rom.zip --inject-path /usr/title/00050000/101c3500/content/0010/rom.zip --otp otp.bin --seeprom seeprom.bin
     
    Last edited by EyeKey, Aug 5, 2017
  2. KiiWii

    KiiWii GBAtemp Psycho!

    Member
    3,816
    1,339
    Nov 17, 2008
    United Kingdom
    Amazing work, props to you and @dimok
     
    peteruk likes this.
  3. dimok

    dimok GBAtemp Advanced Fan

    Member
    728
    2,174
    Jan 11, 2009
    United States
    Nice work again @EyeKey! My tool became obselete very quick ;).
     
  4. EyeKey
    OP

    EyeKey GBAtemp Regular

    Member
    196
    428
    Feb 10, 2017
    Israel
    I created an automatic tool to install haxchi: https://github.com/koolkdev/haxchi-pc-installer
    I will open a thread on it once I will know that it works. Can anyone test it? I tested the wfs modification, but I can't try the usb on my WiiU right now.
    Usage:
    haxchi-pc-installer --image <wfs image> --otp <opt path> [--seeprom <seeprom path>] [--mlc] [--usb (default)]
     

    Attached Files:

    Last edited by EyeKey, Aug 6, 2017
    KiiWii, peteruk, Corredor and 3 others like this.
  5. Maschell

    Maschell GBAtemp Advanced Fan

    Member
    903
    1,322
    Jun 14, 2008
    Gambia, The
    Nice job
     
    KiiWii and Masterwin like this.
  6. jayden485

    jayden485 Newbie

    Newcomer
    1
    0
    Jul 18, 2017
    Australia
    So to use this I need the otp.bin, seeprom.bin dumped from before I updated to 5.5.2, correct?

    Anyways nice work!
     
  7. nexusmtz

    nexusmtz GBAtemp Maniac

    Member
    1,263
    436
    Feb 17, 2016
    United States
    Other than the usage message in the program, a minimal test seemed to work properly. Thanks!

    Here is how I tested, since it wasn't a perfectly clean test (but probably good enough for what you're testing here):

    Inserted a small (256MB) flash drive into my WiiU 5.5.1 US console
    Allowed the WiiU to format it
    Ran existing Haxchi sysmenu
    Opened HBL channel
    Used WupInstaller Y Mod to install fake-ticketed Kirby CC (USA) to USB
    Shut down WiiU
    Imaged drive on PC using Passmark ImageUSB (probably better choices out there for that)
    Removed ImageUSB header block from image using hxd
    Ran haxchi-pc-installer with parameters per your instruction
    Kirby was detected and confirmed
    Copied the image back to USB with ImageUSB
    Booted WiiU with USB inserted
    Ran existing Haxchi sysmenu (for sigpatching)
    Ran Kirby
    HBL started
     
    paulloeduardo and EyeKey like this.
  8. krueger96

    krueger96 Advanced Member

    Newcomer
    84
    14
    Dec 21, 2016
    Italy
    This is great, especially for those with slow internet connections (like me) that struggle to handle ftp transfers. I'm on 5.5.0 right now, i already have haxchi installed, i would like to update but don't want to lose homebrew access. just in case my haxchi ever become corrupted, will i be able to re inject it back once i'm on 5.5.2 or do i need something else?
     
  9. nexusmtz

    nexusmtz GBAtemp Maniac

    Member
    1,263
    436
    Feb 17, 2016
    United States
    You need your otp and seeprom. The injection isn't tied to any OS version since it's done on the PC. Dimok's injection worked on 5.5.2 so this logically should as well.
     
  10. krueger96

    krueger96 Advanced Member

    Newcomer
    84
    14
    Dec 21, 2016
    Italy
    I see. Considering that i have haxchi, should i back it up now, or update first?
     
  11. nexusmtz

    nexusmtz GBAtemp Maniac

    Member
    1,263
    436
    Feb 17, 2016
    United States
    Get the backup now, and don't update unless you have a good reason to.
     
    krueger96 likes this.
  12. krueger96

    krueger96 Advanced Member

    Newcomer
    84
    14
    Dec 21, 2016
    Italy
    ok thanks, i got a little confused and thought that with this tool was safe to update
     
  13. C0mm4nd_

    C0mm4nd_ Aspirant Wii U homebrew dev :P

    Member
    697
    337
    Oct 9, 2016
    Italy
    it's safe anyway if you have haxchi/cbhc
     
  14. ruiner9

    ruiner9 Member

    Newcomer
    31
    20
    Nov 14, 2012
    United States
    OK, I'm on vanilla 5.5.2, but I have my seeprom, OTP, etc. backed up to my PC. What steps do I follow to test this out?

    EDIT: I'm attempting to build the image for my USB but I'm getting a [Unexpected WFS version (bad key?)] error. I've also tried fixing the SLC and SLCCMPT files using NANDfixer, which creates new "fixed" files but I'm still getting the same error with those. Anything else I can try?

    Also I'm a bit foggy on what I need to do with the .nds files. I have a purchased copy of Brain Age I can use but I'm not sure what to do with the files that are in the /data folder (if anything.)
     
    Last edited by ruiner9, Aug 6, 2017
  15. EyeKey
    OP

    EyeKey GBAtemp Regular

    Member
    196
    428
    Feb 10, 2017
    Israel
    Thank you for testing.


    And for those who downloaded this tool, I found some bug that may cause corruption to the file in some rare cases (probably didn't happen to anyone), so it is recommended to download the latest version. (Hopefully I got it right time time)
     
    Last edited by EyeKey, Aug 7, 2017
  16. AzerothArg

    AzerothArg Advanced Member

    Newcomer
    57
    13
    Apr 27, 2014
    Argentina
    It is possible to install a game from pc, like it were installed by WUP Installer? Kinda like you can do with Wii Backup Manager on the Wii?