-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Support ELFs #14
Comments
I don't think I'll be supporting ELF formatted binaries in this loader. I looked into doing it, but it seems like my choices are either to use the stock ELF loader Ghidra supplies or create a completely new one. If anyone else wants to implement it, then by all means go for it. |
I would like to second the request for elf support. The stock Ghidra ELF loader does not seem to properly handle Gamecube elf files properly. It seemingly fails to decode the instructions in many functions, and creates unusable results. This is a shame because the game I'm working on has full debug symbol coverage in this elf and I have no way of utilizing it, since I can't actually load the elf in anything. |
I've imported a few ELF files from Wii games without issue; the one thing you need to do when using the default ELF loader is change the language from normal powerpc to the gekko variant (otherwise, you will get unknown instructions). (I don't remember if you need to uncheck the show only recommended languages option for gekko to show up in that case). |
Oh, though I should add that importing like that does skip the other functionality provided by this (detecting SDA values and generating the default sections). For the first one I use a script to set up the SDA, and for the second I can use the following python: from ghidra.app.util.importer import MessageLog
from gamecubeloader.common import SystemMemorySections
log = MessageLog()
SystemMemorySections.Create(currentProgram, log)
log.write(None, None) |
For more recent versions, I was able to do this as a workaround instead: from ghidra.app.util.importer import MessageLog
from gamecubeloader.common import SystemMemorySections
from ghidra.app.util.bin import ByteProvider
from ghidra.util.task import TaskMonitor
log = MessageLog()
SystemMemorySections.Create(ByteProvider.EMPTY_BYTEPROVIDER, currentProgram, TaskMonitor.DUMMY, log)
log.write(None, None) The SDA portion is available as an analyzer (the GameCube/Wii program analyzer, which isn't checked by default). |
In some games the unstripped ELF has been left in, currently trying to load these it throws
"Unable to load REL file! Reason: Relocation Data offset in header is past the file bounds!"
Also worth noting there's typically a .debug section in these ELF's containing partial?(seems to be the devs selected what to include as symbols for specialized debugging) debug symbols.
ELF's like these can be found though-ought the GC SDK.
The text was updated successfully, but these errors were encountered: