• Welcome to Smashboards, the world's largest Super Smash Brothers community! Over 250,000 Smash Bros. fans from around the world have come to discuss these great games in over 19 million posts!

    You are currently viewing our boards as a visitor. Click here to sign up right now and start on your path in the Smash community!

Dol specifics

shuall

Smash Apprentice
Joined
Jun 26, 2013
Messages
155
Location
Philly
I don't know where the info on dols comes from but this seems like a good place to verify it (that and the dolphin forums seem to be more geared to dolphin-emu, and not general hacking).
Wiibrew has a page on the file format http://wiibrew.org/wiki/DOL there. It hasn't been updated in a while, and I have a couple questions.

EDIT: finished! Here's the source for my own dol2elf converter: https://github.com/shua/dol2elf

  1. Are there any official dols that use more than 2 text segments or more than 8 data segments, because all the ones I have seem to follow a trend.
  2. I'm interested as to the boot process. Is it apploader.img which loads boot.bin which loads main.dol, or boot.bin -> apploader -> main.dol?
  3. The general format seems to be
    Code:
    text 0 : .init
    text 1 : .text
    data 0 : extab
    data 1 : extabindex
    data 2 : .ctors
    data 3 : .dtors
    data 4 : .rodata
    data 5 : .data
    data 6 : .sdata
    data 7 : .sdata2
    I don't know how this corresponds to elfs, but the current elf2dol provided with devkitppc outputs only 1 text and 1 data, because it converts based on program headers (segments), which I think is incorrect; the official dols seem to be separated more into sections.
  4. Does anyone have this mysterious doltool from TenofTen? All the links I found point to devkitpro's sourceforge which doesn't have it anymore.
  5. Lastly, are the text sections encrypted? because I haven't managed to disassemble the blocks as binaries. Maybe it's my objdump settings, but I should have something more intelligible, even with ppc: common.
    edit: it was the objdump settings (needed --endian=big), the command I used:
    Code:
    powerpc-eabi-objdump -D -b binary -mpowerpc:750 --endian=big binaryfile
edit: yeah, looking at the map files from zelda:windwaker, I think the dols are separated by sections and not segments. I should be able to work out an okay dol->elf converter again, if I can't find TenofTen's.
 

shuall

Smash Apprentice
Joined
Jun 26, 2013
Messages
155
Location
Philly
Don't know if anyone cares, but here's extra info I've found on the data sections. sdata is not really used with x86 assembly, more ppc and arm, and it means short or small data, and it should be small initial variables. There's two here (sdata and sdata2) and with every data section, you also need a bss section. So there should be bss, sbss and sbss2 sections, but with the transform to dols, all bss sections get stuck together as one big bss. This doesn't really matter because a bss section is simply a reminder in the file to reserve that much space at a specific location in memory to use when the program is running.

I'm almost done with the dol to elf conversion tool, I just have to figure out what the extab and extabindex sections are. There's documentation on them, but only for ARM, no PPC :( They seem to be related to exception handling but they're not eh_frame and eh_frame_hdr, which is exception unwinding sections for x86.

Again, I don't know if this is specifically relevant to smash, but it is related to melee hacking, because that's the main reason I'm doing this. I think there's a couple more interesting hacks we can squeeze out by properly disassembling the binary.
 

Steelia

Smash Champion
Joined
Sep 23, 2007
Messages
2,523
Location
Home.
Unfortunately, all of this goes way over my head :p But it's still great to see some digging being done. Good luck with the conversion, hope it produces some interesting results :)
 

shuall

Smash Apprentice
Joined
Jun 26, 2013
Messages
155
Location
Philly
Thanks. Disassembling the binary is like 10% of the way there, the other 90% is being one of the wizards (skilled in the blackest of magics) who can leaf through 10000+ lines of assembly and figure out what it does.

I think I have 3 possible routes to go with this. From most likely to least:
1. go over windwaker debug files and try to weed out generic gamecube framework stuff from specific melee code
2. try to find fileio stuff and better understand how .dat files are read/parsed
3. try to hack the game (I'm thinking adding character slots and map slots would be most useful, but I have no idea where to start with that stuff).

Is there some other gamecube hacking forum where people might be able to use this? Or where I might find someone who has already figured out all this stuff?
 
Top Bottom