Verify WUP Installer files?

Discussion in 'Wii U - Homebrew' started by pelago, Apr 1, 2017.

  1. pelago
    OP

    pelago Member

    Member
    988
    51
    Feb 20, 2006
    Is there already, or is it technically possible to create, an app to verify that games in WUP Installer format (i.e. *.app, *.h3, title.cert, title.tik, title.tmd) have all files present and correct?

    I had a problem installing a couple of titles, which after a lot of checking (and unnecessary reformatting of SD card with different cluster sizes), turned out to be a corrupt downloaded .app file.

    It would be great to be able to verify these downloads before trying to install them. If you only find out about a corrupt .app at install time, you end up with a partial install, which can be a pain to remove.

    I can imagine use cases for such a verifier app on both the Wii U itself (could be bundled into WUP Installer), and on a computer for "offline" verifying.

    I don't know enough about how it works to know if it is even technically possible to verify on a computer, e.g. using the info in the various title.* files to check the *.app files.
     
  2. 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,002
    Mar 17, 2010
    Norway
    Alola
    You could extract the files with a PC. If any files are corrupted it should error when it gets to the corrupted files.
     
    pelago likes this.
  3. nexusmtz

    nexusmtz GBAtemp Maniac

    Member
    1,252
    433
    Feb 17, 2016
    United States
    WiiU USB Helper already includes this feature. JNUSTool will catch incomplete .app files (wrong size), but it doesn't check the extraction.
     
    Ghassen-ga and pelago like this.
  4. pelago
    OP

    pelago Member

    Member
    988
    51
    Feb 20, 2006
    Thanks. I've found that FunkiU will also find size mismatches, but doesn't notice problems that can occur if the size is correct.

    Thanks for the tip on Wii U USB Helper. I'm really looking for something more Linux-friendly and open source. Maybe a command like "wiiuverify <foldername>" or "wiiuverify *" to verify all folders. I understand now that the TMD file can be used for this.
     
    Last edited by pelago, Apr 6, 2017
  5. Cyan

    Cyan GBATemp's lurking knight

    Global Moderator
    18,045
    8,564
    Oct 27, 2002
    France
    Engine room, learning
    The tmd has the hash of the extracted file, so the tool needs to extract the file to know if it's good or bad.
    WiiU USB Helper is extracting all downloaded files temporarily in memory while the file is downloaded.
    JNUSTool only checks the size, so like you said it could be corrupted but with the same size. I tried to edit one of the .app and used it to open the FST but it didn't find any issue, you'll need to extract the game to your PC to catch any errors.

    I think only USBHelper is doing it in memory without extracting all files to hard drive, and it's doing it while downloading only. you can't use it to verify an already downloaded file using a different program. Maybe the author could add a verification option.
    Though, there's a "import from another tool" feature, I'll ask the author if it's checking the files at the same time.
    edit: asked here

    edit:
    author replied there's a "verify" feature :)
     
    Last edited by Cyan, Apr 2, 2017
    pelago likes this.
  6. nexusmtz

    nexusmtz GBAtemp Maniac

    Member
    1,252
    433
    Feb 17, 2016
    United States
    When you have something in the 'downloaded' state in WiiU USB Helper (as the result of a download or import), the 'Get it' button changes to 'Verify'. If you click Verify, the title is added to the download queue and the smart downloading handles the verification. It looks like this as it's working:
    helperchecking.jpg
     
    pelago likes this.
  7. pelago
    OP

    pelago Member

    Member
    988
    51
    Feb 20, 2006
    Thanks. Good to hear that it can be verified with the TMD, although you would need to decrypt (in memory or on disk) first. Presumably the code in cdecrypt could be used as a basis for a Windows/Mac/Linux open-source app, or even a Wii U app.
     
  8. nexusmtz

    nexusmtz GBAtemp Maniac

    Member
    1,252
    433
    Feb 17, 2016
    United States
    I can't tell if you're hoping or volunteering. If it's the former, see if the idea has already been added to the Hombrew Request sticky.
     
  9. pelago
    OP

    pelago Member

    Member
    988
    51
    Feb 20, 2006
    I'm hoping, but also doing a little research to try and offer implementation tips to a potential dev. I don't see anything like this in that sticky so will link to this thread there.
     
    Last edited by pelago, Apr 2, 2017
    nexusmtz likes this.