[Wii] [vWii] libruntimeiospatch

Discussion in 'Wii U - Hacking & Backup Loaders' started by Excelsiior, Dec 22, 2012.

Dec 22, 2012
  1. Excelsiior
    OP

    Member Excelsiior GBAtemp Regular

    Joined:
    Sep 13, 2009
    Messages:
    258
    Country:
    Germany
    libruntimeiospatch (short: -lrip) is a library that provides all necessary functions for HW_AHBPROT (thanks to anyone involved in that). As of now all apps have their own code for that (IF they have), but I believe a library is better in this case, as on updates one does only need to update -lrip and re-link the Homebrews, rather than updating the code for every single Homebrew. (If you don't know what this is good for, you have no need for it)

    Developers take all other infos from supplied API file.

    It's part of the HomebrewFilter, so the source can be found in it's GIT repo (subfolder "libruntimeiospatch").

    Installation:
    runtimeiospatch.h => <DEVKITPPC>/libogc/include/
    libruntimeiospatch.a => <DEVKITPPC>/libogc/lib/wii/

    Download:
    Source: http://downloads.nanolx.org/libruntimeiospatch
    GIT: https://github.com/Nanolx/homebrewfilter

    Changes:
    1.5.3:
    * changed layout of debug text to ensure it's always visible
    * added colors to debug text
    - cyan: headings
    - green: patch succeeded
    - red: patch failed

    1.5.2:
    * added SSL module patches made by FIX94 to fix some certificate
    errors that occur when attempting to connect to a host using a
    secure connection (DarkMatterCore)

    1.5.1:
    * code clean-up (JoostinOnline)
    * add typedef for s32 (JoostinOnline)
    * misc minor changes (JoostinOnline)

    1.5:
    * add ISFS_SetAttr() patches. (megazig)
    Forces the ISFS_SetAttr() function to continue instead of
    returning -102 when you're trying to change the UID/GID of a file.
     
    Last edited by Excelsiior, Aug 17, 2016 - Reason: version 1.5.3


  2. Excelsiior
    OP

    Member Excelsiior GBAtemp Regular

    Joined:
    Sep 13, 2009
    Messages:
    258
    Country:
    Germany
    There's now v1.2 available (links in first post)

    Code:
    1.2:
    [NEW]    get_libruntimeiospatch_version()
    [MOD]    IosPatch_AHBPROT() - return code re-work
    [MOD]    IosPatch_RUNTIME() - return code re-work
    [MOD]    IosPatch_FULL() - retun code re-work
    [MOD]    API doc file updated
    [NEW]    CHANGES doc file
     
    1.1:
    [NEW]    IosPatch_FULL()
    [MOD]    IosPatch_AHBPROT() - proper return work
    [NEW]    API doc file
     
    1.0: initial release
    [NEW]    have_ahbprot()
    [NEW]    IosPatch_AHBPROT()
    [NEW]    IosPatch_RUNTIME()
     
  3. [Truth]

    Member [Truth] GBAtemp Advanced Fan

    Joined:
    Mar 21, 2006
    Messages:
    765
    Location:
    Mushroom Kingdom
    Country:
    Germany
    So with this added to xyzzy and FS Toolbox, we can dump the untouched NAND directly after game exploit?
     
  4. DarkMatterCore

    Member DarkMatterCore I like turtles.

    Joined:
    May 30, 2009
    Messages:
    886
    Location:
    Cabimas, Zulia, Venezuela.
    Country:
    Venezuela
    Not exactly. Xyzzy doesn't actually require these IOS patches to work, since we can just inherit full hardware access from the HBC and read the OTP and SEEPROM data (which is precisely what my unofficial version does). Quite easy.

    And, well, there is already a FSToolbox mod, which was done by Excelsiior, too. And yes, it uses these patches. ;)
     
    [Truth] likes this.
  5. Skeet1983

    Member Skeet1983 GBAtemp Addict

    Joined:
    Apr 22, 2012
    Messages:
    2,235
    Location:
    Somewhere, out there...
    Country:
    United States
    Does this do anything for Gecko OS? Was hoping for channel cheats in WiiWare/VC games...
     
  6. JoostinOnline

    Member JoostinOnline Certified Crash Test Dummy

    Joined:
    Apr 2, 2011
    Messages:
    10,834
    Location:
    The Twilight Zone
    Country:
    United States
    You should update this.
     
  7. Excelsiior
    OP

    Member Excelsiior GBAtemp Regular

    Joined:
    Sep 13, 2009
    Messages:
    258
    Country:
    Germany
    Oh, yeah forgot to update to 1.3 in first post... When I'm home later.
     
  8. officialjunk

    Newcomer officialjunk Advanced Member

    Joined:
    Oct 4, 2008
    Messages:
    72
    Country:
    United States
    Has anyone tested this on either wii or vwii?
     
  9. Cyan

    Global Moderator Cyan GBATemp's lurking knight

    Joined:
    Oct 27, 2002
    Messages:
    16,433
    Location:
    Engine room, learning
    Country:
    France
    yes, some homebrew are already using this library/souces v1.3, for example FSToolbox 0.4d, Settings Editor GUI 1.9.
    Maybe other homebrew too, I didn't check others.
     
  10. SifJar

    Member SifJar Not a pirate

    Joined:
    Apr 4, 2009
    Messages:
    6,022
    Country:
    United Kingdom
    Plus it is essentially the same code as has been in use in dozens of apps over the last year or two (since HW_AHBPROT support was added to HBC), pretty much all apps that previously relied on IOS patches but were updated to use HW_AHBPROT. This is just the same code externalized.
     
  11. Excelsiior
    OP

    Member Excelsiior GBAtemp Regular

    Joined:
    Sep 13, 2009
    Messages:
    258
    Country:
    Germany
    HomebrewFilter, SaveGame Manager GX (vWii build), YAWMM DE are also using libruntimeiospatch. Updated first post for v1.3

    As SifJar said it's nothing special at all, just library providing the functions, so that in case of an update only the library needs code changes rather than every single application. An app then just needs a rebuild (just as older apps need no more than a rebuild against new libogc for WM+ support).
     
  12. DarkMatterCore

    Member DarkMatterCore I like turtles.

    Joined:
    May 30, 2009
    Messages:
    886
    Location:
    Cabimas, Zulia, Venezuela.
    Country:
    Venezuela
    You should include this new patch (sorry, I still don't get used to SourceForge :P):

    Code:
    const u8 isfs_setattr_pt1_old[] = { 0x42, 0xAB, 0xD0, 0x02, 0x20, 0x66 };
    const u8 isfs_setattr_pt1_patch[] = { 0x42, 0xAB, 0xE0, 0x02, 0x20, 0x66 };
    const u8 isfs_setattr_pt2_old[] = { 0x2D, 0x00, 0xD0, 0x02, 0x20, 0x66 };
    const u8 isfs_setattr_pt2_patch[] = { 0x2D, 0x00, 0xE0, 0x02, 0x20, 0x66 };
     
    s32 IosPatch_RUNTIME(bool wii, bool sciifii, bool vwii, bool verbose) {
     
        ...
     
        count += apply_patch("isfs_setattr_pt1", isfs_setattr_pt1_old, sizeof(isfs_setattr_pt1_old), isfs_setattr_pt1_patch, sizeof(isfs_setattr_pt1_patch), 0, verbose);
        count += apply_patch("isfs_setattr_pt2", isfs_setattr_pt2_old, sizeof(isfs_setattr_pt2_old), isfs_setattr_pt2_patch, sizeof(isfs_setattr_pt2_patch), 0, verbose);
     
        ...
    }
    It forces the ISFS_SetAttr() function to continue instead of returning -102 when you're trying to change the UID/GID of a file. It was done by megazig.

    I have not checked vWii compatbility, though. Maybe someone else can do that for me?

    Sorry for the necrobump, btw.
     
    Cyan and JoostinOnline like this.
  13. Cyan

    Global Moderator Cyan GBATemp's lurking knight

    Joined:
    Oct 27, 2002
    Messages:
    16,433
    Location:
    Engine room, learning
    Country:
    France
    thanks.
    I guess it's now v1.5.0? (doesn't really matter, but just for consistencies between all projects)

    Code:
    1.5:
    * add ISFS_SetAttr() patches. (by megazig)
    	Forces the ISFS_SetAttr() function to continue instead of
    	returning -102 when you're trying to change the UID/GID of a file.
    
    1.4:
    * fix value for hash_old (spotted by DarkMatterCore)
    
    .h
    Code:
    // Copyright (C) 2010		Joseph Jordan <joe.ftpii@psychlaw.com.au>
    // Copyright (C) 2012-2013	damysteryman
    // Copyright (C) 2012-2013	Christopher Bratusek <nano@tuxfamily.org>
    // Copyright (C) 2013		DarkMatterCore
    // Copyright (C) 2014		megazig
    
    
    #ifndef _RUNTIMEIOSPATCH_H_
    	#define _RUNTIMEIOSPATCH_H_
    
    	#define LIB_RUNTIMEIOSPATCH_VERSION "1.5.0"
    
     
  14. DarkMatterCore

    Member DarkMatterCore I like turtles.

    Joined:
    May 30, 2009
    Messages:
    886
    Location:
    Cabimas, Zulia, Venezuela.
    Country:
    Venezuela
    Yeah, I think so. Right now I'm trying to find a way to correct the -115 (ENOTEMPTY) error that appears sometimes when calling ISFS_SetAttr() after applying this new patch. megazig doesn't have his IDBs anymore, though, and I don't have IDA Pro.
     
  15. JoostinOnline

    Member JoostinOnline Certified Crash Test Dummy

    Joined:
    Apr 2, 2011
    Messages:
    10,834
    Location:
    The Twilight Zone
    Country:
    United States
    The license should also be changed from GPL to MIT, and a typedef needs to be added for s32
    Code:
    /*------------------------------------------------------------------------------
     
    Copyright (C) 2010 Joseph Jordan <joe.ftpii@psychlaw.com.au>
    Copyright (C) 2012-2013 damysteryman
    Copyright (C) 2012-2013 Christopher Bratusek <nano@tuxfamily.org>
    Copyright (C) 2013 DarkMatterCore
    Copyright (C) 2014 megazig
     
    Permission is hereby granted, free of charge, to any person obtaining
    a copy of this software and associated documentation files (the "Software"),
    to deal in the Software without restriction, including without limitation
    the rights to use, copy, modify, merge, publish, distribute, sublicense,
    and/or sell copies of the Software, and to permit persons to whom the
    Software is furnished to do so, subject to the following conditions:
     
    The above copyright notice and this permission notice shall be included
    in all copies or substantial portions of the Software.
     
    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
    OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
    IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
    DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
    OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
     
    ------------------------------------------------------------------------------*/
    
    Here is a zip file of an updated version of libruntimeiospatch. It's DarkMatterCore's changes and a few of my own that I've made over the past months (nothing special). The only thing that needs to be changed is the license, but I can't legally change that so I'll leave it to Excelsiior.
    http://filebin.ca/18TZ1C4BjAvm/libruntimeiospatch_v1.5.2.zip
     
    DarkMatterCore likes this.
  16. Excelsiior
    OP

    Member Excelsiior GBAtemp Regular

    Joined:
    Sep 13, 2009
    Messages:
    258
    Country:
    Germany
    Officially released v1.5.1 now, updated first post. Thanks to megazig, DarkMatterCore and JoostinOnline.

    About the License: GPL is correct, as the original code was bundled with FTPii, which is gpl'ed.
     
  17. JoostinOnline

    Member JoostinOnline Certified Crash Test Dummy

    Joined:
    Apr 2, 2011
    Messages:
    10,834
    Location:
    The Twilight Zone
    Country:
    United States
    New BSD according to Wiibrew
    http://wiibrew.org/wiki/Ftpii
     
  18. Excelsiior
    OP

    Member Excelsiior GBAtemp Regular

    Joined:
    Sep 13, 2009
    Messages:
    258
    Country:
    Germany
    JoostinOnline likes this.
  19. Excelsiior
    OP

    Member Excelsiior GBAtemp Regular

    Joined:
    Sep 13, 2009
    Messages:
    258
    Country:
    Germany
    Thanks to @DarkMatterCore there's now version 1.5.2 available.

    Code:
    1.5.2:
    * added SSL module patches made by FIX94 to fix some certificate
      errors that occur when attempting to connect to a host using a
      secure connection (DarkMatterCore)
    /on a side note: there's something wrong with the vWii-builds of the HomebrewFilter. So expect a minor update of it "soon".
     
    DarkMatterCore likes this.
  20. Cyan

    Global Moderator Cyan GBATemp's lurking knight

    Joined:
    Oct 27, 2002
    Messages:
    16,433
    Location:
    Engine room, learning
    Country:
    France
    hooo, I planed to do it but you beat me :P
    do you know if it works only with IOS58 or with cIOS too?
    I'll try.

    Thanks.
     

Share This Page