From WiiBrew
Jump to navigation Jump to search
TypePC utility

PyWii is a set of Python 2 written tools mainly concerning titles released by fail0verflow with the source code of the Homebrew Channel.


Python library to deal with Wii formats.

Currently has decent support for discs, partitions (including
accessing the partition data using read() and write(), with
caching), wads, and the structures contained within (certs,
tiks, tmds, etc)

Stuff may be broken. Some things are unfinished.

It also makes breakfast.


  • Takes three arguments, each the path to a file. It calculates the SHA-1 of the second file, replaces all occurences of @SHA1SUM@ in the first file with this hash, and then writes the result to the third file.
  • Prints a list of the files in a U8 archive.
  • Packs the path specified by the second argument into a U8 archive, and then saves it to the path specified by the first argument.
  • Prints information about a Wii ISO.
  • Signs a ticket or TMD with the XS or CP private key, respectively. While this code would work with the production/retail titles and keys, this tool is so named because these private keys are not publicly known, unlike the private keys for development systems.
Usage: keyfile.[priv|pub] infile
Usage: keyfile.priv
Usage: keyfile.priv []
Usage: keyfile.priv infile outfile
  • Extracts a partition from a Wii ISO.
 python <encrypted ISO> <partition number> <file to extract to> [Partition offset] [length]
  • Extracts the main.dol from a Wii ISO.
 python <encrypted ISO> <partition number> <dol output>
  • Intended to extract files from a Wii ISO, though this was unfinished and this file is almost an identical copy of (except for the usage).
 python <encrypted ISO> <partition number> <root path to extract to>
  • Extracts the apploader from a Wii ISO and prints some information about it.
 python <encrypted ISO> <partition number> <apploader text> <apploader trailer>
  • Replaces a partition of a Wii ISO, and then fakesigns it.
 python <encrypted ISO> <partition number> <file to inject> [Partition offset] [data offset] [length]
  • Replaces the main.dol of a Wii ISO, and then fakesigns it.
 python <encrypted ISO> <partition number> <dol to inject>
  • Sets the IOS version of a Wii ISO, and then fakesigns it.
 python <encrypted ISO> <partition number> <IOS version>
 IOS version should be just the minor number (16, 33, etc) in decimal
  • Broken. Calls function WiiSave(), which was presumably removed before release.
  • Fakesigns a ticket.
  • Prints information about a ticket.
  • Fakesigns a TMD.
  • Prints information about a TMD.
  • Sets the version number in a TMD.
  • Prints information about a WAD.
  • Packs files into a WAD.
  • Pack files into a WAD to be installed as boot2.
  • Extracts a WAD.

Breakfast Maker

In its root directory (unlike the rest of the tools), PyWii includes the program that "makes breakfast".

Breakfast Maker v0.2
Please enter your username: bushing
Making breakfast for bushing...
Cooking time will be approximately 1 minute and 40 seconds

Your breakfast is ready!

                       _oo=""[:[Y.  _dP"'Y8P"=po_
                   ,=P'`Y.-Y'   'd88` ,o`P.Yb`>_oPYp._
                ,8'   ,Y\`h. ,pP' _]Y[     ',Pd[  __.`Yo_
             ,=' `Y.`'   ]pP8[ pY''`,`\._pp''  `b`' `",pPYo_
           _d'_pPY.`o_,="' ,o`b     _d="Y. ,o`'P.`o,=P'  _ `o_
          d8`'    d=PYb pP'  Y.YL,=P'  __`h_   _oP'`b.oY' ` .Yo
         d'.Y.,pP'  ,o.Y.    ,pP'Yo pY'  "bYopP'  ]p.`b_  _oP''Y.
        8'_pP"Y. p`'  "b]bop''  ,-[Y.   _,='[`b.Y'   Y'8o8' _pP-]L
      ,dP"' _po`b    _,="'`b.-P'  ` ]boP'  ,YY.Yo   ,="' `b/'    Yb
     , 8o`o''  '.YopP'  _p-.Yb   _,='[`Y.P'    \.8oP' ,o''.`o_  _pPb
     Yd'`Y.   _pP''Y.,o''  ` '8oP'  ,d"L`o_  _pP'[ Yo[     Y'Zo8'  Y.
     P8 \ 8o=''  _pb`b     ,="[`YLP'    "'8oP' _pP`\.YL   ,="' `b.''b
     [Y,="' YL-p'   Y.YLpP'  ,d-b`h_   ,='' Yo`'    `>.8oF'  ]YY.`o_Y
     [Y[  ,-.`b     ,d"'YL-P'    Y 8oP'  ,='Y.YL    ,=' `YL-'    Y_Z8
     b`b`'   \ YLpP'  ,ob`h_    ,pP' Yo`'     '.8oP'  _p-b`Y.   ,=''8|
     Y Y.    ,=P'Y.-P'   P.YL,="'  pP\`Y.    _pP'`YL<''   Yb]bo''_p Pb
      b Y.op'' dp.`o     _dP'YL.pP'   `b`\.pP'  ,Y\`\.    ,d' `Y.' d [
      `. Yp_pP'  `,.Y._pP'  _o`Y.      ,bP`b.oP'   `L`b,=' _pP .`hd'd
       Y. YL       ]=P8. ,Y'  P.`o  ,="' _p.YL      ,d'`bp`'   `'d',P
        `. `\.  ,='' [ Y.      `'oP8[ _p'' `\.Y. ,=' _pY[Yo     d' P
         `b  `H[  _pP'`b`Y.   ,='  `Y.       'oPYL p''   Y.YL.dP ,P
           Y.  `Y.[     Y 8oP'  pY'P.`b    ,p' ,o`b_       'dP  d'
            `\.   `o.  _pP[ YL`'    `, 8oP' ,Y'  Y[Yo    ,='  ,P
              `\.    `YYo_`-b`b_    _,P''YL'       '.8pP'   ,Y'
                 Yo_     '"=poo8L_oP'  YY'`h_ __,p="''    pP
                   `"p.        ''`"""""--""""'''       ,Y'
                       '" o__                     _po`'

This program only recognizes the name bushing.

In an old revision of his user page, marcan said "the tools that are coming up are so awesome they'll even make breakfast for you," a possible reference to this program suggesting that PyWii was originally intended to be released much earlier than it was.