Hacking Compiling CustomizeMii's "Installer" DOL

techboy

Well-Known Member
OP
Member
Joined
Mar 15, 2009
Messages
1,720
Trophies
0
Age
32
Location
Pennsylvania
Website
Visit site
XP
316
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!
 

WiiCrazy

Be water my friend!
Member
Joined
May 8, 2008
Messages
2,395
Trophies
0
Location
Istanbul
Website
www.tepetaklak.com
XP
387
Country
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...
 

techboy

Well-Known Member
OP
Member
Joined
Mar 15, 2009
Messages
1,720
Trophies
0
Age
32
Location
Pennsylvania
Website
Visit site
XP
316
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).
 

techboy

Well-Known Member
OP
Member
Joined
Mar 15, 2009
Messages
1,720
Trophies
0
Age
32
Location
Pennsylvania
Website
Visit site
XP
316
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.
 

giantpune

Well-Known Member
Member
Joined
Apr 10, 2009
Messages
2,860
Trophies
0
XP
213
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.
 

WiiCrazy

Be water my friend!
Member
Joined
May 8, 2008
Messages
2,395
Trophies
0
Location
Istanbul
Website
www.tepetaklak.com
XP
387
Country
giantpune said:
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.

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.
 

Leathl

Well-Known Member
Member
Joined
Aug 15, 2009
Messages
239
Trophies
0
Location
Berlin
Website
Visit site
XP
90
Country
Gambia, The
CustomizeMii does compress the dol!
smile.gif
 

techboy

Well-Known Member
OP
Member
Joined
Mar 15, 2009
Messages
1,720
Trophies
0
Age
32
Location
Pennsylvania
Website
Visit site
XP
316
Country
United States
giantpune said:
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.
This is sort of what I was looking for. Maybe the next customizemii should just add an option to save the DOL instead of sending to the wii? It'd make it easier then having to make an install.bin of the size/SHA/wad manually and compiling.

WiiCrazy4 bytes - wad file length (big endian) - above code you referred... say if it's 1,224,000 bytes (12AD40 in hex) then these bytes should be 00 12 AD 40
20 bytes - SHA1 hash of complete wad contents
1 byte - IOS number to be used for the installation process
3 byte - unused, should be zeroes
The rest should be actual wad file contents
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.
 

WiiCrazy

Be water my friend!
Member
Joined
May 8, 2008
Messages
2,395
Trophies
0
Location
Istanbul
Website
www.tepetaklak.com
XP
387
Country
techboy said:
This is sort of what I was looking for. Maybe the next customizemii should just add an option to save the DOL instead of sending to the wii? It'd make it easier then having to make an install.bin of the size/SHA/wad manually and compiling.

For the end user it doesn't matter much actually it's much more of a burden to install devkitpro and keep it compatible with the wii sources.. You know devkitpro doesn't stay where it is. For the developer of course an automated build mechanism would be better and it's not impossible

techboy said:
WiiCrazy said:
4 bytes - wad file length (big endian) - above code you referred... say if it's 1,224,000 bytes (12AD40 in hex) then these bytes should be 00 12 AD 40
20 bytes - SHA1 hash of complete wad contents
1 byte - IOS number to be used for the installation process
3 byte - unused, should be zeroes
The rest should be actual wad file contents
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.

Well yep, size is stored on 4 bytes... first byte will always be zero for max 4mb size maybe this confused you.

QUOTE(Leathl @ Mar 4 2010, 06:37 PM)
Do it
smile.gif


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

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.
 

Leathl

Well-Known Member
Member
Joined
Aug 15, 2009
Messages
239
Trophies
0
Location
Berlin
Website
Visit site
XP
90
Country
Gambia, The
WiiCrazy said:
Leathl said:
Do it
smile.gif


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

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.

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
smile.gif

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
biggrin.gif
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • The Real Jdbye @ The Real Jdbye:
    LTT also did it
  • realtimesave @ realtimesave:
    jdhello
  • realtimesave @ realtimesave:
    @SylverReZ that guy seriously spent over 2 grand on that hot wheels pc?
    +1
  • RedColoredStars @ RedColoredStars:
    LTT is a noob
  • RedColoredStars @ RedColoredStars:
    Guy doesnt know wtf hes talking about half the time
  • realtimesave @ realtimesave:
    @SylverReZ that reminds me that my friend sells CRTs he gets cheap or free for hundreds of dollars. people are dumb
    +1
  • RedColoredStars @ RedColoredStars:
    And is incredibly annoying.
  • realtimesave @ realtimesave:
    man I just washed my shoes and they look exactly the same as before I washed them :|
  • realtimesave @ realtimesave:
    luckily they didn't fall apart
  • RedColoredStars @ RedColoredStars:
    Some CRTs are very much worth the price
  • RedColoredStars @ RedColoredStars:
    i used to go out to the recycling center every couple weeks and look at the crts and other electronics people would drop off. Usually screens were broken or severely scratched from being tossed around. Did find a good one here and there, but never anything like a 1080i widescreen crt.
  • RedColoredStars @ RedColoredStars:
    Or a good contition 40" Sony Trini that weighs 300 lbs. lol
  • RedColoredStars @ RedColoredStars:
    Literally 300 lbs. lolol
  • BigOnYa @ BigOnYa:
    I have a few of those boat anchors in my basement I tried giving away but no one wanted them, So anyone close to Columbus, Ohio area that wants them, (26", 2x 19") please come get, for free.
  • RedColoredStars @ RedColoredStars:
    Dont know anyone wants those smaller ones. Most are after larger sizes and the kinda top of the line models
  • RedColoredStars @ RedColoredStars:
    Motion handling and input lag on those things destroy plasmas, led, oled
  • realtimesave @ realtimesave:
    I had some really nice CRTs I should've kept
  • realtimesave @ realtimesave:
    now I have all lcd
  • realtimesave @ realtimesave:
    one in particular I regret getting rid of oh well :|
  • realtimesave @ realtimesave:
    the Sonys and stuff I don't care about
  • realtimesave @ realtimesave:
    and used LCD are hard to sell I can imagine.. not worth much
  • realtimesave @ realtimesave:
    @SylverReZ where do u lurk
  • a_username_that_isnt_cool @ a_username_that_isnt_cool:
    Is it piracy if it was released for free? Not in my opinion, but I also think it's not piracy if buying it isn't owning it, and it's not piracy if you can't buy it from the original creators anymore.
    a_username_that_isnt_cool @ a_username_that_isnt_cool: Is it piracy if it was released for free? Not in my opinion, but I also think it's not piracy if...