Dol ios patching

Discussion in 'Wii - Hacking' started by batwings21, Jul 25, 2009.

  1. batwings21
    OP

    batwings21 Member

    Newcomer
    40
    0
    Dec 2, 2006
    United States
    USA
    Is there a way to load a homebrew .dol file using an ios other than what it was written for. Either a loader that forces the dol to run on a selected ios or a way to hex edit the dol to change the ios it loads from?
     
  2. WiiCrazy

    WiiCrazy Be water my friend!

    Member
    2,391
    1
    May 8, 2008
    Istanbul
    You can do that only on select homebrew that explicitly reloads ios... of course you should know where to patch, to know that you should disassemble the program and find where it reloads the ios and accordingly...
     
  3. ether2802

    ether2802 we have the techno...!!

    Former Staff
    4,350
    5
    Oct 14, 2007
    Mexico
    Pto. Vallarta
    Unfortunately, the OP doesn't seems to know about sources and compilling Mr. WiiCrazy, so is there another way..?? [​IMG]
     
  4. WiiCrazy

    WiiCrazy Be water my friend!

    Member
    2,391
    1
    May 8, 2008
    Istanbul
    Well then he should interpret my response as plain 'no' [​IMG]

    If there is a specific binary that reloads ios, then I can help though making it reload another...
     
  5. WiiPower

    WiiPower GBAtemp Guru

    Member
    8,165
    72
    Oct 17, 2008
    Gambia, The
    If the app does not do an IOS reload, you could try to find the code where libogc loads IOS36 for most homebrew. You could patch this to use another IOS. But seriously, the easiest method is to change the source.
     
  6. WiiCrazy

    WiiCrazy Be water my friend!

    Member
    2,391
    1
    May 8, 2008
    Istanbul
    Just searched through libogc sources and indeed there is a place to patch...

    SYS_Init -> __IOS_LoadStartupIOS -> IOS_GetPreferredVersion -> __IOS_LaunchNewIOS
     
  7. batwings21
    OP

    batwings21 Member

    Newcomer
    40
    0
    Dec 2, 2006
    United States
    USA
    Ether you are correct, I am no coder. I was not sure if there was a specific offest in the dol where it specified the ios it used, or if it was like you have explained and it can reload its ios at any point it chooses.

    Here's what I was after. RawkSD's files do not work with rockband 2 played from usb loader. Some other finds recently lead me to believe if the rawksd app you run on the wii were patched to use cios223 or cios248 (these are where my ios37 cios's are) that the resulting files may work. So I was hoping I could just patch the app. But it seems it's not that easy.

    WiiCrazy, WiiPower - Thanks for replying
     
  8. ether2802

    ether2802 we have the techno...!!

    Former Staff
    4,350
    5
    Oct 14, 2007
    Mexico
    Pto. Vallarta
    Mmmmm.... you could ask to the creators to change the IOS, or get the source of the project and try to change it yourself it is not hard to install DevKitPro and mess around with sources, even I've been checking out a few ones (
     
  9. WiiCrazy

    WiiCrazy Be water my friend!

    Member
    2,391
    1
    May 8, 2008
    Istanbul
    Ok, if it doesn't do any ios reloads then search for the hex string "7F E3 FB 78 83 A1 00 1C 83 C1 00 20 7C 08 03 A6 83 E1 00 24" in the dol... this is the relevant part in IOS_GetPreferredVersion... the last byte in the search string 24 is the max number of ios that is preferred by libogc... change it to what you want... 24 in hex = 36 in decimal... that is for latest libogc

    Notify me if it works...

    And of course asking the author of the apps will be more clear and easier... maybe you are after something irrelevant...

    ps: hang on, finding a generic patch for all reloads, I need to convert last opcode to immediate... back to ppc basics...
    Code:
    .text1:80039E8C loc_80039E8C:ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ # CODE XREF: sub_80039E38+2Cj
    .text1:80039E8CÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ srawiÂÂ %r9, %r3, 0x1F
    .text1:80039E90ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ oriÂÂÂÂ %r31, %r3, -0x522
    .text1:80039E94ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ oriÂÂÂÂ %r30, %r9, 1
    .text1:80039E98ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ mrÂÂÂÂÂÂ%r4, %r31
    .text1:80039E9CÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ mrÂÂÂÂÂÂ%r3, %r30
    .text1:80039EA0ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ addiÂÂÂÂ%r5, %sp, 0x3A8+var_3A0
    .text1:80039EA4ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ blÂÂÂÂÂÂsub_8003A6B4
    .text1:80039EA8ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ mr.ÂÂÂÂ %r0, %r3
    .text1:80039EACÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ bcÂÂÂÂÂÂ13, lt, loc_80039E68
    .text1:80039EB0ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ lwzÂÂÂÂ %r4, 0x3A8+var_3A0(%sp)
     
  10. WiiCrazy

    WiiCrazy Be water my friend!

    Member
    2,391
    1
    May 8, 2008
    Istanbul
    Ok I think I got it,

    For any homebrew app that's linked to latest libogc, here is the reload patch...
    Find hex string "7C 60 1B 79 41 A0 FF C0 80 81 00 08" in the dol... change the last four bytes as "38 80 00 XX" where XX is the IOS you want to use...

    Anyone willing to test?
     
  11. batwings21
    OP

    batwings21 Member

    Newcomer
    40
    0
    Dec 2, 2006
    United States
    USA
    Both of those strings are present in the dol. Would I patch both of them, or just one. I'm at work now but I appreciate the help and will test tonight.
     
  12. WiiCrazy

    WiiCrazy Be water my friend!

    Member
    2,391
    1
    May 8, 2008
    Istanbul
    I tested second on wad manager, it didn't work... try first if it uses IOS 36... for the second I'll correct it if I find time...
     
  13. Alexrose

    Alexrose Untitled

    Member
    783
    149
    Jan 20, 2009
    England
    You know you can just burn it to a disc and install ios37bugfix.wad then boot it through softchip using IOS37 and it'll work with RawkSD, right?
     
  14. batwings21
    OP

    batwings21 Member

    Newcomer
    40
    0
    Dec 2, 2006
    United States
    USA
    So is ios37bugfix.wad cioscorps ios 37? Plus i'm lazy and don't like getting up to change discs.