DacoTaco / priiloader

A Wii homebrew application that can prevent and fix some user level bricks
GNU General Public License v2.0
544 stars 101 forks source link

vWii support #317

Closed GaryOderNichts closed 1 year ago

GaryOderNichts commented 1 year ago

This draft tries to add vWii support to Priiloader. This works by replacing the SM boot index with the BC-NAND Nand Loader, which is also a signed Ancast Image. BC-NAND will then boot content 1, which will be replaced with Priiloader. The original content 1 will be placed at the end of the contents. To boot the vWii SM Priiloader decrypts the ancast image and patches it to redirect content 1 to the end. It then boots the decrypted SM. I've also added 2 vWii specific hacks. One always enables NET.WCFG, which usually gets disabled by SM, and the other one makes the Wii Options button open Wii System settings. All of the other hacks need to be verified and ported over. This is still very experimental and hasn't been properly tested. There is also still some work left to do which is listed below.

TO-DO:

Closes #268.

AndrewPiroli commented 1 year ago

Testing, especially make sure the installer works properly

Verify that this doesn't break anything on an original Wii

Tested this on a normal Wii running 4.3 (all regions) and 4.0E. Everything seems to be working with the installer and Priiloader. HBC and SM boot ok and hacks are applied.

dracula99gr commented 1 year ago

Is it possible to add resolution change hack when we boot into vWii? Because wiiu may set the resolution to 1080p with no upscale at all and tvs can do better job on upscaling a 480p or 720p signal than 1080p signal

Leseratte10 commented 1 year ago

Very cool that Priiloader is going to get vWii support.

I tried porting my Wiimmfi Patcher hack to support the vWii system menu versions, but I'm stuck because the binary is encrypted. I grabbed the 00000008.app from the vWii system menu just like I did from the Wii and Wii Mini system menus in the past and the "loader" at 80003400 is present and readable, but the actual content at 81330000 seems to be encrypted.

I assume that is this "Ancast encryption" which you added support for Priiloader to decrypt before applying the hacks and executing it? Can I just take the vwii_ancast_retail_key and vwii_ancast_iv from this PR and run that blob through a standard AES decryptor on a Linux machine (to get a decrypted System Menu I can use to find the offsets for my hacks) or is there any tricks I need to be aware of? I'm assuming that'd be AES-128-CBC? And is the resulting (decrypted) image also placed at 81330000 in RAM when being executed?

GaryOderNichts commented 1 year ago

the "loader" at 80003400 is present and readable, but the actual content at 81330000 seems to be encrypted.

Yeah, that loader stub is actually ignored on the vWii. The content at 81330000 is the Ancast image which gets booted by the Espresso.

I assume that is this "Ancast encryption" which you added support for Priiloader to decrypt before applying the hacks and executing it? Can I just take the vwii_ancast_retail_key and vwii_ancast_iv from this PR and run that blob through a standard AES decryptor on a Linux machine (to get a decrypted System Menu I can use to find the offsets for my hacks) or is there any tricks I need to be aware of?

Yup, nothing special required for decryption. After extracting the content from the dol containing the Ancast image, you can decrypt the Ancast body at offset 0x100 with the ancast key and iv.

I'm assuming that'd be AES-128-CBC?

Yeah, it is.

And is the resulting (decrypted) image also placed at 81330000 in RAM when being executed?

Yes, the entire image is loaded at 81330000 and the system will then jump to the decrypted body at 81330100. This is the actual boot stub (which usually runs at 80003400), which then jumps to the System Menu entry @ 81330400.

By the way Dolphin also supports loading Ancast images since PR 11188, which could be useful for creating SM hacks.

danny8376 commented 1 year ago

Compiled and installed on my JPN vWii. Both installing and uninstalling seems working fine. For vWii specific hacks, the settings one works fine. However, the WC24 one doesn't (not enabled on boot and can't power off if WC24 is on). Not sure if it's JPN specific? (Also tried that Auto Press A and Move Disc hack is working.)

DacoTaco commented 1 year ago

@danny8376 : thanks for testing. did you have any video issues? what video settings do you have set in the wiiu and vwii?

GaryOderNichts commented 1 year ago

However, the WC24 one doesn't (not enabled on boot and can't power off if WC24 is on). Not sure if it's JPN specific?

Yeah, looks to be JPN specific. Checked the JPN system menu binary and the patches don't apply there.
Will adjust this when some of the other issues are resolved.

danny8376 commented 1 year ago

@danny8376 : thanks for testing. did you have any video issues? what video settings do you have set in the wiiu and vwii?

Originally 1080p through HDMI, didn't touch settings in vwii side. Just tested with all combination with Wii U side 1080p/i, 720p, 480p (4:3/16:9) and corresponding vWii side 4:3/16:9, progressive/interlaced (all through HDMI), all seem to be working without any issue on my side. AV cable isn't currently around me so I can't test that part. (I think I might have AV cable somewhere, but need to dig it out.)

DraconicNEO commented 1 year ago

I have a question, would it be possible to have a hack which re-enables the Mail options in the Main menu like how it is on a Normal Wii or was there too much removed from the vWii system menu for that to be possible?

ResidentNintendoNerd commented 1 year ago

I have a question, would it be possible to have a hack which re-enables the Mail options in the Main menu like how it is on a Normal Wii or was there too much removed from the vWii system menu for that to be possible?

Not a dev, but the vWii can actually still add people to its address book and send Wii Mail through the use of dev tools (NWC24 Editor to be specific), so it almost certainly would be possible to reenable it.

DraconicNEO commented 1 year ago

I have a question, would it be possible to have a hack which re-enables the Mail options in the Main menu like how it is on a Normal Wii or was there too much removed from the vWii system menu for that to be possible?

Not a dev, but the vWii can actually still add people to its address book and send Wii Mail through the use of dev tools (NWC24 Editor to be specific), so it almost certainly would be possible to reenable it.

I was a bit more concerned about there being missing assets which would hinder the ability to open the Message and Address Book interface.

Masamune3210 commented 1 year ago

Given that they didnt remove the resources needed for the completely unused settings menu in the vWii System Menu, I would hazard to guess they didn't here either but it ultimately comes down to someone checking for sure

DraconicNEO commented 1 year ago

Given that they didnt remove the resources needed for the completely unused settings menu in the vWii System Menu, I would hazard to guess they didn't here either but it ultimately comes down to someone checking for sure

I guess that would make sense, if they still have the GameCube MC manager menu assets in the vWii menu (found out from a poorly made theme) they probably wouldn't remove the message sending assets either.

GaryOderNichts commented 1 year ago

Given that they didnt remove the resources needed for the completely unused settings menu in the vWii System Menu, I would hazard to guess they didn't here either but it ultimately comes down to someone checking for sure

I did test this in dolphin a while back, and most of the assets are still there. They only removed the button, which I replaced with the Calendar open button for a quick test.

https://user-images.githubusercontent.com/12049776/209827404-8e26026a-efa9-4587-bae1-f95dd751d800.mp4

DacoTaco commented 1 year ago

Given that they didnt remove the resources needed for the completely unused settings menu in the vWii System Menu, I would hazard to guess they didn't here either but it ultimately comes down to someone checking for sure

I did test this in dolphin a while back, and most of the assets are still there. They only removed the button, which I replaced with the Calendar open button for a quick test. 2022-12-15.10-14-54.mp4

was that change/hack huge?

GaryOderNichts commented 1 year ago

was that change/hack huge?

Not really. Simply makes the calendar button open the message write menu instead of the calendar.

[Message board write for vWii]
maxversion=623
minversion=608
amount=1
hash=0x38800007,0x38e00000,0x48076ad5
patch=0x38800008
DacoTaco commented 1 year ago

oh, you just patched the function behind the button lol

DraconicNEO commented 1 year ago

Given that they didnt remove the resources needed for the completely unused settings menu in the vWii System Menu, I would hazard to guess they didn't here either but it ultimately comes down to someone checking for sure

I did test this in dolphin a while back, and most of the assets are still there. They only removed the button, which I replaced with the Calendar open button for a quick test.

2022-12-15.10-14-54.mp4

Oh that's good, I wonder if there's a way we could do it that would preserve the calendar functionality in the final version.

GaryOderNichts commented 1 year ago

Oh that's good, I wonder if there's a way we could do it that would preserve the calendar functionality in the final version.

Not sure if that's possible without modifying the assets.

DraconicNEO commented 1 year ago

Oh that's good, I wonder if there's a way we could do it that would preserve the calendar functionality in the final version.

Not sure if that's possible without modifying the assets.

Yeah that would probably be the only way. Although couldn't you also make it so that once you go into the message menu the back button will take you to the calendar and then from there you can exit back to the main menu?

DacoTaco commented 1 year ago

Oh that's good, I wonder if there's a way we could do it that would preserve the calendar functionality in the final version.

Not sure if that's possible without modifying the assets.

Yeah that would probably be the only way. Although couldn't you also make it so that once you go into the message menu the back button will take you to the calendar and then from there you can exit back to the main menu?

sure, but that doesn't sound very user friendly, logical or useful to me at least

DraconicNEO commented 1 year ago

Oh that's good, I wonder if there's a way we could do it that would preserve the calendar functionality in the final version.

Not sure if that's possible without modifying the assets.

Yeah that would probably be the only way. Although couldn't you also make it so that once you go into the message menu the back button will take you to the calendar and then from there you can exit back to the main menu?

sure, but that doesn't sound very user friendly, logical or useful to me at least

That's a good point, it would definitely be very confusing. It's probably just better as it is and just have people disable it to access the calendar.

DraconicNEO commented 1 year ago

Hey I just had a thought that we should probably add a way to launch Priiloader either by holding the Eject button or the Sync button since the Wii U has no externally wired Reset button and not everyone has a USB keyboard they can use to access it. Similar to what was done on the Wii Mini with the eject tray detection, just with the actual eject button itself for vWii.

Parkeriscoo commented 1 year ago

Hello, I would like to add one small suggestion. Add a system hack where on boot it deletes the forecast channel VFF file. Because the forecast channel data is stored on that VFF file and when you turn on your Wii U after using the forecast channel, the old data is still there.

Ingunar commented 1 year ago

Hello, I would like to add one small suggestion. Add a system hack where on boot it deletes the forecast channel VFF file. Because the forecast channel data is stored on that VFF file and when you turn on your Wii U after using the forecast channel, the old data is still there.

That is a RiiConnect24 thing. News and Forecast are not properly patched for vWii. (Timestamp issue). Disabling weather update on the channel's boot and deleting the .VFF was just a workaround. I already talked with some of the RiiConnect24 developers about this, so they are informed, and they plan to fix it properly when they figure out how...

Sketch is currently working on some fixes

The current version of the Forecast channel is working with vWii Priiloader. But the weather information will update ONLY after the standby download kicks in. (About an hour or more after the vWii screen dims)

PlayerGameSK commented 1 year ago

So with the hack that enables the (normally hidden) Wii system settings on the vWii, is it possible/planned to make so that those settings can be different to those of the Wii U itself? As in they won't get overwritten every time you reboot the vWii? (Gary already replied to my comment under his video saying that "in theory a patch could be made which prevents that", I'm just wondering whether it's something that's actually planned or not)

DraconicNEO commented 1 year ago

So with the hack that enables the (normally hidden) Wii system settings on the vWii, is it possible/planned to make so that those settings can be different to those of the Wii U itself? As in they won't get overwritten every time you reboot the vWii? (Gary already replied to my comment under his video saying that "in theory a patch could be made which prevents that", I'm just wondering whether it's something that's actually planned or not)

I think right now their main priority is to get Priiloader working in a state that regular people can use it (fixing the more annoying bugs) though I do think that's a great idea and hopefully they do something like that for people who would want it.

SwiftyPeed commented 1 year ago

How do I download and put this on my Wii U so I can start Riiconnect24 automatically? I really have been wanting to try this out.

DraconicNEO commented 1 year ago

How do I download and put this on my Wii U so I can start Riiconnect24 automatically? I really have been wanting to try this out.

I don't think it's ready yet for general users, still a lot of bugs to fix. Though if you wanted to try it yourself you could try compiling it yourself or asking someone to do it. I would still recommend waiting though for the final release since you never know what kind of issues you'll encounter on a beta version like this one.

oscie57 commented 1 year ago

hey there! just installed this to my vwii, and it seemed to work fine!

minor suggestion: maybe the "BootMii IOS" button should be removed, as the vwii doesnt support bootmii image

DraconicNEO commented 1 year ago

hey there! just installed this to my vwii, and it seemed to work fine!

minor suggestion: maybe the "BootMii IOS" button should be removed, as the vwii doesnt support bootmii image

I think it still might be of use since you can still use IOS254 (BootMii IOS) to boot Wii Linux Installs on vWii

DacoTaco commented 1 year ago

also, i'd rather not change something in the menu code haha so thank god it can still be used lol

DacoTaco commented 1 year ago

@GaryOderNichts : this looks great and i'd love to merge this asa the comments are resolved. i will probably move some things to libogc and/or replace some things with the new sha/aes implementation in libogc once that is released.

Ingunar commented 1 year ago

image

This is code taken from the hacks_hash.ini One person said that is happening on Wii too.

Can someone confirm that this is currently a bug on Wii too?

DraconicNEO commented 1 year ago

image

This is code taken from the hacks_hash.ini One person said that is happening on Wii too.

Can someone confirm that this is currently a bug on Wii too?

Confirmed, this problem does indeed occur on Wii.

Tested on 4.3U and 4.3J (On 4.3J the problem does not occur because this code does not appear to work on 4.3J, at least in this version or at the very least I couldn't get it working).

Ingunar commented 1 year ago

@DacoTaco Is there a reason why the [Mark Network Con as Tested] hack is currently disabled? minversion=0 disables it

https://github.com/DacoTaco/priiloader/blob/787ee194e7d6b2f23765ff033788cd529d46beb7/priiloader/hacks_hash.ini#L577-L582

DacoTaco commented 1 year ago

@DacoTaco Is there a reason why the [Mark Network Con as Tested] hack is currently disabled? minversion=0 disables it

https://github.com/DacoTaco/priiloader/blob/787ee194e7d6b2f23765ff033788cd529d46beb7/priiloader/hacks_hash.ini#L577-L582

besides it being a useless (imo) hack, not really any reason its disabled. that said, this is not the spot to discuss this i think

Ingunar commented 1 year ago

@DacoTaco Is there a reason why the [Mark Network Con as Tested] hack is currently disabled? minversion=0 disables it https://github.com/DacoTaco/priiloader/blob/787ee194e7d6b2f23765ff033788cd529d46beb7/priiloader/hacks_hash.ini#L577-L582

besides it being a useless (imo) hack, not really any reason its disabled. that said, this is not the spot to discuss this i think

Ok, I asked here because we are porting over all of the SM hacks and verifying that existing ones work. We are almost done with porting and partially done with testing. We will skip that one.

DacoTaco commented 1 year ago

@DacoTaco Is there a reason why the [Mark Network Con as Tested] hack is currently disabled? minversion=0 disables it https://github.com/DacoTaco/priiloader/blob/787ee194e7d6b2f23765ff033788cd529d46beb7/priiloader/hacks_hash.ini#L577-L582

besides it being a useless (imo) hack, not really any reason its disabled. that said, this is not the spot to discuss this i think

Ok, I asked here because we are porting over all of the SM hacks and verifying that existing ones work. We are almost done with porting and partially done with testing. We will skip that one.

oh, in that case, feel free to put 1 as minimum version

TCAtrevor commented 1 year ago

Oh that's good, I wonder if there's a way we could do it that would preserve the calendar functionality in the final version.

Not sure if that's possible without modifying the assets.

Yeah that would probably be the only way. Although couldn't you also make it so that once you go into the message menu the back button will take you to the calendar and then from there you can exit back to the main menu?

sure, but that doesn't sound very user friendly, logical or useful to me at least

I still think it would be very convenient. The menu hack to access Wii Options does a similar thing already, looping back to data management. I think it would be reasonable for someone to understand why it does that the first time they see it happen with the hack enabled.

TCAtrevor commented 1 year ago

Also going with Wii Mail, theres no way to send images to people from the message board, thats another button that got removed on the vWii. I do understand, however, that it is a lot harder to readd new buttons that were fully removed instead of reassigning the buttons that are still left.

Ingunar commented 1 year ago

Also going with Wii Mail, theres no way to send images to people from the message board, thats another button that got removed on the vWii. I do understand, however, that it is a lot harder to readd new buttons that were fully removed instead of reassigning the buttons that are still left.

Can confirm this, the "Send" button is hidden/removed. The only way to send pictures is from the Wii Speak.

TCAtrevor commented 1 year ago

image IMG_4004 Here on top, you can see the "Send" button shown for original Wiis, while the bottom is the button is removed on vWii.

DraconicNEO commented 1 year ago

I wonder if now that we have bypassed the restriction that prevented modification of the System menu if we could just simply patch the system menu Archives on vWii to contain those buttons once again.

Masamune3210 commented 1 year ago

But is WiiMail worth the effort though

DraconicNEO commented 1 year ago

But is WiiMail worth the effort though

Absolutely, maybe it might be a good idea to add dectection to Priiloader for system menu patches so if direct patches to re-enable features are done in the future people won't uninstall priiloader and brick their systems (vWii menu has checks for modifications that unless I'm understanding incorrectly may not work without Priiloader.

Ingunar commented 1 year ago

So with the hack that enables the (normally hidden) Wii system settings on the vWii, is it possible/planned to make so that those settings can be different to those of the Wii U itself? As in they won't get overwritten every time you reboot the vWii? (Gary already replied to my comment under his video saying that "in theory a patch could be made which prevents that", I'm just wondering whether it's something that's actually planned or not)

Doing a third round of testing. This hack could be available soon.

Ingunar commented 1 year ago

I wonder if now that we have bypassed the restriction that prevented modification of the System menu if we could just simply patch the system menu Archives on vWii to contain those buttons once again.

I already patched the assets archives, that is not a problem. They are almost all there. And nothing will break if Priiloader is uninstalled. All in this note: https://hackmd.io/@Ingunar/vWiiSMAssets

SM binary patching is needed. Some button functions have been deleted, that is the problem. (Gary looked a bit into it...) It is not impossible but demands a lot more REIng, time, and creativity.

Currently, advanced button patching is not a priority, but I am noting everything we find. Finding the reason for the black screen boot is the number one thing that is halting the progress....

VehicularVortex commented 1 year ago

Quick question: Will the evWii plugin for Aroma (specifically the 4-second power down function) cause conflict with shutting the console down with WC24 patches enabled? Or does it act as its own thing? Just curious.

DacoTaco commented 1 year ago

Quick question: Will the evWii plugin for Aroma (specifically the 4-second power down function) cause conflict with shutting the console down with WC24 patches enabled? Or does it act as its own thing? Just curious.

wdym conflict?