just_dance: Add JD2017

This commit is contained in:
Ash Logan 2023-03-21 23:13:04 +11:00
commit 2d0f7a1f58
7 changed files with 52 additions and 38 deletions

View file

@ -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();
}

View file

@ -19,7 +19,7 @@
#include <coreinit/title.h>
#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);
}

View file

@ -0,0 +1,35 @@
//
// Created by ash on 24/10/22.
//
#include "just_dance.h"
#include "utils/logger.h"
#include "patcher/patcher.h"
#include <cstdint>
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);
}
}

View file

@ -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

View file

@ -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 <cstdint>
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);
}
}

View file

@ -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

View file

@ -7,6 +7,7 @@ extern "C" {
#include <string.h>
#include <whb/log.h>
#include <whb/log_udp.h>
#include <whb/log_cafe.h>
#define __FILENAME_X__ (strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__)
#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILENAME_X__)