From 89ea8862f1dd36dea30940f0f72772a176be2b5c Mon Sep 17 00:00:00 2001 From: PabloMK7 Date: Fri, 7 Mar 2025 18:59:59 +0100 Subject: [PATCH] Initial release --- Makefile | 2 +- plugin/Makefile | 2 +- plugin/sources/ArticFunctions.cpp | 37 +++++++++++++++++++++++++++++-- 3 files changed, 37 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 32cbfd5..a3bab01 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ VERSION_MAJOR := 1 -VERSION_MINOR := 2 +VERSION_MINOR := 0 VERSION_REVISION := 0 all: diff --git a/plugin/Makefile b/plugin/Makefile index 1a0f17f..223a1b9 100644 --- a/plugin/Makefile +++ b/plugin/Makefile @@ -15,7 +15,7 @@ INCLUDES := ArticProtocol/includes includes SOURCES := ArticProtocol/sources sources sources/CTRPluginFramework VERSION_MAJOR := 1 -VERSION_MINOR := 2 +VERSION_MINOR := 0 VERSION_REVISION := 0 SERVER_PORT := 5543 diff --git a/plugin/sources/ArticFunctions.cpp b/plugin/sources/ArticFunctions.cpp index 3a3bff2..c3e4df3 100644 --- a/plugin/sources/ArticFunctions.cpp +++ b/plugin/sources/ArticFunctions.cpp @@ -524,7 +524,7 @@ namespace ArticFunctions { if (!ret_buf) { return; } - ret_buf->data[0] = INITIAL_SETUP_APP_VERSION; + reinterpret_cast(ret_buf->data)[0] = INITIAL_SETUP_APP_VERSION; mi.FinishGood(0); } @@ -539,7 +539,7 @@ namespace ArticFunctions { if (!good) return; - if (type < 0 || type > 3) { + if (type < 0 || type > 5) { mi.FinishGood(-1); return; } @@ -650,6 +650,39 @@ namespace ArticFunctions { res = FSFILE_Read(file, &bytes_read, 0, ret_buf->data, (u32)size); FSFILE_Close(file); mi.FinishGood(bytes_read != size ? -2 : res); + } else if (type == 4) { + Result res = cfguInit(); + if (R_FAILED(res)) { + mi.FinishGood(res); + } + + u64 consoleID = 0; + u32 random = 0; + res = CFGU_GetConfigInfoBlk2(0x8, 0x00090001, &consoleID); + if (R_SUCCEEDED(res)) res = CFGU_GetConfigInfoBlk2(0x4, 0x00090002, &random); + if (R_FAILED(res)) { + cfguExit(); + mi.FinishGood(res); + } + + ArticProtocolCommon::Buffer* ret_buf = mi.ReserveResultBuffer(0, 0xC); + if (!ret_buf) { + return; + } + + *reinterpret_cast(ret_buf->data) = consoleID; + *reinterpret_cast(ret_buf->data + 8) = random; + + mi.FinishGood(res); + } else if (type == 5) { + ArticProtocolCommon::Buffer* ret_buf = mi.ReserveResultBuffer(0, 6); + if (!ret_buf) { + return; + } + + memcpy(ret_buf->data, OS_SharedConfig->wifi_macaddr, 6); + + mi.FinishGood(0); } }