In memory of Ben “bushing” Byer, who passed away on Monday, February 8th, 2016.

Difference between revisions of "ELF to DOL Converter"

From WiiBrew
Jump to navigation Jump to search
(Undo revision 88010 by Cease and Desist (Talk))
Line 1: Line 1:
This is a warning to the owners of this site. My name is Shigeru Miyamoto and I am disappoint. You are breaking the DCMA laws. DCMA laws protect our freedoms far into the furture. There is over 9000 pages here and I want every single one of them gone by next week. This is not a threat but a promise. Every day after that week is up, I will sue you for $100,000 a day.
+
{{Infobox homebrew
 +
| title      = ELF to DOL Converter
 +
| type        = pc utility
 +
| licence    = GNU GPL (uses objcopy from GNU Binutils)
 +
| author      = [[User:Yossi|Yossi]] (Windows, Linux)<br />[[User:Yossi|Yossi]], Pegasus23 & [[User:Nintendork32|^sk8rboy^]] (Mac)
 +
| version    = v 1.3
 +
| downloadraw    = [[Media:ELF-DOL_Converter_windows.rar|Windows]]<br />[[Media:ELF-DOL_Converter_linux.tar.gz|Linux]]<br />[[Media:ELF-DOL_Converter_mac.tar.gz|Mac OS X]]
 +
| source      = included
 +
}}
 +
== What is this for? ==
 +
When [[Homebrew Channel#Beta 9|HBC Beta 9]] came out, its authors decided to no longer support any invalid .elf files. This change was made with little, if any, notification given to users or authors. If you had invalid .elf files, you were screwed, unless you converted them to .dol format with some little program that got buried in some directory when/if you installed [[devkitPPC]]. This script was written to 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.
  
Thank you for using Nintendo. We must ensure our freedoms through use of the DCMA. This not the analog millennium one passed in 1000 A.D., but the digital one.
+
'''Note:''' old devkitPPC releases actually had broken .elf support and applications should '''not''' have been distributed as .elf files. Modern versions of devkitPPC produce valid .elf files that are acceptable as well as .dol files. This script is really only for old .elf releases where the author has yet to release a valid .elf or .dol.
  
==CEASE==
+
== What do I do? ==
AND DESIST
+
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 and on Mac OS X you may need to do <tt>chmod +x elf-dol_converter.sh</tt> first. When you are done, you can leave the files on your SD card, or remove them, whatever floats yer boat.
 +
<youtube>x8AoUhpDZtc</youtube>
 +
 
 +
== 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).
 +
 
 +
== Notice! ==
 +
* 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. '''Unless your .elf file is 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 [[ELF to DOL Converter#List of apps with valid .elf files|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 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).
 +
 
 +
== Partial list of apps with valid .elf files ==
 +
These apps 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 release) something that should be in it. So far the list is:
 +
:* [[Kobo Deluxe]]
 +
:* [[GeeXboX]]
 +
:* [[OpenTyrianWii]]
 +
:* [[Wii Linux]]
 +
:* [[Nowell]]
 +
:* [http://hackmii.com/2009/02/bootmii-checker/ BootMii checker]
 +
:* [http://hackmii.com/2009/05/bootmii_beta_1/ BootMii beta 1] (and 2, and 3, etc.)
 +
:* Just about any .elf released since the end of October 2008
 +
 
 +
Cheapo workaround is to rename (not convert) each 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.
 +
{| class="wikitable"
 +
|-
 +
! colspan="2"|Elf converter
 +
|-
 +
! Code !! Explanation
 +
|-
 +
| <tt>@ ECHO off</tt> || Makes it so only lines that start with 'echo' will print on the screen.
 +
|-
 +
| colspan="2"| <tt>echo This will delete your old boot.elf files when it's done.</tt>
 +
|-
 +
| colspan="2"| <tt>echo So if you have some perverse attachment to them, figure something out.</tt>
 +
|-
 +
| colspan="2"| <tt>echo Press ctrl+c to NOT continue.</tt>
 +
|-
 +
| <tt>echo.</tt> || Makes a blank line.
 +
|-
 +
| <tt>pause</tt> || Asks you to press the "Any" key (not shift) :P
 +
|-
 +
| colspan="2"| <tt>echo.</tt>
 +
|-
 +
| <tt>for /R %%f in (.) do if exist "%%f\boot.elf" (</tt> || Makes %%f hold the path to every directory in this directory, one by one. But not any directories under those.
 +
|-
 +
| colspan="2"| <tt>powerpc-gekko-objcopy.exe -O binary "%%f\boot.elf" "%%f\boot.dol"</tt>
 +
|-
 +
| <tt>if exist "%%f\boot.dol" (del "%%f\boot.elf")</tt> || If it worked, erase the .elf.
 +
|-
 +
| colspan="2"| <tt>)</tt>
 +
|-
 +
| colspan="2"| <tt>echo Done!</tt>
 +
|-
 +
| colspan="2"| <tt>pause</tt>
 +
|}

Revision as of 21:39, 7 August 2010

ELF to DOL Converter
General
Author(s)Yossi (Windows, Linux)
Yossi, Pegasus23 & ^sk8rboy^ (Mac)
TypePC utility
Versionv 1.3
LicenceGNU GPL (uses objcopy from GNU Binutils)
Links
Windows
Linux
Mac OS X
Source Included

What is this for?

When HBC Beta 9 came out, its authors decided to no longer support any invalid .elf files. This change was made with little, if any, notification given to users or authors. If you had invalid .elf files, you were screwed, unless you converted them to .dol format with some little program that got buried in some directory when/if you installed devkitPPC. This script was written to 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: old devkitPPC releases actually had broken .elf support and applications should not have been distributed as .elf files. Modern versions of devkitPPC produce valid .elf files that are acceptable as well as .dol files. This script is really only for old .elf releases where the author has yet to release a valid .elf or .dol.

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 and on Mac OS X you may need to do chmod +x elf-dol_converter.sh 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).

Notice!

  • 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. Unless your .elf file is 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 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).

Partial list of apps with valid .elf files

These apps 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 release) something that should be in it. So far the list is:

Cheapo workaround is to rename (not convert) each 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.

Elf converter
Code Explanation
@ 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
echo.
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.
)
echo Done!
pause