- - - - - -__- - -.- - - -.- - -.- - -.- - \|/.- - -.- - -.-__- -.- - - -
 .  .  ___/ |__ .    __ .   .  .  .     . --O--.  __  . ___/ | _____ .  .
       \__ +   \ ___/ |__      __    .  __ /|\___/ |__  \__  |/ +  /   .
  .   . /   | + \\__     \ ___/ |__.___/ |__  \__     \ ./   |    / .
    .  /+   |    \/  _|   \\__     \\__     \  /   |   \/ +   +  /_   .
.     /     |+    \  \_    \/   |   \/   |   \/    |    \    |     \ .  .
   . /    + |   +  \_ |     \_  |    \_  |    \_   |     \_+ |  +   \ .
.  _/  +    |_______/ |______/  |_____/  ______/   _______/  |       \_ .
  .\      + |==\______|===\_____|==\_____|==\______|==\______|+    +  /
- - \_______| - - - - - - -  Proudly Presents  - - - - - - - |_______/ - -

                          SWiiT (Super Wii Tools)
                   SWUU (Super Wii Ultimate Unscrubber)
                        SWAT (Super Wii Audit Tool)
                SWIPE (Super Wii Image Partition Extractor)
  .
.     .  .
Thanks to
    johnsanc, BacoKarel for testing, knowledge and support
    Osupka, GerbilSoft, Dack, Scifi76 for source code
    All the preservationists and collectors out there...
  .
.     .  .
Requirements
    Windows (32/64 bit)
    .Net 4.6.1
    A folder of partitions (Can be created with SWAT)
    Wii Redump.dat
    Wii NonRedump.dat (Can be created with SWAT)
  .
.     .  .
Features
    Unscrub Wii images from scene / scrubbed / wbfs (file) / iso.dec
    Read the above images from Rar / Zip / 7zip etc
    Create CRC / SHA1 / MD5 checksums
    Rename restored images to match Redump dat crc
    Rename restored images to match a secondary Redump compatible dat crc
    Insert missing Update (inc rare extra data), Channel and VC partitions
    Replace Brickblocked Update partitions
    Auto fixes modified disc headers (where the Data header remains intact)
    Fixes rare corrupt partition table (caused by WBM)
    Fixes rare 0 byte file scrubbing (caused by WIT)
    Fixes truncated images (where the Data partition is intact)
    Fixes slightly overdumped images too (descrambled)
    Fixes Data partitions moved before 0xF800000 to save space
    All regions supported
    Optimised for performance
    Reusable library for use in other projects
    Flexible custom post processing ability
  .
.     .  .
Todo
    Add WBFS output
    Add GC support
    Add Scrambled image support (.wii)
    Add special value to WBFS to force crc to match redump crc of full image
    A manager GUI to allow images to be renamed with redump changes etc
  .
.     .  .
Overview
----------------------------------------------------------------------------

SWiiT is a sweet suite of tools for converting your Wii backup images from
various scrubbed, shrunk and USB loader ripped formats back to the original
disc image. There are 3 methods of doing this:

1: Match against the Redump.org Wii dat
2: Match against a NonRedump dat (creatable)
3: No match, just restore and hope for the best

Some backup methods remove extra Update and Channel partitions to save space.
If removed, methods 1 and 2 require a folder of partitions so the image can
be restored by reinserting the partition back in to the image.

There are 3 tools to help you extract extra partitions and build a
NonRedump.dat:

SWAT:  Super Wii Audit Tool
       Scans images, restoring them in memory to calculate the crc. Unknown
       entries are added to the NonRedump dat. Extra partitions are
       extracted so they can be restored once stripped out.

SWIPE: Super Wii Image Partition Extractor
       Extracts extra partitions similar to the above tool, but without
       CRCing the full image.

SWUU:  Super Wii Ultimate Unscrubber
       Restore images using the dat files and extra partitions to match
       known or audited crcs. The tool attempts to restore by always
       attempting to match using method 1 then 2, then falls back to 3.
       
       Each method has a configurable mask that specifies the format of the
       file name and path that can be saved to for each outcome.
       
       Swuu will repair all scrubbed and missing sectors from an image.
       Using the dats, it can derrive which Update partition is
       required to completely restore the image. Extra channels are
       reinserted by their presence in the partitions folder.
     
SWIV:  Super Wii Image Verifier
       Reads an image to identify which dat crc the image can be restored
       to. Logs the results in a text file. This app will also return a
       return code for the last image processed allowing it to be used as
       post processing from SWUU.

SuperWiiDiscLibrary.dll
       All tools abuild around this library. It has its own .config file.
       The majority of the configuration applies to this library. Set this
       up before running the tools. Pay special attention to the comments
       and vaious masks and substition values that can be used.
       
Read the FAQ for more information
  .
.     .  .
Tools
----------------------------------------------------------------------------

SWAT  (Super Wii Audit Tool)
SWIPE (Super Wii Image Partition Extractor)
SWUU  (Super Wii Ultimate Unscrubber)
SWIV  (Super Wii Image Verifier)

All tools accept the same command line arguments

Arguments can be 1 or more filename and paths with or without masks.
Masks can search subfolders.

Each tool has its own .config file to set other items. See the FAQ.txt.

If paths or filenames have spaces ensure they are enclosed in "s

Example arguments
  c:\temp\image.wbfs
  c:\temp\scrubbed.iso
  c:\temp
  *.*
  c:\temp\image.wbfs \temp\*.zip x*.iso.dec

Edit 'SuperWiiDiscLibrary.dll.config' to specify all the required values
----------------------------------------------------------------------------
