Welcome! Log In Create A New Profile

Advanced

Wii blocking sockets + several other questions.

Posted by JeremyWilms 
Wii blocking sockets + several other questions.
December 30, 2009 04:12AM
Okay so first off:
I'm programming a networking module for the wii, nearly done however I have a method I wish to use to end a session( a session consists of essentially, a socket + a thread, and other related data, such as pointers to callbacks that handle events, i.e a new connection, and received messages). The problem is when I wish to terminate this thread, I get a pointer to the struct holding sessionData the thread is using and set a flag within it. Each time the thread loops through it's routine(which reads from sockets or listens for connections, etc..) it checks if the flag is set, if it is, it ends. However the routine will get stuck at calls such as net_recv, or net_listen, as those methods stop execution, thus delaying or completely preventing the thread from repeating it's routine(where it checks the flag which is set when it needs to end). To assure it's not in a blocked state after setting the flag, can I take it out of a blocked state using LWP_ResumeThread after setting the flag that will cause the thread to terminate?

Alright, now for another question. I've read most homebrew apps are written in C, while I have lots of experience in C, I enjoy OOP, and thus prefer C++. Is it safe to use C++, do I have to write any methods to handle memory allocation for creation of class instances, or any of that crap?

Lastly, yesterday, I backed up one of my games, dumped it, then burned the dump to a DVD-R. I have read there's a bunch of stuff that needs to be done to my wii console to run the backed-up copy. I'm alright with doing this under a couple conditions:
-Bootmii can be installed and executed on wii boot. And won't be affected regardless of how much damage has been done to wii system files
-Bootmii can fully restore any alterations\damage to the wii system files
-If Bootmii for some reason has backed-up incorrectly, I can install something onto my SD Memory card and use that as a backup
-I won't be 'bricked' or banned if I use the altered software online, and play with friends over a network.

The problem is I can't install bootmii as 'boot2' and thus it has to be launched via the homebrew channel. What's the use of this if I can't access it when the system gets damaged and I can't reach the homebrew channel?

Thanks in advance.
Re: Wii blocking sockets + several other questions.
December 30, 2009 04:16AM
Sorry for double post, I should mention I've updated my wii firmware to 4.2, unfortunately, so I need to downgrade which may cause bricking apparently.
Re: Wii blocking sockets + several other questions.
December 30, 2009 04:47AM
1. Backups are not supported here.
2. Downgrades are not supported here, and are never necessary.
3. You can't do anything to get BootMii installed as boot2 on that Wii. You can use Preloader or Priiloader (the latter is a newer version of the former) to provide protection against some bricks, but if the System Menu is deleted/updated/replaced, Preloader is removed, so your brick protection isn't as comprehensive as it would be with BootMii.



Edited 1 time(s). Last edit at 12/30/2009 04:47AM by WikiFSX.
Re: Wii blocking sockets + several other questions.
December 30, 2009 05:04AM
For #3, out of interest, can I ask why I am unable to install it as boot2?

1. Will a system update cause a brick in some cases?
2. How can I assure any alterations to my wii are restored to their factory defaults?
3. After installing the HBC channel, is there any way I can remove it's trace from my system, allowing me to send it in to be repaired, if it ever does become damaged?
4. Is there any chance of me bricking my own wii if my code is faulty and executes on the wii?



Edited 2 time(s). Last edit at 12/30/2009 05:07AM by JeremyWilms.
Re: Wii blocking sockets + several other questions.
December 30, 2009 10:26AM
1. I believe the only thing that can cause this is if you have a Korean Wii and change the region, and then try to update to 4.2
2. You can't. But you can make a backup through BootMii and later restore your Wii to the earlier state.
3. It's not simple removing *all* traces, but you could delete the HBC channel (via the System Menu), for starters...
4. Depends on what the code does. If you are just writing a game or something, then there's no way it will cause damage or brick. If you're trying to write an app that deletes an IOS, but you accidentally code it to delete ALL of them, well...good luck. Basically anything that alters the NAND could run you into trouble.
Re: Wii blocking sockets + several other questions.
December 30, 2009 02:13PM
The reason that you cannot install BootMii in boot2 on that Wii is that the installation of BootMii relies on a bug in older versions of boot1 (the Wii's second-stage bootloader, boot2 is the third, boot0 is the first) that allowed modified versions of boot2 to still look valid. Newer versions do not have this bug, forcing BootMii/boot2 to install on those systems would cause boot1 to refuse to start boot2.

EDIT: By the way, about your other question: I'm not well-versed enough in programming to tell you what to do, but I know you can do C++ programming on the Wii.



Edited 1 time(s). Last edit at 12/30/2009 02:17PM by WikiFSX.
Re: Wii blocking sockets + several other questions.
December 30, 2009 11:00PM
Alright, thanks guys. I'll for sure put some time into looking into the wii internals. The low-level parts of a system are always the most interesting.

I resolved my blocking sockets issue. Apparently there is no way to take it out of a blocking state(on linux I believe there is, but not universally, so I don't want to use it). Thus I need to close the socket to take it out of a blocking state after setting the flag which requests the thread ends.
Re: Wii blocking sockets + several other questions.
December 30, 2009 11:27PM
Gah. One more question:

I have installed homebrew wii via banner-bomb, and bootmii(which I plan to uninstall, as it's only installed as IOS). Is there any reason I should install a preloader? I do not plan to do anything else, other then play purchased games and execute some home-made projects.
Re: Wii blocking sockets + several other questions.
December 31, 2009 12:14AM
Preloader is useful for several things:

-System Menu "hacks" (patches to change the functionality of System Menu e.g. Region Free games/channels, Block updates etc. These patches can also be installed through a program called StartPatch, without the need of preloader)
-Autobooting HBC, BootMii/IOS or a .dol file (one possible .dol file is CrazyIntro, which lets you assign channels to each button, so you could have legal channels for your favourite homebrew apps, then on boot, you can press certain buttons to load them, and have a button for HBC and a button for System Menu)
-Changing System Menu IOS (not that useful, only one use I know of, which isn't something supported here)
-Slight brick protection (not as strong as BootMii, but better than nothing. Provided System Menu IOS and System Menu are intact, preloader will be able to start. So it can fix bannerbricks and the like, but not full bricks.

If those features seem useful to you, install preloader. Actually, install priiloader, which is an unofficial mod of preloader, which has come into existance since crediar stopped official development of preloader, and has made several improvements to it.
Re: Wii blocking sockets + several other questions.
December 31, 2009 05:06AM
What are bannerbricks? I did install homebrew via bannerbomber, is that relevant?
Re: Wii blocking sockets + several other questions.
December 31, 2009 06:02AM
No, I believe a banner brick is when you install a corrupt channel wad, or an invalid banner. It has nothing to do with bannerbomb.



Edited 2 time(s). Last edit at 12/31/2009 06:02AM by WaxyPumpkin72.
Re: Wii blocking sockets + several other questions.
December 31, 2009 01:04PM
Well, bannerbomb actually sortof uses a bannerbrick to work. It exploits the System Menu's bad handling of invalid banners. But anyway, thats largely irrelevant. You will only get bannerbricks from a)pirating WW/VC games and getting a corrupted WAD or b)making custom channels and messing up the banner (if you use something like CustomizeMii, it checks the banners so you should be safe, but its still good to have a bit of protection)
Re: Wii blocking sockets + several other questions.
December 31, 2009 02:25PM
Thanks again.
Sorry, only registered users may post in this forum.

Click here to login