2013-10-01 23:13:08 +02:00
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, version 2.0.
|
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License 2.0 for more details.
|
|
|
|
|
2014-04-25 17:34:53 +02:00
|
|
|
// Copyright (C) 2010 Joseph Jordan <joe.ftpii@psychlaw.com.au>
|
|
|
|
// Copyright (C) 2012-2013 damysteryman
|
2015-07-12 15:01:24 +02:00
|
|
|
// Copyright (C) 2012-2015 Christopher Bratusek <nano@jpberlin.de>
|
2014-04-25 17:34:53 +02:00
|
|
|
// Copyright (C) 2013 DarkMatterCore
|
|
|
|
// Copyright (C) 2014 megazig
|
2015-07-12 15:01:24 +02:00
|
|
|
// Copyright (C) 2015 FIX94
|
2013-10-01 23:13:08 +02:00
|
|
|
|
2014-04-25 17:34:53 +02:00
|
|
|
#ifndef __RUNTIMEIOSPATCH_H__
|
|
|
|
#define __RUNTIMEIOSPATCH_H__
|
2013-10-01 23:13:08 +02:00
|
|
|
|
2014-04-25 17:34:53 +02:00
|
|
|
/**
|
|
|
|
* Version information for Libruntimeiospatch.
|
|
|
|
*/
|
2015-07-12 15:01:24 +02:00
|
|
|
#define LIB_RUNTIMEIOSPATCH_VERSION "1.5.2"
|
2013-10-01 23:13:08 +02:00
|
|
|
|
2014-04-25 17:34:53 +02:00
|
|
|
//==============================================================================
|
|
|
|
// HW_RVL header
|
|
|
|
//==============================================================================
|
|
|
|
#if defined(HW_RVL) /* defined(HW_RVL) */
|
2013-10-01 23:13:08 +02:00
|
|
|
|
2014-04-25 17:34:53 +02:00
|
|
|
/**
|
|
|
|
*Returns true when HW_AHBPROT access can be applied
|
|
|
|
*/
|
|
|
|
#define AHBPROT_DISABLED (*(vu32*)0xcd800064 == 0xFFFFFFFF)
|
2013-10-01 23:13:08 +02:00
|
|
|
|
2014-04-25 17:34:53 +02:00
|
|
|
//==============================================================================
|
|
|
|
// Error code definitions:
|
|
|
|
//==============================================================================
|
|
|
|
#define ERROR_AHBPROT -5
|
|
|
|
#define ERROR_PATCH -7
|
2013-10-01 23:13:08 +02:00
|
|
|
|
2014-04-25 17:34:53 +02:00
|
|
|
//==============================================================================
|
|
|
|
// C++ header
|
|
|
|
//==============================================================================
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
/* __cplusplus */
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
// Extra standard declarations
|
|
|
|
//==============================================================================
|
|
|
|
typedef signed int s32;
|
|
|
|
//==============================================================================
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
// Patchsets:
|
|
|
|
//==============================================================================
|
|
|
|
/*
|
|
|
|
Wii:
|
|
|
|
* DI Readlimit
|
|
|
|
* ISFS Permissions
|
|
|
|
* ES SetUID
|
|
|
|
* ES SetIdentify
|
|
|
|
* Hash Check (aka Trucha)
|
|
|
|
* New Hash Check (aka New Trucha)
|
2015-07-12 15:01:24 +02:00
|
|
|
* SSL patches
|
2014-04-25 17:34:53 +02:00
|
|
|
|
|
|
|
Sciifii:
|
|
|
|
* MEM2 Prot
|
|
|
|
* ES OpenTitleContent 1 & 2
|
|
|
|
* ES ReadContent Prot
|
|
|
|
* ES CloseContent
|
|
|
|
* ES TitleVersionCheck
|
|
|
|
* ES TitleDeleteCheck
|
|
|
|
|
|
|
|
vWii:
|
|
|
|
* Kill Anti-SystemTitle-Install 1, 2, 3, 4 & 5
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
// Functions:
|
|
|
|
//==============================================================================
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This function can be used to keep HW_AHBPROT access when going to reload IOS
|
|
|
|
* @param verbose Flag determing whether or not to print messages on-screen
|
|
|
|
* @example
|
|
|
|
* if(AHBPROT_DISABLED) {
|
|
|
|
* s32 ret;
|
|
|
|
* ret = IosPatch_AHBPROT(false);
|
|
|
|
* if (ret) {
|
|
|
|
* IOS_ReloadIOS(36);
|
|
|
|
* } else {
|
|
|
|
* printf("IosPatch_AHBPROT failed.");
|
|
|
|
* }
|
|
|
|
* }
|
|
|
|
* @return Signed 32bit integer representing code
|
|
|
|
* > 0 : Success - return equals to number of applied patches
|
|
|
|
* ERROR_AHBPROT : Error - No HW_AHBPROT access
|
|
|
|
*/
|
|
|
|
s32 IosPatch_AHBPROT(bool verbose);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This function applies patches on current IOS
|
|
|
|
* @see Patchsets
|
|
|
|
* @param wii Flag determing whether or not to apply Wii patches.
|
|
|
|
* @param sciifii Flag determing whether or not to apply extra Sciifii patches.
|
|
|
|
* @param vwii Flag determing whether or not to apply extra vWii patches.
|
|
|
|
* @param verbose Flag determing whether or not to print messages on-screen.
|
|
|
|
* @example if(AHBPROT_DISABLED) IosPatch_FULL(true, false, false, false);
|
|
|
|
* @return Signed 32bit integer representing code
|
|
|
|
* > 0 : Success - return equals to number of applied patches
|
|
|
|
* ERROR_AHBPROT : Error - No HW_AHBPROT access
|
|
|
|
* ERROR_PATCH : Error - Patching HW_AHBPROT access failed
|
|
|
|
*/
|
|
|
|
s32 IosPatch_RUNTIME(bool wii, bool sciifii, bool vwii, bool verbose);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This function combines IosPatch_AHBPROT + IOS_ReloadIOS + IosPatch_RUNTIME
|
|
|
|
* @see Patchsets
|
|
|
|
* @param wii Flag determing whether or not to apply Wii patches.
|
|
|
|
* @param sciifii Flag determing whether or not to apply extra Sciifii patches.
|
|
|
|
* @param vwii Flag determing whether or not to apply extra vWii patches.
|
|
|
|
* @param verbose Flag determing whether or not to print messages on-screen.
|
|
|
|
* @param IOS Which IOS to reload into.
|
|
|
|
* @example if(AHBPROT_DISABLED) IosPatch_FULL(true, false, false, false, 58);
|
|
|
|
* @return Signed 32bit integer representing code
|
|
|
|
* > 0 : Success - return equals to number of applied patches
|
|
|
|
* ERROR_AHBPROT : Error - No HW_AHBPROT access
|
|
|
|
* ERROR_PATCH : Error - Patching HW_AHBPROT access failed
|
|
|
|
*/
|
|
|
|
s32 IosPatch_FULL(bool wii, bool sciifii, bool vwii, bool verbose, int IOS);
|
|
|
|
|
2015-07-13 16:26:30 +02:00
|
|
|
/**
|
|
|
|
* This function patches only SSL certificate check
|
|
|
|
* @param verbose Flag determing whether or not to print messages on-screen.
|
|
|
|
* @example if(AHBPROT_DISABLED) IosPatch_SSL(true);
|
|
|
|
* @return Signed 32bit integer representing code
|
|
|
|
* > 0 : Success - return equals to number of applied patches
|
|
|
|
* ERROR_AHBPROT : Error - No HW_AHBPROT access
|
|
|
|
*/
|
|
|
|
s32 IosPatch_SSL(bool verbose);
|
|
|
|
|
2014-04-25 17:34:53 +02:00
|
|
|
//==============================================================================
|
|
|
|
// C++ footer
|
|
|
|
//==============================================================================
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif /* __cplusplus */
|
2013-10-01 23:13:08 +02:00
|
|
|
|
2014-04-25 17:34:53 +02:00
|
|
|
//==============================================================================
|
|
|
|
// HW_RVL footer
|
|
|
|
//==============================================================================
|
|
|
|
#endif /* defined(HW_RVL) */
|
2013-10-01 23:13:08 +02:00
|
|
|
|
|
|
|
#endif
|