Compiling CustomizeMii's "Installer" DOL

Discussion in 'Wii - Hacking' started by techboy, Mar 1, 2010.

Mar 1, 2010
  1. techboy
    OP

    Member techboy GBAtemp Advanced Maniac

    Joined:
    Mar 15, 2009
    Messages:
    1,720
    Location:
    Pennsylvania
    Country:
    United States
    First off, let me say I'm almost clueless when it comes to C.

    I'm having trouble getting the CustomizeMii "wad installer" to compile. Most apps I've compiled (a few simple things, like RunOpera) haven't given me issues, but this one is confusing me. I'm hoping to modify a few things and reuse it (and maybe learn something), but I can't even get unaltered code from the SVN to compile.

    It seems to start compiling normally, then fails during linking. The errors are all "undefined reference to 'install' ". The only place I see anything named 'install' get defined is in install.h.

    It's this code: http://code.google.com/p/customizemii/sour...nstaller_Source

    I had to create the install.c as explained in the README. He said to fill with exactly 4MB of zeros. Does he mean an ASCII zero or 0x00 (nulls, which is what I used).

    I hope someone who's a developer can help. Thanks in advance!
     


  2. WiiCrazy

    Member WiiCrazy Be water my friend!

    Joined:
    May 8, 2008
    Messages:
    2,391
    Location:
    Istanbul
    Country:
    Turkey
    As readme says, create a stub wad file and put it in source folder...

    create exactly 4mb file with all zeroes, call it install.bin
    then using "raw2c install.bin " get install.c and copy it over to source folder... then it will compile...
     
  3. techboy
    OP

    Member techboy GBAtemp Advanced Maniac

    Joined:
    Mar 15, 2009
    Messages:
    1,720
    Location:
    Pennsylvania
    Country:
    United States
    Thanks. I wasn't aware I needed to use raw2c. It compiles fine now. Previously, I was making files called install.c full of 4MB worth of 0x00...
     
  4. tueidj

    Member tueidj I R Expert

    Joined:
    Jan 8, 2009
    Messages:
    2,569
    Country:
    That's a rather crazy way of doing it. Is there something wrong with declaring a fixed size static array?
     
  5. techboy
    OP

    Member techboy GBAtemp Advanced Maniac

    Joined:
    Mar 15, 2009
    Messages:
    1,720
    Location:
    Pennsylvania
    Country:
    United States
    That's the method the readme for the code wants. I'm doing this as a learning experience...this is only my second time working with C (first was a couple of forwarder DOLs which worked fine).

    A WAD and SHA1 are eventually injected into the DOL by CustomizeMii when used. The nulls appear to be just to leave space at the end of the DOL for the data.

    I'm still working it out how to properly inject a WAD manually. I can get a wad to install, but I had to comment out the SHA checks...it appears to be something to do with the file size. It's computing the SHA1 of the wad incorrectly (returns a value that is not even the right length to be an SHA hash).
     
  6. Leathl

    Member Leathl GBAtemp Regular

    Joined:
    Aug 15, 2009
    Messages:
    239
    Location:
    Berlin
    Country:
    Germany
  7. tueidj

    Member tueidj I R Expert

    Joined:
    Jan 8, 2009
    Messages:
    2,569
    Country:
    Leathl, what's wrong with using this:
    CODEunsigned char install[4
     
  8. techboy
    OP

    Member techboy GBAtemp Advanced Maniac

    Joined:
    Mar 15, 2009
    Messages:
    1,720
    Location:
    Pennsylvania
    Country:
    United States
    @Leathl: Thanks for that. It certainly helps explain what the format is...I'm a bit confused about the length logic though. C (and it's variants like C# and C++) are still quite new to me:
    Code:
     uncompressedStubInstallerStream.WriteByte((byte)((wadLength >> 24) & 0xff));
    uncompressedStubInstallerStream.WriteByte((byte)((wadLength >> 16) & 0xff));
    uncompressedStubInstallerStream.WriteByte((byte)((wadLength >> 8) & 0xff));
    uncompressedStubInstallerStream.WriteByte((byte)(wadLengthÂÂ& 0xff));
    Exactly what values do I need to put there for the length?

    Other then that, I think I've got it. After the length, it seems to be an SHA1 of the wad, followed by the IOS to use for installation, 3 bytes padding, then a WAD.
     
  9. Leathl

    Member Leathl GBAtemp Regular

    Joined:
    Aug 15, 2009
    Messages:
    239
    Location:
    Berlin
    Country:
    Germany
     
  10. WiiCrazy

    Member WiiCrazy Be water my friend!

    Joined:
    May 8, 2008
    Messages:
    2,391
    Location:
    Istanbul
    Country:
    Turkey
     
  11. giantpune

    Member giantpune GBAtemp Addict

    Joined:
    Apr 10, 2009
    Messages:
    2,860
    Country:
    United States
    why not just have it go like this...

    create a wad
    when you press "install" it creates a wad.bin and puts it with the source code to make the dol
    then it compiles the dol and sends it to the wii

    it will use wad_bin and wad_bin_size so it will allow you to send wads over the 4mb or whatever filesize. and if the wad is only 2 MB it will not have to send 2MB of 0s to the wii for no reason. also, if it doesnt do a clean/make it shouldnt add more than like 3 seconds to the time it takes for the whole process.
     
  12. WiiCrazy

    Member WiiCrazy Be water my friend!

    Joined:
    May 8, 2008
    Messages:
    2,391
    Location:
    Istanbul
    Country:
    Turkey
    Then you need devkitpro on the user's machine, not so feasible. Though compression could be added to save time while sending the installer dol to HBC.
     
  13. Leathl

    Member Leathl GBAtemp Regular

    Joined:
    Aug 15, 2009
    Messages:
    239
    Location:
    Berlin
    Country:
    Germany
    CustomizeMii does compress the dol! [​IMG]
     
  14. WiiCrazy

    Member WiiCrazy Be water my friend!

    Joined:
    May 8, 2008
    Messages:
    2,391
    Location:
    Istanbul
    Country:
    Turkey
    Hmm, Crap doesn't do that... I should possibly grab the support from customizemii for that [​IMG]
     
  15. Leathl

    Member Leathl GBAtemp Regular

    Joined:
    Aug 15, 2009
    Messages:
    239
    Location:
    Berlin
    Country:
    Germany
    Do it [​IMG]

    Btw, any attemps to update the installer for rev18 support (like Wad Manager 1.6)?
     
  16. techboy
    OP

    Member techboy GBAtemp Advanced Maniac

    Joined:
    Mar 15, 2009
    Messages:
    1,720
    Location:
    Pennsylvania
    Country:
    United States
    Thanks for clarifying. I was writing it like 12 AD 40 00...when I get home later I'll go ahead and try it again.
     
  17. WiiCrazy

    Member WiiCrazy Be water my friend!

    Joined:
    May 8, 2008
    Messages:
    2,391
    Location:
    Istanbul
    Country:
    Turkey
    Oh, I wasn't aware that it was broken with rev18... Of course I can add support for that... Hopefully I'll have some time during the weekend.
     
  18. diddy81

    Member diddy81 Wii Theme Team

    Joined:
    Mar 14, 2009
    Messages:
    711
    Country:
    United Kingdom
    any chance of having the wad installer to restart the wii after a install instead of going back to HBC??
     
  19. WiiCrazy

    Member WiiCrazy Be water my friend!

    Joined:
    May 8, 2008
    Messages:
    2,391
    Location:
    Istanbul
    Country:
    Turkey
    Noted
     
  20. Leathl

    Member Leathl GBAtemp Regular

    Joined:
    Aug 15, 2009
    Messages:
    239
    Location:
    Berlin
    Country:
    Germany
    I don't really know what's the thing about rev18, I'm still on rev17 and it's working fine. I just read about WAD Managers not working with rev18 and saw WAD Manager 1.6 which said something about a fix for rev18.

    Anyways, if you ever find some time, I'm still waiting for the possibility to save the wad to (SD/USB):/wad/***.wad after installing [​IMG]
    Would of course require the name of the wad to be saved in the dol and a simple choosing if SD or USB (maybe via 1/2 or Left/Right).
    And probably a check if the file already exists [​IMG]
     

Share This Page