Hacking Sharpii

person66

If it isn't edited, it isn't a true person66 post
OP
Member
Joined
Jun 16, 2009
Messages
1,108
Trophies
0
Location
Canada
XP
415
Country
Canada
Sharpii
A Command-line libWiiSharp App

Last Update: Jun 23, 2016 - v1.7.3: Moved to GitHub from Google Code

For the last little while I have been working on this program called Sharpii. It is a command line app for windows that I made, which uses leathl's libWiiSharp.dll to perform tasks such as
  • Pack, unpack, or edit .wad files
  • Pack, and unpack U8 archives
  • Patch IOS .wad files with various patches
  • Download files from NUS
  • Convert a .wav file to .bns, and vice versa
  • Convert an image file to a .tpl, and vice versa
  • Send a .dol or .wad to the Homebrew Channel over Wi-Fi
For more details see the readme below


Download:
Sharpii can be downloaded here: https://github.com/mogzol/sharpii/releases


Readme:
HTML:
/------------------------------------------------------------------------------>
                                 Sharpii 1.7.3
       <---------------------------------------------------------------->
                               An app by person66
                 libWiiSharp.dll by leathl (mod by scooby74029)                        
/------------------------------------------------------------------------------>



/----DESCRIPTION
/------------------------------>

Sharpii is a command line app that I made, which uses leathl's
libWiiSharp.dll to perform tasks such as:
         - Pack, unpack, or edit .wad files
         - Pack, and unpack U8 archives
         - Patch IOS .wad files with various patches
         - Download files from NUS
         - Convert a .wav file to .bns, and vice versa
         - Convert an image file to a .tpl, and vice versa
         - Send a .dol or .wad to the Homebrew Channel over Wi-Fi


/----USAGE
/------------------------------>

I won't go in to detail here, but to see all the commands, just start
up the command prompt, navigate to the folder containing Sharpii, and type:

                                    Sharpii.exe -h

OR, if you want help with a specific function use

                             Sharpii.exe [function] -h

Where [function] would obviously be replaced with the function you want
help with.


/----NOTES
/------------------------------>

 NUS Downloading:
/------------------>
  When downloading single contents from NUS (using the -s argument) make
  sure you have both the path, and the file name when specifying the output.
  For example, if the output is set to '.\hello.app' then the file will be
  saved as 'hello.app' in the current directory. However, if the output is
  set to 'hello.app' you will get an error.
  
  Also note that When Downloading single contents, it will only save the
  decrypted file.
 
  If you wish to download the latest content, use '-v latest' instead of the
  actual version number.
 
  If you have the output format set only to WAD, and your your output location
  has '.wad' at the end, or you have not specified one, then instead of being
  saved inside a folder, just the wad file will be saved.
  
 WAD Editing:
/------------------>
  When changing the type of WAD (using the -type argument) some of the types
  may not work, as they have not all been tested. Here is a list of what the
  different types are:
            - Channel: Regular channel WAD, nothing special
            - DLC: WAD for game DLC (downloaded game content)
            - GameChannel: Channels such as the Wii Fit or Mario Kart channels
            - HiddenChannels: A hidden channel, it wont show up on the Wii Menu
            - SystemChannels: Channels such as the Mii or Shopping channels
            - SystemTitles: Stuff like the System Menu and boot2 (but not IOSs)

  For more details see http://wiibrew.org/wiki/Title_database

 SendDol:
/------------------>
  When using Sharpii's SendDol function, please note that any arguments placed
  after the '-dol file' argument will be sent as dol arguments.

  Also note that for compression to actually work, 'zlib1.dll' must be placed in
  the same directory as Sharpii. This file is not included, but it can easily be
  found online. If you are sending a zip file instead of a dol, it wont be
  compressed at all, no matter what.

  If you do not wish to enter an IP every time you use SendDol, then you can add
  the argument '-saveip' to the command. This will save the entered IP to the
  environmental variable 'SharpiiIP', and then, in the future, if you do not enter
  an ip, Sharpii will use the one saved there instead. (Also applies to SendWad)

 SendWad:
/------------------>
  Since version 1.6, Sharpii has supported AHBPROT for installing WADs. This means
  that as long as you have HBC 1.0.7 or above, you will be able to install the WAD
  without a patched IOS. To use this feature, enter '-ahb' instead of '-ios IOS'

  If you do not wish to enter an IP every time you use SendDol, then you can add
  the argument '-saveip' to the command. This will save the entered IP to the
  environmental variable 'SharpiiIP', and then, in the future, if you do not enter
  an ip, Sharpii will use the one saved there instead. (Also applies to SendDol)


/----Installing Sharpii
/------------------------------>

Since version 1.7, you have been able to install Sharpii. This allows you to run
Sharpii from anywhere without needing the exe in that directory. To install Sharpii,
just use the command 'Sharpii install'. This will copy Sharpii to your My Programs
directory, and create an environmental variable. To remove it, just use the command
'Sharpii uninstall' which will remove the environmental variable, then delete Sharpii
from My Programs.


/----SOURCE
/------------------------------>

The source for Sharpii is available at: https://github.com/mogzol/sharpii


/----CREDITS
/------------------------------>

Sharpii uses scooby74029's mod of libWiiSharp.dll by leathl, and
it borrows some code from some of the examples included with libWiiSharp.

libWiiSharp can be found at: https://code.google.com/archive/p/libwiisharp/


SendWad uses CRAP's installer by WiiCrazy/I.R.on, with any edits that leathl
may have made when adding it to CustomizeMii (which is where I got the source
from). Since version 1.6, the AHBPROT code it uses is just mostly stolen from
WiiMod by jskyboo.


I would also like to thank XFlak and JoostinOnline for doing a bit of beta
testing for me (and giving me many ideas). Thanks!


/----LICENSE
/------------------------------>

Sharpii is released under the terms of the GNU General Public License v3.
See "LICENSE.txt" for more information.


/----CHANGELOG
/------------------------------>
1.7.3
  - Still not dead!
  - Updated URLs for the downloaders to use GitHub instead of
    Google Code
  - WadInstaller.dll is now included in the release zip
1.7.2
  - I am not dead! Yay!
  - Fixed a bug that would prevent you from changing a wad type
  - Wad info now also displays the full, 16-character Title ID
1.7.1
  - Fixed a bug that prevented Sharpii from checking for SharpiiIP
    in the system variables
1.7
  - Sharpii can now be installed for use without the exe
  - SharpiiIP is now a system variable, not a user one.
  - Sharpii now looks for DLLs in the same directory as the exe
  - Bug fixes
1.6
  - SendWad now supports AHBPROT (use '-ahb')
  - IP can now be saved in an environmental variable (SharpiiIP)
    for both SendWad and SendDol (manually or with '-saveip')
  - Pointless easter eggs are fun!
  - Code cleanup/bug fixes
1.5
  - Added the ability to send WADs to the HBC using SendWad
  - You can now download an IOS with -ios # in NUSD
  - Downloaded IOS wads are now named like so: IOS##-64-####.wad
  - Under certain conditions, when downloading a wad with NUS,
    it will not be saved in a folder, just as the WAD (see ReadMe)
  - If missing dll's are detected (WadInstaller or libWiiSharp),
    Sharpii will ask to download them, if they are required.
  - You can now use a .dol file instead of a .wad with the '-dol'
    in the WAD editor/packer
  - Probably a few other little things I have forgotten
  - Even more code cleanup and bug fixes
1.4
  - Added the ability to send arguments in the SendDol function
  - Changed the way the SendDol function works a little
  - More code cleanup and bug fixes
1.3
  - Added the ability to copy parts of one WAD to a different
    WAD (either the banner, the icon, the sound, or the dol)
  - Added the ability to download just a single content from NUS
  - Code cleanup and bug fixes
  - Sharpii can now find JoostinOnline a girlfriend! :P
1.2
  - Added version patch support for IOS patching
  - Switched to scooby74029's mod of libWiiSharp
  - Bug fixes
1.1
  - Added support for NUS downloading
1.0
  - Initial release


Changelog:
1.7.3

- Updated URLs for the downloaders to use GitHub instead of Google Code
- WadInstaller.dll is now included in the release zip
1.7.2
- Fixed a bug that would prevent you from changing a wad type
- Wad info now also displays the full, 16-character Title ID
1.7.1
- Fixed a bug that prevented Sharpii from checking for SharpiiIP in the system variables
1.7
- Sharpii can now be installed for use without the exe
- SharpiiIP is now a system variable, not a user one.
- Sharpii now looks for DLLs in the same directory as the exe
- Bug fixes
1.6
- SendWad now supports AHBPROT (use '-ahb')
- IP can now be saved in an environmental variable (SharpiiIP) for both SendWad and SendDol (manually or with '-saveip')
- Pointless aster eggs are fun!
- Code cleanup/bug fixes

Older Changelogs:
1.5
- Added the ability to send WADs to the HBC using SendWad
- You can now download an IOS with -ios # in NUSD
- Downloaded IOS wads are now named like so: IOS##-64-####.wad
- Under certain conditions, when downloading a wad with NUS, it will not be saved in a folder, just as the WAD (see ReadMe)
- If missing dll's are detected (WadInstaller or libWiiSharp), Sharpii will ask to download them, if they are required.
- You can now use a .dol file instead of a .wad with the '-dol' in the WAD editor/packer
- Probably a few other little things I have forgotten
- Even more code cleanup and bug fixes
1.4
- Added the ability to send arguments in the SendDol function
- Changed the way the SendDol function works a little
- More code cleanup and bug fixes
v1.3
- Added the ability to mix and match WADs
- Added the ability to download just a single content from NUS
- Code cleanup and bug fixes
- Sharpii can now find JoostinOnline a girlfriend! :P
v1.2
- Added version patch support for IOS patching
- Switched to scooby74029's mod of libWiiSharp
- Bug fixes
v1.1
- Added support for NUS downloading
v1.0
- Initial release


If you want to donate (I'm not asking you to though) I now have a paypal, so donations can be sent to [email protected]

If you have any problems, comments, or suggestions, please add them below :yay:
 
Last edited by person66,

G0dLiKe

who needs a title ;)
Member
Joined
Aug 2, 2009
Messages
1,674
Trophies
0
Website
db.tt
XP
206
Country
United States
Great stuff, thx
smile.gif
 

person66

If it isn't edited, it isn't a true person66 post
OP
Member
Joined
Jun 16, 2009
Messages
1,108
Trophies
0
Location
Canada
XP
415
Country
Canada
Thanks for the positive feedback, I just updated this to 1.1, it can now download files from NUS, using something similar to this:

Code:
Sharpii.exe NUSD -id 0000000100000002 -v 513 -o out -local -wad -decrypt
Which would download System menu 4.3U, or use local files if present, and save just the WAD and decrypted contents to a folder called 'out'.

Note that the only necessary arguments are -id and -v or -version
 

person66

If it isn't edited, it isn't a true person66 post
OP
Member
Joined
Jun 16, 2009
Messages
1,108
Trophies
0
Location
Canada
XP
415
Country
Canada
XFlak said:
Great work buddy, this could replace like 4 or 5 tools ModMii is currently using! One day when I'm not feeling too lazy I might just have to incorporate sharpii into ModMii
biggrin.gif
Wow, I would be honoured if this is ever included in ModMii, if you or anyone else can think of any other features that would be helpful/useful (even if they aren't a part of libwiisharp) then I would be more then happy to look in to adding them. Right now I am thinking about adding support for sending wads to the homebrew channel (like crap and customizemii), but I am always looking for new ideas.
 

XFlak

Wiitired but still kicking
Member
Joined
Sep 12, 2009
Messages
13,847
Trophies
3
Age
38
Location
Cyprus, originally from Toronto
Website
modmii.github.io
XP
9,844
Country
Cyprus
you can add the version patch to the IOS patching options, the libwiisharp mod used by ModMii already supports it so it should be pretty simple for u to add.

Another idea would be to be able to mix and match wads, like inserting the audio clip from wad 1 into wad 2 without first needing to extract the audio from wad 1.
 

SifJar

Not a pirate
Member
Joined
Apr 4, 2009
Messages
6,022
Trophies
0
Website
Visit site
XP
1,175
Country
One idea I have is downloading one content from a title (e.g. for getting the base .app for creating themes). I'm pretty sure there is already a standalone tool for this which uses libWiiSharp, so I would assume it shouldn't be too hard to implement.

On a side note, this is pretty cool. I have thought several times how handy it would be to have a tool like this. And the name is pure genius.

XFlak said:
you can add the version patch to the IOS patching options, the libwiisharp mod used by ModMii already supports it so it should be pretty simple for u to add.

Another idea would be to be able to mix and match wads, like inserting the audio clip from wad 1 into wad 2 without first needing to extract the audio from wad 1.

Glancing through the source, it looks like it can already patch the version of IOS, as well as the IOS slot it installs to.
 

person66

If it isn't edited, it isn't a true person66 post
OP
Member
Joined
Jun 16, 2009
Messages
1,108
Trophies
0
Location
Canada
XP
415
Country
Canada
SifJar said:
One idea I have is downloading one content from a title (e.g. for getting the base .app for creating themes). I'm pretty sure there is already a standalone tool for this which uses libWiiSharp, so I would assume it shouldn't be too hard to implement.

On a side note, this is pretty cool. I have thought several times how handy it would be to have a tool like this. And the name is pure genius.

XFlak said:
you can add the version patch to the IOS patching options, the libwiisharp mod used by ModMii already supports it so it should be pretty simple for u to add.

Another idea would be to be able to mix and match wads, like inserting the audio clip from wad 1 into wad 2 without first needing to extract the audio from wad 1.

Glancing through the source, it looks like it can already patch the version of IOS, as well as the IOS slot it installs to.
There is some other type of version patch that scooby's mod of patchIOS does, but I honestly don't know what it does. Anyone care to explain?

And for downloading one content from a title, I assume you are talking about something similar to NusFileGrabber included with modmii? I can look in to something like that.
 

SifJar

Not a pirate
Member
Joined
Apr 4, 2009
Messages
6,022
Trophies
0
Website
Visit site
XP
1,175
Country
Yeah, that's exactly what I meant.

And I was unaware of any other version patch...not sure how else the version could be patched...interesting.
 

XFlak

Wiitired but still kicking
Member
Joined
Sep 12, 2009
Messages
13,847
Trophies
3
Age
38
Location
Cyprus, originally from Toronto
Website
modmii.github.io
XP
9,844
Country
Cyprus
the version patch is the one triggered by "-VP" in scooby's patchios mod. This patch is what allows you to "downgrade" an IOS. For example, without the version patch, you will not be able to overwrite IOSxx v65535 with IOSxx v21006. It's thanks to the version patch that any title deleter is no longer a part of the "remove stubs" softmod process

edit: note that the version patch is not the same as patching the version #
 

SifJar

Not a pirate
Member
Joined
Apr 4, 2009
Messages
6,022
Trophies
0
Website
Visit site
XP
1,175
Country
Ah thanks for the explanation XFlak. So it disables version checking in the patched IOS? How does that aid stub deletion? (Sorry this is probably off topic...maybe you could PM me? I'm interested in this and haven't heard of it until now)
 

techboy

Well-Known Member
Member
Joined
Mar 15, 2009
Messages
1,720
Trophies
0
Age
31
Location
Pennsylvania
Website
Visit site
XP
306
Country
United States
Nice
smile.gif
Been wondering if there was a tool like this.

SifJar said:
Ah thanks for the explanation XFlak. So it disables version checking in the patched IOS? How does that aid stub deletion? (Sorry this is probably off topic...maybe you could PM me? I'm interested in this and haven't heard of it until now)
I think that it allows you to just install the lower-version (real) title over top of the stub without deleting the stub.
 

XFlak

Wiitired but still kicking
Member
Joined
Sep 12, 2009
Messages
13,847
Trophies
3
Age
38
Location
Cyprus, originally from Toronto
Website
modmii.github.io
XP
9,844
Country
Cyprus
techboy said:
Nice
smile.gif
Been wondering if there was a tool like this.

SifJar said:
Ah thanks for the explanation XFlak. So it disables version checking in the patched IOS? How does that aid stub deletion? (Sorry this is probably off topic...maybe you could PM me? I'm interested in this and haven't heard of it until now)
I think that it allows you to just install the lower-version (real) title over top of the stub without deleting the stub.
correct
biggrin.gif
 

SifJar

Not a pirate
Member
Joined
Apr 4, 2009
Messages
6,022
Trophies
0
Website
Visit site
XP
1,175
Country
techboy said:
Nice
smile.gif
Been wondering if there was a tool like this.

SifJar said:
Ah thanks for the explanation XFlak. So it disables version checking in the patched IOS? How does that aid stub deletion? (Sorry this is probably off topic...maybe you could PM me? I'm interested in this and haven't heard of it until now)
I think that it allows you to just install the lower-version (real) title over top of the stub without deleting the stub.
Can you not do that anyway with the NAND Permissions patch? I always assumed you could.
 

person66

If it isn't edited, it isn't a true person66 post
OP
Member
Joined
Jun 16, 2009
Messages
1,108
Trophies
0
Location
Canada
XP
415
Country
Canada
OK, quick update, I added version patch support, and Sharpii now uses scooby74029's mod of libWiiSharp (thanks scooby!)
I also fixed a couple bugs I found while testing.

If you have any problems let me know.

I will start to work on some of the suggested features later on this week
yaywii.gif
 

JoostinOnline

Certified Crash Test Dummy
Member
Joined
Apr 2, 2011
Messages
11,005
Trophies
1
Location
The Twilight Zone
Website
www.hacksden.com
XP
4,339
Country
United States
person66 said:
OK, quick update, I added version patch support, and Sharpii now uses scooby74029's mod of libWiiSharp (thanks scooby!)
I also fixed a couple bugs I found while testing.

If you have any problems let me know.

I will start to work on some of the suggested features later on this week
yaywii.gif
I want it to find me a girlfriend.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • AncientBoi @ AncientBoi:
    ooowwww a new way for me to beat NFS 510 :D @SylverReZ
    +1
  • SylverReZ @ SylverReZ:
    @AncientBoi, Yeah, believe you can do PSP games as well. But a Pi5 is much powerful in comparison.
    +2
  • Psionic Roshambo @ Psionic Roshambo:
    Not sure about other models of Pi4 but the Pi 4 B with 8GBs OCed to 2Ghz handles PSP really great except like 1 game I found and it is playable it just looks bad lol Motor Storm Arctic something or other.
  • Psionic Roshambo @ Psionic Roshambo:
    Other games I can have turned up to like 2X and all kinds of enhancements, Motorstorm hmmm nope 1X and no enhancements lol
  • Veho @ Veho:
    Waiting for Anbernic's rg[whatever]SP price announcement, gimme.
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    I will admit that one does seem more interesting than the usual Ambernic ones, and I already liked those.
  • Veho @ Veho:
    I dread the price point.
    +1
  • Veho @ Veho:
    This looks like one of their premium models, so... $150 :glare:
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    To me that seems reasonable.
  • Psionic Roshambo @ Psionic Roshambo:
    I mean since basically all the games are errmmm free lol
  • Veho @ Veho:
    I mean yeah sure but the specs are the same as a $50 model, it's just those pesky "quality of life" things driving up the price, like an actually working speaker, or buttons that don't melt, and stuff like that.
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    I think all in my Pi 4 was well north of 200 bucks 150ish for the Pi 4 the case the fancy cooler, then like 70 for the 500GB MicroSD then like 70 for the Xbox controller. But honestly it's a nice set up I really enjoy and to me was worth every penny. (even bought more controllers for 2 or 4 player games.) hmmm have never played any 2 player games yet :(
  • Veho @ Veho:
    Yeah that's what I hate about the RPi, it's supposedly $30 or something but it takes an additional $200 of accessories to actually turn it into a working something.
  • Psionic Roshambo @ Psionic Roshambo:
    yes that's the expensive part lol
  • Veho @ Veho:
    I mean sure it's flexible and stuff but so is uremum but it's fiddly.
  • Psionic Roshambo @ Psionic Roshambo:
    Yeah a lot of it I consider a hobby, using Batocera I am constantly adjusting the collection adding and removing stuff, scraping the artwork. Haven't even started on some music for the theme... Also way down the road I am considering attempting to do a WiiFlow knock off lol
  • Veho @ Veho:
    I want everything served on a plate plz ktnx, "work" is too much work for me.
  • Veho @ Veho:
    Hmm, with that in mind, maybe a complete out-the-box solution with all the games collected, pacthed and optimized for me would be worth $150 :unsure:
  • Psionic Roshambo @ Psionic Roshambo:
    Yeah it's all choice and that's a good thing :)
  • Bunjolio @ Bunjolio:
    animal crossing new leaf 11pm music
  • Bunjolio @ Bunjolio:
    avatars-kKKZnC8XiW7HEUw0-KdJMsw-t1080x1080.jpg
    wokey d pronouns
  • SylverReZ @ SylverReZ:
    What its like to do online shopping in 1998: https://www.youtube.com/watch?v=vwag5XE8oJo
    SylverReZ @ SylverReZ: What its like to do online shopping in 1998: https://www.youtube.com/watch?v=vwag5XE8oJo