Hacking Wii.cs Tools 0.3 - CLI / Command Line Usage Instructions

SaulFabre

I like Yoshis and the Wii/Wii U scene.
OP
Member
Joined
Feb 6, 2019
Messages
3,145
Trophies
1
Age
25
Location
Ecuador
Website
saulfabreg-wiivc.blogspot.com
XP
7,633
Country
Ecuador
Hello to all GBAtemp!

In this thread I'm going to show you the documentation made by @Leathl for the command-line usage of the Wii.cs Tools 0.3, that I found when I was cleaning a bit my PC of some junk files, and I knew that user @XFlak (creator of ModMii) is trying to search for it in everywhere but he couldn't find it anywhere. So I decided to put it for make it visible for everyone.

Special thanks goes to user @mrt84 with this thread https://gbatemp.net/threads/youtube...-beta-release-youtube-video-wad-maker.577521/ for "accidentally" including that file in the modified version of Wii.cs Tools for make Flash WAD Injects for Wii.

Original recovered file can be downloaded here: CLI.txt

Well, here's the documentation:

(original by @Leathl)

These are the CLI (Command Line) parameters for the Wii.cs Tools
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
WadMii:
-------
-input / -in input (File or Directory)
-output / -out output (File or Directory)

Optional Packing Options:
-id XXXX (Changes Title ID; automatically Trucha-signs!)
-trucha / -sign (Trucha-signs Tik and Tmd)
You don't need to specify unpack or pack, it will be chosen automatically by checking if input is a file or directory.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
U8Mii:
------
-input / -in input (File or Directory)
-output / -out output (File or Directory)

Optional Packing Options:
-imd5 (Adds IMD5 Header)
-imet (Adds IMET Header)
-lz77 (Uses Lz77 Compression)
-title title (General Title)
-jap title (Language
-eng title specific
-ger title Titles;
-fra title will overwrite
-ita title general Title
-spa title for it's
-dut title language)
You don't need to specify unpack or pack, it will be chosen automatically by checking if input is a file or directory.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TplMii:
-------
-input / -in input (Tpl or Image)
-output / -out output (Tpl or Image)

Optional To-Tpl-Conversion Options:
-rgba8 (Uses RGBA8 Format, Good Quality)
-rgb565 (Uses RGB565 Format, Moderate Quality)
-rgb5a3 (Uses RGB5A3 Format, Low Quality)
If no format is chosen, RGBA8 will be used.
You don't need to specify To-Tpl or From-Tpl, it will be chosen automatically by checking if input is a Tpl or Image.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Lz77Mii:
--------
-input / -in input (File)
-output / -out output (File)
-pack / -compress (Will compress)
If you don't add -pack or -compress, it will decompress the input file.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
DolMii:
-------
-wad wadfile (The Wad file where the new Dol will be inserted)
-dol dolfile (The Dol to insert)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Hope this info help you for make future Wii tools and applications for Windows PC! :D

Greetings to all, and see you in a next Wii scene thread! :yaywii:

saulfabreg - @SaulFabre
 

Attachments

  • CLI.txt
    2.6 KB · Views: 177
Last edited by SaulFabre,

NoobletCheese

Well-Known Member
Member
Joined
Aug 12, 2018
Messages
533
Trophies
0
Age
25
XP
1,075
Country
United States
When using Wadmii at the command line, when the unpacking is complete, a GUI message box pops up saying "successfully (un)packed WAD".

Is it possible to disable this? If not, it kind of defeats the purpose of having a command line interface, which is to script multiple things silently and pipe the output somewhere to see if the command succeeded or not, then continue on to the next command etc.

Can't do any of that with these tools, it seems :(
 
  • Like
Reactions: SaulFabre

XFlak

Wiitired but still kicking
Member
Joined
Sep 12, 2009
Messages
13,766
Trophies
3
Age
38
Location
Cyprus, originally from Toronto
Website
modmii.github.io
XP
9,721
Country
Cyprus
Try the version of wadmii (and libwiisharp?) that's bundled with ModMii, there aren't any pop-ups. Not sure about the other tools though.

edit: also note that the version of wadmii used by modmii also does not timestamp WADs; in this way you can get consistent hashes if performing the same operation but at different times
 
Last edited by XFlak,

NoobletCheese

Well-Known Member
Member
Joined
Aug 12, 2018
Messages
533
Trophies
0
Age
25
XP
1,075
Country
United States
Try the version of wadmii (and libwiisharp?) that's bundled with ModMii, there aren't any pop-ups.

Brilliant, it works!

For those with virus scanners throwing all the false positives, you can open ModMiiInstaller.exe with WinRAR and extract Support\WadMii.exe and libWiiSharp.dll. I'm not sure if common-key.bin is required, which would need to be obtained elsewhere. Not sure of the legality of sharing common-key.bin, as apparently you can't copyright a password, however that doesn't necessarily mean the law says it's ok to publish stolen credit card pin numbers.
 
  • Like
Reactions: XFlak and SaulFabre

XFlak

Wiitired but still kicking
Member
Joined
Sep 12, 2009
Messages
13,766
Trophies
3
Age
38
Location
Cyprus, originally from Toronto
Website
modmii.github.io
XP
9,721
Country
Cyprus
Or you can just grab the official portable zipped release of modmii instead of extracting files from the modmii installer (edit: or just whitelist it in your antivirus). I've linked to 6.6.3 above but current and future releases can also be found here: https://github.com/modmii/modmii.github.io/releases

Oh and if u just want the version of wadmiiish used by ModMii (by cwstjdenobs) you can get it from here

Lastly, sourcecode for wadmii (if you or anyone want it) can be found at the bottom of the modmii credits page here https://modmii.github.io/credits.html

Edit: and libwiisharp can also be found on my github in the support folder
https://github.com/modmii/modmii.github.io

Oh and why not just create the common-key on the fly?

Edit: I'm sure there are a few different ways to do this, but for modmii I do something like this:

Code:
ECHO COMMONKEYHERE>common-key.txt
SFK.exe filter common-key.txt +hextobin common-key.bin>nul

These could even probably be combined into a single command but I haven't tested it (on my mobile at the moment)

Edit2: may not be perfect but I think it's better than distributing a bin file
 
Last edited by XFlak,

NoobletCheese

Well-Known Member
Member
Joined
Aug 12, 2018
Messages
533
Trophies
0
Age
25
XP
1,075
Country
United States

For the record, I did actually attempt to find a portable version first. The first thing I did was click the link in your sig and had a look around there for a portable version and couldn't find one. I saw the url is github so I assumed that must be everything on your git -- wrong. What I should have done was Googled for a link to your git, sorry about that.

It's a shame you've been blacklisted so badly, even stock Firefox won't download ModMiiInstaller.exe without user intervention. One of my apps had 2 false positives and it took about 10 days to get whitelisted by emailing each vendor directly. However I don't think they will whitelist you simply by virtue of "guilt by association" with hacking tools.
 
Last edited by NoobletCheese,
  • Like
Reactions: XFlak and SaulFabre

XFlak

Wiitired but still kicking
Member
Joined
Sep 12, 2009
Messages
13,766
Trophies
3
Age
38
Location
Cyprus, originally from Toronto
Website
modmii.github.io
XP
9,721
Country
Cyprus
No worries mate.

What I should really do, is compare 6.6.1 to 6.6.2+ in terms of false positives, and start by contacting those that were cool with 6.6.1 but aren't any longer. Or I could probably roll back the old launcher binaries and all that would get lost is support for carets in the installation path, if I do that then I'm fairly certain many false-positives would disappear

It's probably not the right place to be asking, but if anyone is willing to help email individual vendors to try to get modmii whitelisted I would be super appreciative
 
Last edited by XFlak,
  • Like
Reactions: SaulFabre

NoobletCheese

Well-Known Member
Member
Joined
Aug 12, 2018
Messages
533
Trophies
0
Age
25
XP
1,075
Country
United States
It's probably not the right place to be asking, but if anyone is willing to help email individual vendors to try to get modmii whitelisted I would be super appreciative

The way I did it was for each false positive on virustotal, I went to the vendor's official website and looked for a submission form or email address which they set up specifically for reporting false positives. That's basically all there is to it. Then it took about 10 days after that for them to review it and update their virus definitions, and then a few days later virustotal gets the new definitions from each vendor and you just have to rescan the file at virustotal for the result to update.

--------------------- MERGED ---------------------------

Question about wad packing: is it still necessary to sign the ticket and cmd?

I read somewhere that Nintendo patched the fakesigning in system version 4 or something, and I plan on launching wads from USB Loader GX emunand -- is signing still relevant?
 
  • Like
Reactions: SaulFabre

SaulFabre

I like Yoshis and the Wii/Wii U scene.
OP
Member
Joined
Feb 6, 2019
Messages
3,145
Trophies
1
Age
25
Location
Ecuador
Website
saulfabreg-wiivc.blogspot.com
XP
7,633
Country
Ecuador
The way I did it was for each false positive on virustotal, I went to the vendor's official website and looked for a submission form or email address which they set up specifically for reporting false positives. That's basically all there is to it. Then it took about 10 days after that for them to review it and update their virus definitions, and then a few days later virustotal gets the new definitions from each vendor and you just have to rescan the file at virustotal for the result to update.

--------------------- MERGED ---------------------------

Question about wad packing: is it still necessary to sign the ticket and cmd?

I read somewhere that Nintendo patched the fakesigning in system version 4 or something, and I plan on launching wads from USB Loader GX emunand -- is signing still relevant?
Yes, it is necessary to sign the ticket (*.tik) file and TMD (*.tmd) file in order for set the custom size of the *.app files if you modifed its contents (example, ROM injection in Wii VC). (IT IS NOT CMD, DO NOT CONFUSE!!)
I think newer WAD (un)packers such wwPacker use a new type of ticket signing so we can play the resulting WADs in v4.0-v4.1 or newer. I've tested fake-signed WADs in Dolphin with Wii System Menu v4.3U and they loaded without problems.
 
Last edited by SaulFabre,
  • Like
Reactions: NoobletCheese

NoobletCheese

Well-Known Member
Member
Joined
Aug 12, 2018
Messages
533
Trophies
0
Age
25
XP
1,075
Country
United States
Try the version of wadmii (and libwiisharp?) that's bundled with ModMii, there aren't any pop-ups.

It appears signing is nonfunctional with the version of WadMii included with ModMii, as the checksum of the resulting .wad is the same regardless of whether I use the "-sign" argument.

Whereas the WadMii version in OP results in a different checksum for signed vs unsigned.

I tried putting [common-]key.bin in the same folder, no effect. Maybe it just needs to be renamed to something different?

edit: nope, source code for libwiisharp shows it contains the key internally.

edit2: changing the wad's ID with "-id XXXX" doesn't work either according to waddatainfo.exe.

edit3: source code for Wii.cs tools version of WadMii shows it should be pretty easy to just comment out the GUI message boxes. The hard part will be learning how to recompile it.

edit4: appears to be compiled with Visual C# Express 2008 (link).
 
Last edited by NoobletCheese,

NoobletCheese

Well-Known Member
Member
Joined
Aug 12, 2018
Messages
533
Trophies
0
Age
25
XP
1,075
Country
United States
Managed to recompile WadMii with command line output instead of GUI message boxes.

The whole project must be recompiled as a "console application" in order to get the expected Console.Write("message") behaviour. This means when launching the GUI you have a command window sitting behind it the whole time. Tried this workaround but it doesn't work quite right.

If anyone wants it I'll put it somewhere, or if you want to do it yourself this should work for the other wii.cs tools as well:

- Right click the iso file in previous post > select drive letter and mount
- Install Visual C# Express 2008
- Launch Microsoft Visual Studio 9.0\Common7\IDE\vcsexpress.exe
- Open WadMii.csproj > WadMii_Main.cs
- Search for 'MessageBox' and 'ErrorBox' and replace with Console.Write("message");
- Right click WadMii project > output type > Console application
- Right click WadMii project > Build > outputs WadMii.exe to bin\Release

WadMii source:
https://code.google.com/archive/p/showmiiwads/source/default/source
Path: branches\Wii.cs Tools\WadMii
 
Last edited by NoobletCheese,

SaulFabre

I like Yoshis and the Wii/Wii U scene.
OP
Member
Joined
Feb 6, 2019
Messages
3,145
Trophies
1
Age
25
Location
Ecuador
Website
saulfabreg-wiivc.blogspot.com
XP
7,633
Country
Ecuador
Managed to recompile WadMii with command line output instead of GUI message boxes.

The whole project must be recompiled as a "console application" in order to get the expected Console.Write("message") behaviour. This means when launching the GUI you have a command window sitting behind it the whole time. Tried this workaround but it doesn't work quite right.

If anyone wants it I'll put it somewhere, or if you want to do it yourself this should work for the other wii.cs tools as well:

- Right click the iso file in previous post > select drive letter and mount
- Install Visual C# Express 2008
- Launch Microsoft Visual Studio 9.0\Common7\IDE\vcsexpress.exe
- Open WadMii.csproj > WadMii_Main.cs
- Search for 'MessageBox' and 'ErrorBox' and replace with Console.Write("message");
- Right click WadMii project > output type > Console application
- Right click WadMii project > Build > outputs WadMii.exe to bin\Release

WadMii source:
https://code.google.com/archive/p/showmiiwads/source/default/source
Path: branches\Wii.cs Tools\WadMii
Thanks to the source, maybe I will see it for a while ;)
 

pietempgba

Well-Known Member
Member
Joined
Jun 9, 2016
Messages
1,049
Trophies
0
XP
1,515
Country
United States
Managed to recompile WadMii with command line output instead of GUI message boxes.

The whole project must be recompiled as a "console application" in order to get the expected Console.Write("message") behaviour. This means when launching the GUI you have a command window sitting behind it the whole time. Tried this workaround but it doesn't work quite right.

If anyone wants it I'll put it somewhere, or if you want to do it yourself this should work for the other wii.cs tools as well:

- Right click the iso file in previous post > select drive letter and mount
- Install Visual C# Express 2008
- Launch Microsoft Visual Studio 9.0\Common7\IDE\vcsexpress.exe
- Open WadMii.csproj > WadMii_Main.cs
- Search for 'MessageBox' and 'ErrorBox' and replace with Console.Write("message");
- Right click WadMii project > output type > Console application
- Right click WadMii project > Build > outputs WadMii.exe to bin\Release

WadMii source:
https://code.google.com/archive/p/showmiiwads/source/default/source
Path: branches\Wii.cs Tools\WadMii
can you upload it?
 
  • Like
Reactions: SaulFabre

fledge68

Well-Known Member
Member
Joined
Jan 30, 2012
Messages
2,430
Trophies
2
XP
4,915
Country
United States
for us windows 10 command line noobs: (wadmii example)

I created a folder with wadmii.exe and libwiisharp from modmii. also created 2 subfolders - extracted and wads.

in that folder hold shift and right click. then select open powershell. in the blue window type your commands like this:

.\wadmii.exe -in extracted/nk2o -out wads/nk22.wad
.\wadmii.exe -in wads/nk2o.wad -out extracted/nk2o

Also there is a windows gui version of wadmii 1.0.3. it works to unpack and pack a wad BUT there will be a hash mismatch error when packing a wad but it doesn't tell you. I found out by dragging the new wad into customizemii, it will tell you the error. just simply click create wad and customizemii will recreate the wad fixed.
showmiiwads is also capable of packing and unpacking wads but it has the same problem as wadmii 1.0.3.

i believe both wadmii 1.0.3 and showmiiwads were created with a older libwiisharp and customizemii was created with a updated version of libwiisharp. or it could be something else.
 
  • Like
Reactions: XFlak and SaulFabre

XFlak

Wiitired but still kicking
Member
Joined
Sep 12, 2009
Messages
13,766
Trophies
3
Age
38
Location
Cyprus, originally from Toronto
Website
modmii.github.io
XP
9,721
Country
Cyprus
FYI the version of libwiisharp that comes with modmii is a mod made by scooby74029 at my request. I think there was one functional improvement but I don't recall what (but could probably dig it out if necessary). I do remember the other more cosmetic improvement, which was some changes to prevent false positive reports by AVs
 
  • Like
Reactions: fledge68

XFlak

Wiitired but still kicking
Member
Joined
Sep 12, 2009
Messages
13,766
Trophies
3
Age
38
Location
Cyprus, originally from Toronto
Website
modmii.github.io
XP
9,721
Country
Cyprus
https://drive.google.com/file/d/1wc5jUgYyPii9oUR575-CXZ-5IkVtg--o/view?usp=sharing

eg. usage
Code:
WadMii.exe -in C:\Game.wad -out C:\UnpackedWad    // C:\UnpackedWad has to exist -- wadmii wont create it
Can you comment on whether you applied the change to the WadMiiIsh mod by cwstjdenobs or if you modified the original release? Can you spot what the differences are between cwstjdenobs' version and the original as again, I don't recall. Here's a link to the WadMiiIsh mod source by cwstjdenobs

http://www.mediafire.com/?bogjind5oe3

Thx
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Xdqwerty @ Xdqwerty: I'm sleepy good night