mirror of
https://github.com/PretendoNetwork/Inkay.git
synced 2025-04-02 11:02:05 -04:00
Compare commits
5 commits
2516e4b08f
...
d835146081
Author | SHA1 | Date | |
---|---|---|---|
|
d835146081 | ||
|
349b1f38aa | ||
|
9a9bf0949d | ||
|
695a077ebd | ||
|
f5e94b985b |
9 changed files with 166 additions and 141 deletions
|
@ -100,6 +100,28 @@ constexpr config_strings get_config_strings(nn::swkbd::LanguageType language) {
|
||||||
.restart_to_apply_action = "Neustarten zum Anwenden",
|
.restart_to_apply_action = "Neustarten zum Anwenden",
|
||||||
.need_menu_action = "Nur vom Wii U-Menü aus",
|
.need_menu_action = "Nur vom Wii U-Menü aus",
|
||||||
};
|
};
|
||||||
|
case nn::swkbd::LanguageType::Simplified_Chinese:
|
||||||
|
return {
|
||||||
|
.plugin_name = "Inkay",
|
||||||
|
.network_category = "选择网络",
|
||||||
|
.connect_to_network_setting = "连接到Pretendo network",
|
||||||
|
.other_category = "其他设置",
|
||||||
|
.reset_wwp_setting = "重置Wara Wara Plaza",
|
||||||
|
.press_a_action = "请按 A",
|
||||||
|
.restart_to_apply_action = "重启以应用设置",
|
||||||
|
.need_menu_action = "仅来自WiiU Menu"
|
||||||
|
};
|
||||||
|
case nn::swkbd::LanguageType::traditional_Chinese:
|
||||||
|
return {
|
||||||
|
.plugin_name = "Inkay",
|
||||||
|
.network_category = "選擇網路",
|
||||||
|
.connect_to_network_setting = "連接到Pretendo network",
|
||||||
|
.other_category = "其他設定",
|
||||||
|
.reset_wwp_setting = "重置Wara Wara Plaza",
|
||||||
|
.press_a_action = "請按 A",
|
||||||
|
.restart_to_apply_action = "重啓以套用設定",
|
||||||
|
.need_menu_action = "僅來自WiiU Menu"
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,7 +190,6 @@ static WUPSConfigAPICallbackStatus ConfigMenuOpenedCallback(WUPSConfigCategoryHa
|
||||||
// create root config category
|
// create root config category
|
||||||
WUPSConfigCategory root = WUPSConfigCategory(rootHandle);
|
WUPSConfigCategory root = WUPSConfigCategory(rootHandle);
|
||||||
|
|
||||||
try {
|
|
||||||
auto patching_cat = WUPSConfigCategory::Create(strings.network_category);
|
auto patching_cat = WUPSConfigCategory::Create(strings.network_category);
|
||||||
|
|
||||||
// config id display name default current value changed callback
|
// config id display name default current value changed callback
|
||||||
|
@ -198,18 +219,15 @@ static WUPSConfigAPICallbackStatus ConfigMenuOpenedCallback(WUPSConfigCategoryHa
|
||||||
WUPSConfigItemHandle unregisterTasksItem;
|
WUPSConfigItemHandle unregisterTasksItem;
|
||||||
WUPSConfigAPIStatus err;
|
WUPSConfigAPIStatus err;
|
||||||
if ((err = WUPSConfigAPI_Item_Create(unregisterTasksItemOptions, &unregisterTasksItem)) != WUPSCONFIG_API_RESULT_SUCCESS) {
|
if ((err = WUPSConfigAPI_Item_Create(unregisterTasksItemOptions, &unregisterTasksItem)) != WUPSCONFIG_API_RESULT_SUCCESS) {
|
||||||
throw std::runtime_error(std::string("Failed to create config item: ").append(WUPSConfigAPI_GetStatusStr(err)));
|
DEBUG_FUNCTION_LINE("Creating config menu failed: %s", WUPSConfigAPI_GetStatusStr(err));
|
||||||
|
return WUPSCONFIG_API_CALLBACK_RESULT_ERROR;
|
||||||
}
|
}
|
||||||
if ((err = WUPSConfigAPI_Category_AddItem(other_cat.getHandle(), unregisterTasksItem)) != WUPSCONFIG_API_RESULT_SUCCESS) {
|
if ((err = WUPSConfigAPI_Category_AddItem(other_cat.getHandle(), unregisterTasksItem)) != WUPSCONFIG_API_RESULT_SUCCESS) {
|
||||||
throw std::runtime_error(std::string("Failed to add config item: ").append(WUPSConfigAPI_GetStatusStr(err)));
|
DEBUG_FUNCTION_LINE("Creating config menu failed: %s", WUPSConfigAPI_GetStatusStr(err));
|
||||||
|
return WUPSCONFIG_API_CALLBACK_RESULT_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
root.add(std::move(other_cat));
|
root.add(std::move(other_cat));
|
||||||
}
|
|
||||||
catch (std::exception &e) {
|
|
||||||
DEBUG_FUNCTION_LINE("Creating config menu failed: %s", e.what());
|
|
||||||
return WUPSCONFIG_API_CALLBACK_RESULT_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
return WUPSCONFIG_API_CALLBACK_RESULT_SUCCESS;
|
return WUPSCONFIG_API_CALLBACK_RESULT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
#ifndef _PATCHER_H
|
#ifndef _PATCHER_H
|
||||||
#define _PATCHER_H
|
#define _PATCHER_H
|
||||||
|
|
||||||
typedef struct URL_Patch
|
typedef struct URL_Patch {
|
||||||
{
|
|
||||||
unsigned int address;
|
unsigned int address;
|
||||||
char url[80];
|
char url[80];
|
||||||
} URL_Patch;
|
} URL_Patch;
|
||||||
|
|
24
src/main.cpp
24
src/main.cpp
|
@ -49,7 +49,7 @@
|
||||||
|
|
||||||
#include <gx2/surface.h>
|
#include <gx2/surface.h>
|
||||||
|
|
||||||
#define INKAY_VERSION "v3.0"
|
#define INKAY_VERSION "v2.5.0"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Mandatory plugin information.
|
Mandatory plugin information.
|
||||||
|
@ -62,6 +62,7 @@ WUPS_PLUGIN_AUTHOR("Pretendo contributors");
|
||||||
WUPS_PLUGIN_LICENSE("ISC");
|
WUPS_PLUGIN_LICENSE("ISC");
|
||||||
|
|
||||||
WUPS_USE_STORAGE("inkay");
|
WUPS_USE_STORAGE("inkay");
|
||||||
|
|
||||||
WUPS_USE_WUT_DEVOPTAB();
|
WUPS_USE_WUT_DEVOPTAB();
|
||||||
|
|
||||||
#include <kernel/kernel.h>
|
#include <kernel/kernel.h>
|
||||||
|
@ -71,8 +72,7 @@ WUPS_USE_WUT_DEVOPTAB();
|
||||||
#include "utils/sysconfig.h"
|
#include "utils/sysconfig.h"
|
||||||
|
|
||||||
//thanks @Gary#4139 :p
|
//thanks @Gary#4139 :p
|
||||||
static void write_string(uint32_t addr, const char* str)
|
static void write_string(uint32_t addr, const char *str) {
|
||||||
{
|
|
||||||
int len = strlen(str) + 1;
|
int len = strlen(str) + 1;
|
||||||
int remaining = len % 4;
|
int remaining = len % 4;
|
||||||
int num = len - remaining;
|
int num = len - remaining;
|
||||||
|
@ -113,8 +113,13 @@ static const char * get_nintendo_network_message() {
|
||||||
return "Usando Nintendo Network";
|
return "Usando Nintendo Network";
|
||||||
case nn::swkbd::LanguageType::German:
|
case nn::swkbd::LanguageType::German:
|
||||||
return "Nutze Nintendo Network";
|
return "Nutze Nintendo Network";
|
||||||
|
case nn::swkbd::LanguageType::Simplified_Chinese:
|
||||||
|
return "使用 Nintendo Network";
|
||||||
|
case nn::swkbd::LanguageType::traditional_Chinese:
|
||||||
|
return "使用 Nintendo Network";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *get_pretendo_message() {
|
static const char *get_pretendo_message() {
|
||||||
// TL note: "Pretendo Network" is also a proper noun - though "Pretendo" alone can refer to us as a project
|
// TL note: "Pretendo Network" is also a proper noun - though "Pretendo" alone can refer to us as a project
|
||||||
// TL note: "Using" instead of "Connected" is deliberate - we don't know if a successful connection exists, we are
|
// TL note: "Using" instead of "Connected" is deliberate - we don't know if a successful connection exists, we are
|
||||||
|
@ -131,6 +136,10 @@ static const char * get_pretendo_message() {
|
||||||
return "Usando Pretendo Network";
|
return "Usando Pretendo Network";
|
||||||
case nn::swkbd::LanguageType::German:
|
case nn::swkbd::LanguageType::German:
|
||||||
return "Nutze Pretendo Network";
|
return "Nutze Pretendo Network";
|
||||||
|
case nn::swkbd::LanguageType::Simplified_Chinese:
|
||||||
|
return "使用 Pretendo Network";
|
||||||
|
case nn::swkbd::LanguageType::traditional_Chinese:
|
||||||
|
return "使用 Pretendo Network";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -169,8 +178,7 @@ INITIALIZE_PLUGIN() {
|
||||||
if (Config::connect_to_network) {
|
if (Config::connect_to_network) {
|
||||||
if (is555(os_version)) {
|
if (is555(os_version)) {
|
||||||
Mocha_IOSUKernelWrite32(0xE1019F78, 0xE3A00001); // mov r0, #1
|
Mocha_IOSUKernelWrite32(0xE1019F78, 0xE3A00001); // mov r0, #1
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
Mocha_IOSUKernelWrite32(0xE1019E84, 0xE3A00001); // mov r0, #1
|
Mocha_IOSUKernelWrite32(0xE1019E84, 0xE3A00001); // mov r0, #1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -180,8 +188,7 @@ INITIALIZE_PLUGIN() {
|
||||||
DEBUG_FUNCTION_LINE_VERBOSE("Pretendo URL and NoSSL patches applied successfully.");
|
DEBUG_FUNCTION_LINE_VERBOSE("Pretendo URL and NoSSL patches applied successfully.");
|
||||||
|
|
||||||
ShowNotification(get_pretendo_message());
|
ShowNotification(get_pretendo_message());
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
DEBUG_FUNCTION_LINE_VERBOSE("Pretendo URL and NoSSL patches skipped.");
|
DEBUG_FUNCTION_LINE_VERBOSE("Pretendo URL and NoSSL patches skipped.");
|
||||||
|
|
||||||
ShowNotification(get_nintendo_network_message());
|
ShowNotification(get_nintendo_network_message());
|
||||||
|
@ -214,6 +221,5 @@ ON_APPLICATION_START() {
|
||||||
}
|
}
|
||||||
|
|
||||||
ON_APPLICATION_ENDS() {
|
ON_APPLICATION_ENDS() {
|
||||||
// commented because it doesnt really unload inkay
|
|
||||||
//DEBUG_FUNCTION_LINE_VERBOSE("Unloading Inkay...\n");
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,8 @@
|
||||||
#include <coreinit/memorymap.h>
|
#include <coreinit/memorymap.h>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
bool replace(uint32_t start, uint32_t size, const char* original_val, size_t original_val_sz, const char* new_val, size_t new_val_sz) {
|
bool replace(uint32_t start, uint32_t size, const char *original_val, size_t original_val_sz, const char *new_val,
|
||||||
|
size_t new_val_sz) {
|
||||||
for (uint32_t addr = start; addr < start + size - original_val_sz; addr++) {
|
for (uint32_t addr = start; addr < start + size - original_val_sz; addr++) {
|
||||||
int ret = memcmp(original_val, (void *) addr, original_val_sz);
|
int ret = memcmp(original_val, (void *) addr, original_val_sz);
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
|
|
|
@ -18,7 +18,8 @@
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <span>
|
#include <span>
|
||||||
|
|
||||||
bool replace(uint32_t start, uint32_t size, const char* original_val, size_t original_val_sz, const char* new_val, size_t new_val_sz);
|
bool replace(uint32_t start, uint32_t size, const char *original_val, size_t original_val_sz, const char *new_val,
|
||||||
|
size_t new_val_sz);
|
||||||
|
|
||||||
struct replacement {
|
struct replacement {
|
||||||
std::span<const uint8_t> orig;
|
std::span<const uint8_t> orig;
|
||||||
|
|
Loading…
Add table
Reference in a new issue