ELF to DOL Converter
What is this for?
When HBCb9 came out, they decided that they no longer need to support any invalid .elf files. If you have .elf files, you need to convert then to .dol with some little program that gets buried in some directory when/if you install devkitPPC. This script will automate the task of converting all your stuff. It even comes with that little program so you don't need to install the entire devkitPPC.
Note: homebrew games and applications for Wii should not be distributed as elf files. These files are only to assist with debugging.
What do I do?
There are 3 files in the archive. Do whatever you want with the readme.txt, but put the other 2 files in your apps folder on the SD card (you need that sd card reader again :-/). Then just run the elf-dol_converter file and follow the directions on the screen. On Linux you may have to do chmod 755 elf-dol_converter first, and on Mac OS X you may need to do chmod 755 elf-dol_converter; chmod +x elf-dol_converter first. When you are done, you can leave the files on your SD card, or remove them, whatever floats yer boat.
What does it do?
This script looks in other folders in the folder that it's in and turns any file it finds that's named boot.elf into a file that's named boot.dol. If everything goes as planned, the new boot.dol will be in the format HBCb9 likes. So you can run it, and it will convert all your apps in one go, as long as they were setup the way HBC likes them (/apps/app_name/boot.elf).
- This script will affect files named boot.elf; files named boot.dol may also get overwritten if they are in the same folder as a boot.elf. If your .elf file is not named boot.elf, and located in the right place, this script will not touch it.
- This script deletes the old .elf files after it's done with them. If you want to keep them either back them up beforehand, or edit the script to not erase.
- There are some valid .elf files out there. Running this script on them will cause them to stop working. Backup your apps folder before you run this.
- The Linux (and Mac?) version has a little bug where if a directory directly under /apps has a space in its name, the script will complain and not look in that directory. The windows version should handle this without any problems.
- The Windows version has a bug/feature that it will also convert a boot.elf file that is in the same directory as itself (exempli gratia, \apps\boot.elf).
List of apps with valid .elf files
These should not be run through this converter. Backup these programs before running this script, as it doesn't have the smarts to avoid them. Please add to this list if you find (or make) something that should be in it. So far the list is:
Cheapo workaround is to rename (not convert) a valid boot.elf to boot.dol. HBC still loads it just fine, and this script will ignore it. Not ideal, but we're all hackers here, right?
Explanation of v1.1 windows code
The Unix(Mac OS X and Linux) scripts work very similar to this script.
|@ ECHO off||Makes it so only lines that start with 'echo' will print on the screen.|
|echo This will delete your old boot.elf files when it's done.|
|echo So if you have some perverse attachment to them, figure something out.|
|echo Press ctrl+c to NOT continue.|
|echo.||Makes a blank line.|
|pause||Asks you to press the "Any" key (not shift) :P|
|for /R %%f in (.) do if exist "%%f\boot.elf" (||Makes %%f hold the path to every directory in this directory, one by one. But not any directories under those.|
|powerpc-gekko-objcopy.exe -O binary "%%f\boot.elf" "%%f\boot.dol"|
|if exist "%%f\boot.dol" (del "%%f\boot.elf")||If it worked, erase the .elf.|