diff --git a/src/main.cpp b/src/main.cpp index 72c7797..67875d0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -48,6 +48,7 @@ static bool is555(MCP_SystemVersion version) { INITIALIZE_PLUGIN() { WHBLogUdpInit(); + WHBLogCafeInit(); auto res = Mocha_InitLibrary(); @@ -86,6 +87,7 @@ DEINITIALIZE_PLUGIN() { ON_APPLICATION_START() { WHBLogUdpInit(); + WHBLogCafeInit(); RunPatcher(); } diff --git a/src/patcher/ingame.cpp b/src/patcher/ingame.cpp index e20de15..3394cad 100644 --- a/src/patcher/ingame.cpp +++ b/src/patcher/ingame.cpp @@ -19,7 +19,7 @@ #include #include "patches/youtube.h" -#include "patches/just_dance_2016.h" +#include "patches/just_dance.h" void RunPatcher() { auto orplinfo = TryGetRPLInfo(); @@ -54,5 +54,5 @@ void RunPatcher() { // "always" patches Patch_youtube(titleVer, titleId, rpls); - Patch_just_dance_2016(titleVer, titleId, rpls); + Patch_just_dance(titleVer, titleId, rpls); } diff --git a/src/patcher/patches/just_dance.cpp b/src/patcher/patches/just_dance.cpp new file mode 100644 index 0000000..59709c0 --- /dev/null +++ b/src/patcher/patches/just_dance.cpp @@ -0,0 +1,35 @@ +// +// Created by ash on 24/10/22. +// + +#include "just_dance.h" +#include "utils/logger.h" +#include "patcher/patcher.h" + +#include + +void Patch_just_dance(uint32_t titleVer, uint64_t titleId, const rplinfo& rpls) { + if (titleId == 0x00050000'101B9800 && titleVer == 32) { + auto rpx = FindRPL(rpls, "wiiu_ua_engine_f.rpx"); + if (!rpx) return; + + DEBUG_FUNCTION_LINE("Detected JD2016 EUR v%d - patching...", titleVer); + // OpenSSL ssl_verify_cert_chain + PatchInstruction((void*)(rpx->textAddr + 0x0200907c), 0x40820020, 0x60000000); + PatchInstruction((void*)(rpx->textAddr + 0x02009094), 0x38600000, 0x38600001); + // OpenSSL X509_verify_cert (just in case lol) + PatchInstruction((void*)(rpx->textAddr + 0x0203ebfc), 0x9421ffb8, 0x38600001); + PatchInstruction((void*)(rpx->textAddr + 0x0203ec00), 0xbe410010, 0x4e800020); + } else if (titleId == 0x00050000'101EAA00 && titleVer == 32) { + auto rpx = FindRPL(rpls, "wiiu_ua_engine_f.rpx"); + if (!rpx) return; + + DEBUG_FUNCTION_LINE("Detected JD2017 EUR v%d - patching...", titleVer); + // OpenSSL ssl_verify_cert_chain + PatchInstruction((void*)(rpx->textAddr + 0x025755d4), 0x40820024, 0x60000000); + PatchInstruction((void*)(rpx->textAddr + 0x025755f0), 0x38600000, 0x38600001); + // OpenSSL X509_verify_cert (just in case lol) + PatchInstruction((void*)(rpx->textAddr + 0x0253e1e4), 0x9421ffb8, 0x38600001); + PatchInstruction((void*)(rpx->textAddr + 0x0253e1e8), 0xbe21000c, 0x4e800020); + } +} diff --git a/src/patcher/patches/just_dance.h b/src/patcher/patches/just_dance.h new file mode 100644 index 0000000..72a29cb --- /dev/null +++ b/src/patcher/patches/just_dance.h @@ -0,0 +1,12 @@ +// +// Created by ash on 24/10/22. +// + +#ifndef INKAY_JUST_DANCE_H +#define INKAY_JUST_DANCE_H + +#include "patcher/rplinfo.h" + +void Patch_just_dance(uint32_t titleVer, uint64_t titleId, const rplinfo& rpls); + +#endif //INKAY_JUST_DANCE_H diff --git a/src/patcher/patches/just_dance_2016.cpp b/src/patcher/patches/just_dance_2016.cpp deleted file mode 100644 index 684b1f2..0000000 --- a/src/patcher/patches/just_dance_2016.cpp +++ /dev/null @@ -1,24 +0,0 @@ -// -// Created by ash on 24/10/22. -// - -#include "just_dance_2016.h" -#include "utils/logger.h" -#include "patcher/patcher.h" - -#include - -void Patch_just_dance_2016(uint32_t titleVer, uint64_t titleId, const rplinfo& rpls) { - if (titleId == 0x00050000101B9800 && titleVer == 32) { - auto rpx = FindRPL(rpls, "wiiu_ua_engine_f.rpx"); - if (!rpx) return; - - DEBUG_FUNCTION_LINE("Detected JD2016 EUR v%d - patching...", titleVer); - // OpenSSL ssl_verify_cert_chain - PatchInstruction((void*)(rpx->textAddr + 0x0200907c), 0x40820020, 0x60000000); - PatchInstruction((void*)(rpx->textAddr + 0x02009094), 0x38600000, 0x38600001); - // OpenSSL X509_verify_cert (just in case lol) - PatchInstruction((void*)(rpx->textAddr + 0x0203ebfc), 0x9421ffb8, 0x38600001); - PatchInstruction((void*)(rpx->textAddr + 0x0203ec00), 0xbe410010, 0x4e800020); - } -} diff --git a/src/patcher/patches/just_dance_2016.h b/src/patcher/patches/just_dance_2016.h deleted file mode 100644 index 73f44b0..0000000 --- a/src/patcher/patches/just_dance_2016.h +++ /dev/null @@ -1,12 +0,0 @@ -// -// Created by ash on 24/10/22. -// - -#ifndef INKAY_JUST_DANCE_2016_H -#define INKAY_JUST_DANCE_2016_H - -#include "patcher/rplinfo.h" - -void Patch_just_dance_2016(uint32_t titleVer, uint64_t titleId, const rplinfo& rpls); - -#endif //INKAY_JUST_DANCE_2016_H diff --git a/src/utils/logger.h b/src/utils/logger.h index 82d4613..0b6bc1b 100644 --- a/src/utils/logger.h +++ b/src/utils/logger.h @@ -7,6 +7,7 @@ extern "C" { #include #include #include +#include #define __FILENAME_X__ (strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__) #define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILENAME_X__)