Executable files in a Wii game disc

Discussion in 'Wii - Hacking' started by externalist, May 16, 2010.

May 16, 2010
  1. externalist
    OP

    Newcomer externalist Member

    Joined:
    Feb 16, 2010
    Messages:
    23
    Country:
    Korea, South
    Hi,
    I'm trying to find out which files are involed in the execution of Wii games(disc).
    I've heard that not only main.dol, but a lot of relocatable modules are involved. Does anyone know how the execution sequence goes? Like which files with which extensions are involved and executed in which sequence?
    Thanks!
     


  2. SickPuppy

    Member SickPuppy New Member

    Joined:
    Jul 29, 2009
    Messages:
    1,661
    Country:
    United States
    It would be nice to be able to create a bootable Wii homebrew disc. I was looking around the web for this too, but the best I could find is creating a GC homebrew disc.
     
  3. externalist
    OP

    Newcomer externalist Member

    Joined:
    Feb 16, 2010
    Messages:
    23
    Country:
    Korea, South
    you have a link for that? Would be very helpful! [​IMG]
     
  4. giantpune

    Member giantpune GBAtemp Addict

    Joined:
    Apr 10, 2009
    Messages:
    2,860
    Country:
    United States
    the system menu ( or game loader such as geckoOS ) gets the apploader from the disc and runs it. the apploader copies the main dol into memory. then the system menu can jump to the entrypoint of the dol and play it. for "multi dol" games, there are multiple dols in the game (hence the name) and each one of those is a executable file.
     
  5. externalist
    OP

    Newcomer externalist Member

    Joined:
    Feb 16, 2010
    Messages:
    23
    Country:
    Korea, South
    What is the filename of the apploader?
    Also, I thought it was impossible to run multiple processes(.dols) in Wii, even though multi threading is possible. Are the multi dols run simultaneously or one after another?
    Thanks!
     
  6. giantpune

    Member giantpune GBAtemp Addict

    Joined:
    Apr 10, 2009
    Messages:
    2,860
    Country:
    United States
    the filename of the apploader depends on whatever tool you are using to look at the image. wiiscrubber calls it apploader.img, but it doesnt have a set name. instead, look for it at 0x2440 inside the partition. the first 0x20 bytes are the header and you can get the size from that. look at the apploader code in any game loader to see how they deal with it and run it.

    as far as the multiple processes, it is possible to have many threads running at the same time. but it is not done with multiple dos. you just run 1 dol and within that dol have different threads. libogc has support for threading there. look at libwiigui for help with threading.
     
  7. externalist
    OP

    Newcomer externalist Member

    Joined:
    Feb 16, 2010
    Messages:
    23
    Country:
    Korea, South
    hmm... so is it possible to run 1.dol and within that 1.dol code, run 2.dol as a thread? I'm really curious how the execution of multi dols work... particularly if they could all run simultaneously.

    Also, do you know of any tool to look into Wii game disc files? All I know at the current moment is Wiiscrubber, and while it is a great tool, I can't seem to find an option to actually "add" a file in an existing .iso, even though it's possible to "replace" an existing file. I'm needing that feature at the current moment so need to find a tool that does it or code my own. But info about wii discs are pretty scarce so I really don't know how to start. Do you possibly know of any open source tools that deal with wii game discs, or some place with technical information other than wiibrew?
    Thanks!
     
  8. giantpune

    Member giantpune GBAtemp Addict

    Joined:
    Apr 10, 2009
    Messages:
    2,860
    Country:
    United States
    youre not getting this. you dont run 2 dols at one time. if you want 2 running threads at 1 time, you put both threads in 1 dol.

    and what would you do once you inserted an extra file into the game? the files are called by name. and the names are hard coded. you can add files, but since the names are hard coded, your inserted file will never be used. it will just sit there in the iso.
     
  9. externalist
    OP

    Newcomer externalist Member

    Joined:
    Feb 16, 2010
    Messages:
    23
    Country:
    Korea, South
    Is that why you can only "replace" a file and not add one?
    But still... if the names are hardcoded in the iso, then wouldn't it still be possible to add another entry in the 'name table', add another file, then do whatever update is needed in binary level that would reflect the changes in the iso, assuming you have a firm understanding of the iso format? Just like adding a new section in an elf file and put new code/data in there, then do whatever update is needed in the elf header, program header, section header etc. and have a working resulting elf. Or is there something else that makes adding files impossible?

    This is why I'm looking for a good site/document that explains the disc file format, all my questions must seem noobish to all of you gurus :/
     
  10. giantpune

    Member giantpune GBAtemp Addict

    Joined:
    Apr 10, 2009
    Messages:
    2,860
    Country:
    United States
    the filenames are hard coded in the the dol. you should put all the files you need into the ISO at the same time you add the main dol. you can replace them later. but i dont see any reason why you would want to add files to the iso without changing the main dol at the same time
     
  11. externalist
    OP

    Newcomer externalist Member

    Joined:
    Feb 16, 2010
    Messages:
    23
    Country:
    Korea, South
    Yeah that's exactly what I'm trying to do. Something like make a homebrew application, then somehow pack it neatly into the iso along with whatever components the iso must include, then see if it loads from the waninkoko's usb loader. For now, this is just for testing purposes to see if it works, and I might later utilize it on my later projects... Do you know if anyone has done this yet?
    Also, even though I asked several times in my previous post, do you happen to know of a place(thread, site, doc) of a detailed information about wii game discs? If there isn't any, then I guess I'll have to keep bugging you guru guys later on about wii discs. Hope you don't mind [​IMG]
     
  12. Wiimm

    Member Wiimm Developer

    Joined:
    Aug 11, 2009
    Messages:
    2,051
    Location:
    Germany
    Country:
    Germany
    to smuggle code like Han Solo and other pirates [​IMG]
     
  13. Wiimm

    Member Wiimm Developer

    Joined:
    Aug 11, 2009
    Messages:
    2,051
    Location:
    Germany
    Country:
    Germany
    - http://wiibrew.org/wiki/Wii_Disc (and other pages of that wiki)
    - source code of my WIT (may extract and compose wii discs)
     
  14. WiiCrazy

    Member WiiCrazy Be water my friend!

    Joined:
    May 8, 2008
    Messages:
    2,391
    Location:
    Istanbul
    Country:
    Turkey
    Use this one : http://hackmii.com/2008/08/open-source-app...r-iso-template/

    You don't have to create another dol on the disk or anything similar... you just put your homebrew application's dol file as main.dol in the disc.

    And you would be using complete homebrew apploader so you can freely distribute the said created disc.
     
  15. externalist
    OP

    Newcomer externalist Member

    Joined:
    Feb 16, 2010
    Messages:
    23
    Country:
    Korea, South
    Awesome! [​IMG] So all I have to do is get the template disk from the link, then replace the main.dol on the disk with my homebrew main.dol and that's it?
     
  16. TempusC

    Member TempusC GBAtemp Regular

    Joined:
    Nov 22, 2006
    Messages:
    229
    Country:
    Canada
    A note about filenames. Filenames do have to be put into the main.dol, and read from the fst.bin. However, these are subject to all the whims of programming. For real games, this means files are occasionally scripted using sprintf to determine file name, which means you can indeed add files to those games and they may in fact be useable with some tweaking. For homebrew, you can apply the same strategy and access files from the SD card, to make your own program extensible to users.
     
  17. Wiimm

    Member Wiimm Developer

    Joined:
    Aug 11, 2009
    Messages:
    2,051
    Location:
    Germany
    Country:
    Germany
     
  18. externalist
    OP

    Newcomer externalist Member

    Joined:
    Feb 16, 2010
    Messages:
    23
    Country:
    Korea, South
    Just tried it out... and it works! Pretty sweet. [​IMG] Thanks for the support! I may ask a few more questions regarding WIT in the future if you don't mind. [​IMG] Thanks again. [​IMG]
     
  19. externalist
    OP

    Newcomer externalist Member

    Joined:
    Feb 16, 2010
    Messages:
    23
    Country:
    Korea, South
    Just out of curiousity...
    I'm looking at Super Mario Galaxy wii disc right now, and I saw something that's quite confusing. I extracted the main.dol out of the disc and saw it was only 6MB. How can a game as big as super mario galaxy only fit inside 6MB? I can't imagine how it can fit in such a tiny file... I've heard that relocatable modules are also involved in the game execution, but I can't find any .rel files in the disc. Is 6MB for a game normal? Or am I missing something...

    Edit :
    Well, maybe I'm wrong. I looked at some other PC games I have and the executable file themselves didn't turn out to be that big. But the data files that come with it Are big. I guess main.dol being 6MB isn't really that strange? no?
     
  20. Wiimm

    Member Wiimm Developer

    Joined:
    Aug 11, 2009
    Messages:
    2,051
    Location:
    Germany
    Country:
    Germany
    Have you looked into the "DATA/files/" subdirectory? It contains the file system of the disc. And it will be used if composing a disc.

    btw: To check contents without extracting try "wit ilist image". To extract only some files you can set filter with "-F+.dol" (extract all *.dol files and nothing else). See docu for more details.
     

Share This Page