Oh, I don't want it to work on actual WADs - that'd lead to all sorts of troubles with people who don't have a clue what they're doing getting dodgy WADs that've been badly patched, etc.giantpune said:here it is, starting at line 419 http://code.google.com/p/usbloader-gui/sou...hes/patchcode.c
i think that the easiest way to impliment this is with a few little checks...
1) is the wad being installed 0x00010001, 0x00010002, or 0x00010004
2) is the content being installed NOT a u8 archive
3) try the patch. if it is successful, then dont try any more of the content in that wad.
apparently nickasasa says that triiforce uses a different way to boot channels, so it may work there. but the reason it doesnt work for channels booted by the libogc or geckoOS method is that we never deal with the "meat & potatoes" of the channel. At the most, we just load up the little nandloader doodad and it is what actually puts the meat & potatoes part into memory. Since we can't patch it is it is getting put into memory ( since the nand loader is doing that ) we can just patch it as it is getting put onto the nand, so it will be patched already when the nandloader thingy reads it.
i thought already about doing this with a PC app like toejam asked about. but i have a big issue with that. this patch isnt just a "change a to b and c to d" patch. So, while it is reversible, it is not advised to do this to actual wads. Instead, i think wads should just be patched as they are installed. Then if you decide you want the channel to exit to some other place, you can just reinstall the exact same wad but change the TID it uses. This can be done with showmiiwads also. you will just need to convert this to c# and toss it in there.
I'd rather it patch the files extracted onto the virtual NAND (preferably during the extraction) similar to what'll happen with YAWMM if it's implemented - that or patching the file when it's been added to the NAND. Either method is fine, but whatever is logistically possible (I believe that it'd have to be done during the extraction just due to the headaches it could otherwise induce, but I could be wrong). Also, would it be possible for the user to define the channel the installed game would return to?