forked from PretendoNetwork/Inkay
initial spfn commit
This commit is contained in:
parent
fd06e2f2aa
commit
00a75e94cb
17 changed files with 140 additions and 80 deletions
|
|
@ -19,7 +19,7 @@ WUMS_ROOT := $(DEVKITPRO)/wums
|
|||
# DATA is a list of directories containing data files
|
||||
# INCLUDES is a list of directories containing header files
|
||||
#-------------------------------------------------------------------------------
|
||||
TARGET := Inkay-pretendo
|
||||
TARGET := Inkay-spfn
|
||||
BUILD := build
|
||||
SOURCES := src src/utils ../common
|
||||
DATA := data
|
||||
|
|
|
|||
|
|
@ -21,6 +21,9 @@
|
|||
#include <notifications/notifications.h>
|
||||
#include <utils/logger.h>
|
||||
#include "config.h"
|
||||
#include<coreinit/title.h>
|
||||
#include<coreinit/dynload.h>
|
||||
#include<vector>
|
||||
#include "module.h"
|
||||
|
||||
#define INKAY_VERSION "v3.0.0"
|
||||
|
|
@ -29,16 +32,72 @@
|
|||
Mandatory plugin information.
|
||||
If not set correctly, the loader will refuse to use the plugin.
|
||||
**/
|
||||
WUPS_PLUGIN_NAME("Inkay");
|
||||
WUPS_PLUGIN_DESCRIPTION("Pretendo Network Patcher");
|
||||
WUPS_PLUGIN_NAME("Inkay(SPFN)");
|
||||
WUPS_PLUGIN_DESCRIPTION("SPFN Network Patcher");
|
||||
WUPS_PLUGIN_VERSION(INKAY_VERSION);
|
||||
WUPS_PLUGIN_AUTHOR("Pretendo contributors");
|
||||
WUPS_PLUGIN_AUTHOR("Pretendo contributors and RusticMaple");
|
||||
WUPS_PLUGIN_LICENSE("GPLv3");
|
||||
|
||||
WUPS_USE_STORAGE("inkay");
|
||||
|
||||
WUPS_USE_WUT_DEVOPTAB();
|
||||
|
||||
bool is_current_game_splatoon(){
|
||||
auto current_game = OSGetTitleID();
|
||||
|
||||
if(
|
||||
current_game == 0x0005000010162B00 ||
|
||||
current_game == 0x0005000010176900 ||
|
||||
current_game == 0x0005000010176A00
|
||||
){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void splatoon_patcher(){
|
||||
if(is_current_game_splatoon()){
|
||||
NotificationModule_AddInfoNotification("Splatoon Detected, applying patch");
|
||||
|
||||
auto rpl_count = OSDynLoad_GetNumberOfRPLs();
|
||||
|
||||
std::vector<OSDynLoad_NotifyData> rpls(rpl_count);
|
||||
|
||||
if(!OSDynLoad_GetRPLInfo(0, rpl_count, rpls.data())){
|
||||
NotificationModule_AddInfoNotification("failed to get rpls");
|
||||
}
|
||||
|
||||
for(auto rpl: rpls){
|
||||
if(rpl.name != 0){
|
||||
if(strstr(rpl.name, "Gambit") != NULL){
|
||||
NotificationModule_AddInfoNotification(rpl.name);
|
||||
auto text_color = NMColor();
|
||||
text_color.r = 255;
|
||||
text_color.g = 255;
|
||||
text_color.b = 255;
|
||||
text_color.a = 255;
|
||||
|
||||
auto bg_color = NMColor();
|
||||
bg_color.r = 0;
|
||||
bg_color.g = 0;
|
||||
bg_color.b = 0;
|
||||
bg_color.a = 0;
|
||||
|
||||
NotificationModule_AddInfoNotificationEx(rpl.name, 30.0f, text_color, bg_color, nullptr, nullptr, true);
|
||||
|
||||
NotificationModule_AddInfoNotification("applying patches!!!!");
|
||||
|
||||
void* game_data_region = (void*)rpl.dataAddr;
|
||||
|
||||
auto str_loc = (char*)(0x000009ac + (uint32_t)game_data_region);
|
||||
|
||||
strcpy(str_loc, "https://s-res.spfn.net/post");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
INITIALIZE_PLUGIN() {
|
||||
WHBLogCafeInit();
|
||||
WHBLogUdpInit();
|
||||
|
|
@ -63,6 +122,7 @@ DEINITIALIZE_PLUGIN() {
|
|||
|
||||
ON_APPLICATION_START() {
|
||||
// Tell the module the plugin is running!
|
||||
splatoon_patcher();
|
||||
Inkay_SetPluginRunning();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue