From 5ed7ca16a467c832f95d63ac4b6ef73b359a3c6d Mon Sep 17 00:00:00 2001 From: Greg Date: Fri, 23 Dec 2022 23:49:26 -0700 Subject: [PATCH] IPC with ShellUI, Tidy up Toolbox, More app commands & more info for big app. --- Misc/ShellUI_IPC.h | 23 +- Playstation/OrbisLibAPI/APIPackets.h | 13 +- Playstation/OrbisLibAPI/AppDatabase.cpp | 54 +- Playstation/OrbisLibAPI/AppDatabase.h | 1 + Playstation/OrbisLibAPI/Apps.cpp | 53 +- Playstation/OrbisLibAPI/Apps.h | 3 + Playstation/OrbisLibAPI/LncUtil.cpp | 4 +- Playstation/OrbisLibAPI/OrbisLibAPI.vcxproj | 2 + .../OrbisLibAPI/OrbisLibAPI.vcxproj.filters | 6 + Playstation/OrbisLibAPI/ShellCoreUtil.cpp | 4 +- Playstation/OrbisLibAPI/ShellUIIPC.cpp | 56 ++ Playstation/OrbisLibAPI/ShellUIIPC.h | 12 + Playstation/OrbisLibAPI/SocketListener.cpp | 6 +- Playstation/OrbisLibAPI/Target.cpp | 28 +- Playstation/OrbisLibAPI/Utilities.cpp | 34 +- Playstation/OrbisLibAPI/Utilities.h | 3 +- Playstation/OrbisLibAPI/Version.h | 22 +- Playstation/OrbisLibAPI/build.bat | 2 +- Playstation/OrbisLibAPI/main.cpp | 32 +- Playstation/OrbisToolbox-2.0/Flash.cpp | 14 - Playstation/OrbisToolbox-2.0/Flash.h | 12 - ...etListener.cpp => LocalSocketListener.cpp} | 58 +- ...SocketListener.h => LocalSocketListener.h} | 19 +- .../OrbisToolbox-2.0/OrbisToolbox-2.0.vcxproj | 10 +- .../OrbisToolbox-2.0.vcxproj.filters | 30 +- Playstation/OrbisToolbox-2.0/OrbisToolbox.cpp | 37 +- Playstation/OrbisToolbox-2.0/Registry.cpp | 663 ------------------ Playstation/OrbisToolbox-2.0/Registry.h | 3 - Playstation/OrbisToolbox-2.0/RemoteCaller.h | 18 + Playstation/OrbisToolbox-2.0/System.cpp | 143 ---- Playstation/OrbisToolbox-2.0/System.h | 38 - Playstation/OrbisToolbox-2.0/Utilities.cpp | 22 +- Playstation/OrbisToolbox-2.0/Utilities.h | 4 +- Playstation/OrbisToolbox-2.0/Version.h | 22 +- Windows/Libraries/OrbisLib2/Common/API/API.cs | 34 +- .../OrbisLib2/Common/API/APIPackets.cs | 17 +- .../OrbisLib2/Common/Database/TargetInfo.cs | 14 +- .../OrbisLib2/Targets/Application.cs | 76 ++ .../OrbisLib2/Targets/TargetManager.cs | 4 +- .../Controls/CurrentTargetDisplay.xaml.cs | 8 +- .../Controls/AppPanel.xaml.cs | 42 +- .../Controls/CurrentTargetDisplay.xaml.cs | 8 +- .../MVVM/View/DashboardView.xaml.cs | 6 +- .../Resources/BuildNumber.txt | 2 +- .../Resources/BuildString.txt | 2 +- .../Service/TargetWatcher.cs | 2 +- 46 files changed, 598 insertions(+), 1068 deletions(-) create mode 100644 Playstation/OrbisLibAPI/ShellUIIPC.cpp create mode 100644 Playstation/OrbisLibAPI/ShellUIIPC.h delete mode 100644 Playstation/OrbisToolbox-2.0/Flash.cpp delete mode 100644 Playstation/OrbisToolbox-2.0/Flash.h rename Playstation/OrbisToolbox-2.0/{SocketListener.cpp => LocalSocketListener.cpp} (68%) rename Playstation/OrbisToolbox-2.0/{SocketListener.h => LocalSocketListener.h} (53%) delete mode 100644 Playstation/OrbisToolbox-2.0/Registry.cpp delete mode 100644 Playstation/OrbisToolbox-2.0/Registry.h delete mode 100644 Playstation/OrbisToolbox-2.0/System.cpp delete mode 100644 Playstation/OrbisToolbox-2.0/System.h diff --git a/Misc/ShellUI_IPC.h b/Misc/ShellUI_IPC.h index 01f5351..4842b90 100644 --- a/Misc/ShellUI_IPC.h +++ b/Misc/ShellUI_IPC.h @@ -1,30 +1,17 @@ #pragma once #define SHELL_IPC_ADDR "/system_tmp/ShellIPC" -#define GENERAL_IPC_PORT 2023 enum ShellIPCCommands { - SIPC_HANDLE, - SIPC_TARGET_INFO, + // Returns the current handle. + SIPC_HANDLE = 1, + // Refreshes the app list on the Home menu. + SIPC_REFRESH_CONTENT_AREA, + // Sets/Gets the Orbis Toolbox settings bellow. SIPC_SETTINGS_RW, }; -struct ShellUI_TargetInfoPacket -{ - char MACAdressLAN[18]; - char MACAdressWIFI[18]; - - uint64_t FreeSpace; - uint64_t TotalSpace; - - int ThreadCount; - float AverageCPUUsage; - int BusyCore; - MemoryInfo Ram; - MemoryInfo VRam; -}; - struct ShellUI_SettingsPacket { int AutoLoadSettings; diff --git a/Playstation/OrbisLibAPI/APIPackets.h b/Playstation/OrbisLibAPI/APIPackets.h index a16231c..a9b06a4 100644 --- a/Playstation/OrbisLibAPI/APIPackets.h +++ b/Playstation/OrbisLibAPI/APIPackets.h @@ -28,6 +28,8 @@ enum APICommands API_APPS_SUSPEND, API_APPS_RESUME, API_APPS_DELETE, + API_APPS_SET_VISIBILITY, + API_APPS_GET_VISIBILITY, APP_END, /* ############################## */ @@ -211,12 +213,19 @@ struct MemoryInfo float Percentage; }; +struct CurrentBigApp +{ + int Pid; + char Name[32]; + char TitleId[10]; +}; + struct TargetInfoPacket { int SDKVersion; int SoftwareVersion; int FactorySoftwareVersion; - char CurrentTitleID[10]; + CurrentBigApp BigApp; char ConsoleName[100]; char MotherboardSerial[14]; char Serial[10]; @@ -232,9 +241,11 @@ struct TargetInfoPacket int AttachedPid; int ForegroundAccountId; + // Storage Stats uint64_t FreeSpace; uint64_t TotalSpace; + // System Stats int CPUTemp; int SOCTemp; int ThreadCount; diff --git a/Playstation/OrbisLibAPI/AppDatabase.cpp b/Playstation/OrbisLibAPI/AppDatabase.cpp index 8e731bb..c748fd3 100644 --- a/Playstation/OrbisLibAPI/AppDatabase.cpp +++ b/Playstation/OrbisLibAPI/AppDatabase.cpp @@ -127,7 +127,7 @@ bool AppDatabase::GetAppInfoString(const char* TitleId, char* Out, size_t OutSiz } if (res != SQLITE_DONE) { - printf("GetApps(): Res %d Error: %s\n", res, sqlite3_errmsg(db)); + printf("GetAppInfoString(): Res %d Error: %s\n", res, sqlite3_errmsg(db)); } // Release resources. @@ -170,6 +170,58 @@ bool AppDatabase::SetVisibility(const char* TitleId, VisibilityType Visibility) return true; } +AppDatabase::VisibilityType AppDatabase::GetVisibility(const char* TitleId) +{ + int res; + + auto db = OpenDatabase(); + if (db == nullptr) + { + return VisibilityType::VT_NONE; + } + + // Get the current user id. + int ForegroundAccountId; + sceUserServiceGetForegroundUser(&ForegroundAccountId); + + // build statement. + char query[0x200]; + snprintf(query, sizeof(query), "SELECT * FROM tbl_appbrowse_0%i WHERE titleId='%s'", ForegroundAccountId, TitleId); + + // Prepare statement. + sqlite3_stmt* stmt; + res = sqlite3_prepare(db, query, -1, &stmt, NULL); + if (res != SQLITE_OK) + { + klog("sqlite3_prepare(): Failed because %s\n", sqlite3_errmsg(db)); + sqlite3_close(db); + return VisibilityType::VT_NONE; + } + + res = sqlite3_step(stmt); + + if (res == SQLITE_ROW) + { + auto result = (VisibilityType)sqlite3_column_int(stmt, 8); + + // Release resources. + sqlite3_finalize(stmt); + sqlite3_close(db); + + return result; + } + + if (res != SQLITE_DONE) { + printf("GetAppInfoString(): Res %d Error: %s\n", res, sqlite3_errmsg(db)); + } + + // Release resources. + sqlite3_finalize(stmt); + sqlite3_close(db); + + return VisibilityType::VT_NONE; +} + AppDatabase::AppDatabase() { diff --git a/Playstation/OrbisLibAPI/AppDatabase.h b/Playstation/OrbisLibAPI/AppDatabase.h index d90b59c..b80dd61 100644 --- a/Playstation/OrbisLibAPI/AppDatabase.h +++ b/Playstation/OrbisLibAPI/AppDatabase.h @@ -41,6 +41,7 @@ public: static bool GetApps(std::vector &Apps); static bool GetAppInfoString(const char* TitleId, char* Out, size_t OutSize, const char* Key); static bool SetVisibility(const char* TitleId, VisibilityType Visibility); + static VisibilityType GetVisibility(const char* TitleId); AppDatabase(); ~AppDatabase(); diff --git a/Playstation/OrbisLibAPI/Apps.cpp b/Playstation/OrbisLibAPI/Apps.cpp index 80b3e09..ac949cd 100644 --- a/Playstation/OrbisLibAPI/Apps.cpp +++ b/Playstation/OrbisLibAPI/Apps.cpp @@ -1,8 +1,10 @@ #include "Common.h" #include "Apps.h" +#include "AppDatabase.h" +#include "ShellUIIPC.h" + #include #include -#include "AppDatabase.h" void Apps::HandleAPI(OrbisNetId Sock, APIPacket* Packet) { @@ -60,6 +62,24 @@ void Apps::HandleAPI(OrbisNetId Sock, APIPacket* Packet) ResumeApp(Sock, titleId); + break; + + case API_APPS_DELETE: + + DeleteApp(Sock, titleId); + + break; + + case API_APPS_SET_VISIBILITY: + + SetVisibility(Sock, titleId); + + break; + + case API_APPS_GET_VISIBILITY: + + GetVisibility(Sock, titleId); + break; } } @@ -206,7 +226,7 @@ void Apps::ResumeApp(OrbisNetId Sock, const char* TitleId) { auto appId = GetAppId(TitleId); - if (appId > 0 && LncUtil::sceLncUtilResumeApp(appId, 0) == 0) + if (appId > 0 && LncUtil::sceLncUtilResumeApp(appId, 0) == 0 && sceApplicationSetApplicationFocus(appId) == 0) { SockSendInt(Sock, 1); } @@ -216,6 +236,35 @@ void Apps::ResumeApp(OrbisNetId Sock, const char* TitleId) } } +void Apps::DeleteApp(OrbisNetId Sock, const char* TitleId) +{ + auto result = sceAppInstUtilAppUnInstall(TitleId); + + SockSendInt(Sock, (result == 0) ? 1 : 0); +} + +void Apps::SetVisibility(OrbisNetId Sock, const char* TitleId) +{ + auto value = RecieveInt(Sock); + + if (value >= AppDatabase::VisibilityType::VT_NONE && value <= AppDatabase::VisibilityType::VT_INVISIBLE) + { + auto result = AppDatabase::SetVisibility(TitleId, (AppDatabase::VisibilityType)value); + + ShellUIIPC::RefreshContentArea(); + + SockSendInt(Sock, result ? 1 : 0); + } + + SockSendInt(Sock, 0); +} + +void Apps::GetVisibility(OrbisNetId Sock, const char* TitleId) +{ + auto visibility = AppDatabase::GetVisibility(TitleId); + SockSendInt(Sock, visibility); +} + Apps::Apps() { diff --git a/Playstation/OrbisLibAPI/Apps.h b/Playstation/OrbisLibAPI/Apps.h index 7366bc0..a3adb9f 100644 --- a/Playstation/OrbisLibAPI/Apps.h +++ b/Playstation/OrbisLibAPI/Apps.h @@ -19,4 +19,7 @@ private: void KillApp(OrbisNetId Sock, const char* TitleId); void SuspendApp(OrbisNetId Sock, const char* TitleId); void ResumeApp(OrbisNetId Sock, const char* TitleId); + void DeleteApp(OrbisNetId Sock, const char* TitleId); + void SetVisibility(OrbisNetId Sock, const char* TitleId); + void GetVisibility(OrbisNetId Sock, const char* TitleId); }; diff --git a/Playstation/OrbisLibAPI/LncUtil.cpp b/Playstation/OrbisLibAPI/LncUtil.cpp index 503addc..d24017e 100644 --- a/Playstation/OrbisLibAPI/LncUtil.cpp +++ b/Playstation/OrbisLibAPI/LncUtil.cpp @@ -10,9 +10,7 @@ int(*LncUtil::_sceLncUtilResumeApp)(int AppId, int Flag); int LncUtil::Init() { // Load the prx or get its module handle. - char Buffer[0x200]; - sprintf(Buffer, "/%s/common/lib/libSceSystemService.sprx", sceKernelGetFsSandboxRandomWord()); - int libHandle = sceKernelLoadStartModule(Buffer, 0, nullptr, 0, nullptr, nullptr); + int libHandle = sceKernelLoadStartModule("/system/common/lib/libSceSystemService.sprx", 0, nullptr, 0, nullptr, nullptr); if (libHandle == 0) { klog("Failed to load libSceSystemService Library.\n"); return -1; diff --git a/Playstation/OrbisLibAPI/OrbisLibAPI.vcxproj b/Playstation/OrbisLibAPI/OrbisLibAPI.vcxproj index 4e7e5de..041b2ff 100644 --- a/Playstation/OrbisLibAPI/OrbisLibAPI.vcxproj +++ b/Playstation/OrbisLibAPI/OrbisLibAPI.vcxproj @@ -74,6 +74,7 @@ del /s /q /f $(IntDir)\*.oelf + @@ -96,6 +97,7 @@ del /s /q /f $(IntDir)\*.oelf + diff --git a/Playstation/OrbisLibAPI/OrbisLibAPI.vcxproj.filters b/Playstation/OrbisLibAPI/OrbisLibAPI.vcxproj.filters index 7a930a3..87a2366 100644 --- a/Playstation/OrbisLibAPI/OrbisLibAPI.vcxproj.filters +++ b/Playstation/OrbisLibAPI/OrbisLibAPI.vcxproj.filters @@ -103,6 +103,9 @@ Source Files\Utilities\PS Utils + + Source Files\Utilities + @@ -168,5 +171,8 @@ Header Files\Utilities\PS Utils + + Header Files\Utilities + \ No newline at end of file diff --git a/Playstation/OrbisLibAPI/ShellCoreUtil.cpp b/Playstation/OrbisLibAPI/ShellCoreUtil.cpp index d64b8b4..053abb7 100644 --- a/Playstation/OrbisLibAPI/ShellCoreUtil.cpp +++ b/Playstation/OrbisLibAPI/ShellCoreUtil.cpp @@ -7,9 +7,7 @@ int(*ShellCoreUtil::_sceShellCoreUtilGetFreeSizeOfUserPartition)(uint64_t* free, int ShellCoreUtil::Init() { // Load the prx or get its module handle. - char Buffer[0x200]; - sprintf(Buffer, "/%s/common/lib/libSceSystemService.sprx", sceKernelGetFsSandboxRandomWord()); - int libHandle = sceKernelLoadStartModule(Buffer, 0, nullptr, 0, nullptr, nullptr); + int libHandle = sceKernelLoadStartModule("/system/common/lib/libSceSystemService.sprx", 0, nullptr, 0, nullptr, nullptr); if (libHandle == 0) { klog("Failed to load libSceSystemService Library.\n"); return -1; diff --git a/Playstation/OrbisLibAPI/ShellUIIPC.cpp b/Playstation/OrbisLibAPI/ShellUIIPC.cpp new file mode 100644 index 0000000..d13bcf3 --- /dev/null +++ b/Playstation/OrbisLibAPI/ShellUIIPC.cpp @@ -0,0 +1,56 @@ +#include "Common.h" +#include "ShellUIIPC.h" +#include + +OrbisNetId ShellUIIPC::Connect() +{ + OrbisNetSockaddrUn addr = { 0 }; + addr.sun_family = ORBIS_NET_AF_LOCAL; + strncpy(addr.sun_path, SHELL_IPC_ADDR, sizeof(addr.sun_path)); + + // Make new local Socket + auto Socket = sceNetSocket("GeneralIPC Socket", ORBIS_NET_AF_LOCAL, ORBIS_NET_SOCK_STREAM, 0); + + auto res = sceNetConnect(Socket, (OrbisNetSockaddr*)&addr, SUN_LEN(&addr)); + if (!res) + return Socket; + else + { + klog("Failed to connect to socket! Error: %llX\n", res); + return NULL; + } +} + +bool ShellUIIPC::SendCommand(OrbisNetId Sock, int Command) +{ + if (!SockSendInt(Sock, Command)) + { + klog("[GeneralIPC] Failed to send Command\n"); + return false; + } + + int Status; + if (!SockRecvInt(Sock, &Status)) + { + klog("[GeneralIPC] Failed to recv status\n"); + return false; + } + + return Status == 1; +} + +void ShellUIIPC::RefreshContentArea() +{ + auto Sock = Connect(); + + if (!Sock) + { + klog("[ShellUIIPC] Failed to connect to socket.\n"); + return; + } + + if (!SendCommand(Sock, SIPC_REFRESH_CONTENT_AREA)) + { + klog("[ShellUIIPC] Failed to send command.\n"); + } +} \ No newline at end of file diff --git a/Playstation/OrbisLibAPI/ShellUIIPC.h b/Playstation/OrbisLibAPI/ShellUIIPC.h new file mode 100644 index 0000000..f8bbfdb --- /dev/null +++ b/Playstation/OrbisLibAPI/ShellUIIPC.h @@ -0,0 +1,12 @@ +#pragma once +#include "..\..\Misc\ShellUI_IPC.h" + +class ShellUIIPC +{ +private: + static OrbisNetId Connect(); + static bool SendCommand(OrbisNetId Sock, int Command); + +public: + static void RefreshContentArea(); +}; \ No newline at end of file diff --git a/Playstation/OrbisLibAPI/SocketListener.cpp b/Playstation/OrbisLibAPI/SocketListener.cpp index e057f1b..f228a0e 100644 --- a/Playstation/OrbisLibAPI/SocketListener.cpp +++ b/Playstation/OrbisLibAPI/SocketListener.cpp @@ -96,10 +96,6 @@ void* SocketListener::DoWork() int optval = 1; sceNetSetsockopt(ClientSocket, ORBIS_NET_SOL_SOCKET, ORBIS_NET_SO_NOSIGPIPE, &optval, sizeof(optval)); - int sock_timeout = 3000000; - sceNetSetsockopt(ClientSocket, ORBIS_NET_SOL_SOCKET, ORBIS_NET_SO_SNDTIMEO, &sock_timeout, sizeof(sock_timeout)); - sceNetSetsockopt(ClientSocket, ORBIS_NET_SOL_SOCKET, ORBIS_NET_SO_RCVTIMEO, &sock_timeout, sizeof(sock_timeout)); - // Set up thread params. ClientThreadParams* Params = new ClientThreadParams(); Params->socketListener = this; @@ -107,7 +103,7 @@ void* SocketListener::DoWork() // Create Thread to handle connection. OrbisPthread* Thread; - int res = scePthreadCreate(&Thread, NULL, &ClientThread, Params, "Client Thread"); + scePthreadCreate(&Thread, NULL, &ClientThread, Params, "Client Thread"); scePthreadDetach(*Thread); // Reset ClientSocket. diff --git a/Playstation/OrbisLibAPI/Target.cpp b/Playstation/OrbisLibAPI/Target.cpp index dc4ddb8..34adad2 100644 --- a/Playstation/OrbisLibAPI/Target.cpp +++ b/Playstation/OrbisLibAPI/Target.cpp @@ -90,12 +90,32 @@ void Target::SendTargetInfo(OrbisNetId Sock) auto bigAppAppId = sceSystemServiceGetAppIdOfBigApp(); if (bigAppAppId > 0) { - OrbisAppInfo bigAppInfo; - sceApplicationGetAppInfoByAppId(bigAppAppId, &bigAppInfo); - strcpy(Packet->CurrentTitleID, bigAppInfo.TitleId); + // Get the list of running processes. + std::vector processList; + GetProcessList(processList); + + for (const auto& i : processList) + { + // Get the app info using the pid. + OrbisAppInfo appInfo; + sceKernelGetAppInfo(i.pid, &appInfo); + + // Using the titleId match our desired app and return the appId from the appinfo. + if (appInfo.AppId == bigAppAppId) + { + Packet->BigApp.Pid = i.pid; + strcpy(Packet->BigApp.Name, i.name); + strcpy(Packet->BigApp.TitleId, appInfo.TitleId); + + break; + } + } } else - strcpy(Packet->CurrentTitleID, "N/A"); + { + strcpy(Packet->BigApp.TitleId, "N/A"); + } + GetConsoleName(Packet->ConsoleName, 100); ReadFlash(FLASH_MB_SERIAL, &Packet->MotherboardSerial, 14); diff --git a/Playstation/OrbisLibAPI/Utilities.cpp b/Playstation/OrbisLibAPI/Utilities.cpp index d826528..740d13c 100644 --- a/Playstation/OrbisLibAPI/Utilities.cpp +++ b/Playstation/OrbisLibAPI/Utilities.cpp @@ -4,15 +4,14 @@ #pragma region Modules void(*_sceSysmoduleLoadModuleInternal)(uint32_t); //Import is broken for some reason -int (*_sceSysmoduleLoadModuleByNameInternal)(const char* name, int, int, int, int); +int(*sceAppInstUtilInitialize)(); +int(*sceAppInstUtilAppUnInstall)(const char* TitleId); bool LoadModules() { //Load the sysmodule library and import for sceSysmoduleLoadModuleInternal for some reason wouldnt auto import. - char Buffer[0x200]; - sprintf(Buffer, "/%s/common/lib/libSceSysmodule.sprx", sceKernelGetFsSandboxRandomWord()); - int ModuleHandle = sceKernelLoadStartModule(Buffer, 0, nullptr, 0, nullptr, nullptr); - if (ModuleHandle == 0) { + int ModuleHandle = sceKernelLoadStartModule("/system/common/lib/libSceSysmodule.sprx", 0, nullptr, 0, nullptr, nullptr); + if (ModuleHandle < 0) { klog("Failed to load libSceSysmodule Library.\n"); return false; } @@ -23,13 +22,8 @@ bool LoadModules() return false; } - sceKernelDlsym(ModuleHandle, "sceSysmoduleLoadModuleByNameInternal", (void**)&_sceSysmoduleLoadModuleByNameInternal); - if (_sceSysmoduleLoadModuleInternal == nullptr) { - klog("Failed to load _sceSysmoduleLoadModuleByNameInternal Import.\n"); - return false; - } - _sceSysmoduleLoadModuleInternal(SCE_SYSMODULE_INTERNAL_SYSTEM_SERVICE); + _sceSysmoduleLoadModuleInternal(SCE_SYSMODULE_INTERNAL_APPINSTUTIL); _sceSysmoduleLoadModuleInternal(SCE_SYSMODULE_INTERNAL_USER_SERVICE); _sceSysmoduleLoadModuleInternal(SCE_SYSMODULE_INTERNAL_SYS_CORE); _sceSysmoduleLoadModuleInternal(SCE_SYSMODULE_INTERNAL_PAD); @@ -39,6 +33,24 @@ bool LoadModules() _sceSysmoduleLoadModuleInternal(SCE_SYSMODULE_INTERNAL_BGFT); _sceSysmoduleLoadModuleInternal(0xA4); + int libSceAppInstUtil = sceKernelLoadStartModule("/system/common/lib/libSceAppInstUtil.sprx", 0, nullptr, 0, nullptr, nullptr); + if (libSceAppInstUtil < 0) { + klog("Failed to load libSceAppInstUtil Library.\n"); + return false; + } + + sceKernelDlsym(libSceAppInstUtil, "sceAppInstUtilInitialize", (void**)&sceAppInstUtilInitialize); + if (sceAppInstUtilInitialize == nullptr) { + klog("Failed to load sceAppInstUtilInitialize Import.\n"); + return false; + } + + sceKernelDlsym(libSceAppInstUtil, "sceAppInstUtilAppUnInstall", (void**)&sceAppInstUtilAppUnInstall); + if (sceAppInstUtilAppUnInstall == nullptr) { + klog("Failed to load sceAppInstUtilAppUnInstall Import.\n"); + return false; + } + return true; } diff --git a/Playstation/OrbisLibAPI/Utilities.h b/Playstation/OrbisLibAPI/Utilities.h index 76d0041..ec3ef9d 100644 --- a/Playstation/OrbisLibAPI/Utilities.h +++ b/Playstation/OrbisLibAPI/Utilities.h @@ -2,7 +2,8 @@ // Modules. extern void(*_sceSysmoduleLoadModuleInternal)(uint32_t); //Import is broken for some reason -extern int (*_sceSysmoduleLoadModuleByNameInternal)(const char* name, int, int, int, int); +extern int(*sceAppInstUtilInitialize)(); +extern int(*sceAppInstUtilAppUnInstall)(const char* TitleId); bool LoadModules(); diff --git a/Playstation/OrbisLibAPI/Version.h b/Playstation/OrbisLibAPI/Version.h index 59894a0..e45173b 100644 --- a/Playstation/OrbisLibAPI/Version.h +++ b/Playstation/OrbisLibAPI/Version.h @@ -1,11 +1,11 @@ -#pragma once -#define ORBISLIB_MAJOR 3 -#define ORBISLIB_MINOR 0 -#define ORBISLIB_BUILDVERSION 668 -#define stringify(a) stringify_(a) -#define stringify_(a) #a -#if defined(_DEBUG) -#define ORBISLIB_BUILDSTRING ("[OrbisLib Daemon " stringify(ORBISLIB_MAJOR) "." stringify(ORBISLIB_MINOR) "] Dev Build " stringify(ORBISLIB_BUILDVERSION) " " __DATE__ " " __TIME__) -#else -#define ORBISLIB_BUILDSTRING ("[OrbisLib Daemon " stringify(ORBISLIB_MAJOR) "." stringify(ORBISLIB_MINOR) "] Build " stringify(ORBISLIB_BUILDVERSION) " " __DATE__ " " __TIME__) -#endif +#pragma once +#define ORBISLIB_MAJOR 3 +#define ORBISLIB_MINOR 0 +#define ORBISLIB_BUILDVERSION 693 +#define stringify(a) stringify_(a) +#define stringify_(a) #a +#if defined(_DEBUG) +#define ORBISLIB_BUILDSTRING ("[OrbisLib Daemon " stringify(ORBISLIB_MAJOR) "." stringify(ORBISLIB_MINOR) "] Dev Build " stringify(ORBISLIB_BUILDVERSION) " " __DATE__ " " __TIME__) +#else +#define ORBISLIB_BUILDSTRING ("[OrbisLib Daemon " stringify(ORBISLIB_MAJOR) "." stringify(ORBISLIB_MINOR) "] Build " stringify(ORBISLIB_BUILDVERSION) " " __DATE__ " " __TIME__) +#endif diff --git a/Playstation/OrbisLibAPI/build.bat b/Playstation/OrbisLibAPI/build.bat index 07f4676..0e20eb5 100644 --- a/Playstation/OrbisLibAPI/build.bat +++ b/Playstation/OrbisLibAPI/build.bat @@ -1,7 +1,7 @@ SETLOCAL EnableDelayedExpansion Rem Libraries to link in -set libraries=-lc++ -lc -lSceSysModule -lkernel -lSceVideoOut -lSceSystemService -lSceSysCore -lSceSystemStateMgr -lSceNet -lScePad -lSceUserService -lSceRegMgr -lSceFreeType -lSceMsgDialog -lSceCommonDialog -lGoldHEN_Hook -lSQLite +set libraries=-lc++ -lc -lSceSysModule -lkernel -lSceVideoOut -lSceSystemService -lSceSysCore -lSceSystemStateMgr -lSceNet -lScePad -lSceUserService -lSceRegMgr -lSceFreeType -lSceMsgDialog -lSceCommonDialog -lGoldHEN_Hook -lSQLite -lSceAppInstUtil Rem Read the script arguments into local vars set intdir=%1 diff --git a/Playstation/OrbisLibAPI/main.cpp b/Playstation/OrbisLibAPI/main.cpp index d91a27d..1a4761e 100644 --- a/Playstation/OrbisLibAPI/main.cpp +++ b/Playstation/OrbisLibAPI/main.cpp @@ -9,6 +9,14 @@ int main() { + // Jailbreak our current process. + if (!Jailbreak()) + { + Notify("Failed to jailbreak Process..."); + sceSystemServiceLoadExec("exit", 0); + return 0; + } + // Load internal system modules. if (!LoadModules()) { @@ -49,14 +57,6 @@ int main() return 0; } - // Jailbreak our current process. - if (!Jailbreak()) - { - Notify("Failed to jailbreak Process..."); - sceSystemServiceLoadExec("exit", 0); - return 0; - } - // TODO: Bug? This doesnt seem to work for some reason. // Check GoldHEN SDK Version make sure we can run! auto sdkVersion = sys_sdk_version(); @@ -81,6 +81,22 @@ int main() // Init SysCoreUtils. sceApplicationInitialize(); + // Init App install utils. + sceAppInstUtilInitialize(); + +#define LOADTOOLBOX +#ifdef LOADTOOLBOX + auto handle = sys_sdk_proc_prx_load("SceShellUI", "/user/data/Orbis Toolbox/OrbisToolbox-2.0.sprx"); + if (handle > 0) { + klog("Orbis Toolbox loaded! %d\n", handle); + } + else + { + klog("error: %d\n", handle); + Notify("Failed to load Orbis Toolbox!"); + } +#endif + // start up the API. NOTE: this is blocking. API::Init(); diff --git a/Playstation/OrbisToolbox-2.0/Flash.cpp b/Playstation/OrbisToolbox-2.0/Flash.cpp deleted file mode 100644 index a19ef17..0000000 --- a/Playstation/OrbisToolbox-2.0/Flash.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "Common.h" -#include "Flash.h" - -void ReadFlash(off_t Offset, void* Data, unsigned int Size) -{ - int fd = sceKernelOpen("/dev/sflash0", ORBIS_KERNEL_O_RDONLY, 0777); - if (fd) - { - sceKernelPread(fd, Data, Size, Offset); - sceKernelClose(fd); - } - else - klog("Failed to Open sflash\n"); -} \ No newline at end of file diff --git a/Playstation/OrbisToolbox-2.0/Flash.h b/Playstation/OrbisToolbox-2.0/Flash.h deleted file mode 100644 index ed082e3..0000000 --- a/Playstation/OrbisToolbox-2.0/Flash.h +++ /dev/null @@ -1,12 +0,0 @@ -#pragma once - -#define FLASH_FACTORY_FW 0x1C9060 // 4 Bytes -#define FLASH_CURRENT_FW 0x1C9068 // 4 Bytes -#define FLASH_MB_SERIAL 0x1C8000 // 14 Bytes String -#define FLASH_SERIAL 0x1C8030 // 10 Bytes String -#define FLASH_MODEL 0x1C8041 // 14 Bytes String -#define FLASH_LAN_MAC 0x1C4021 // 6 Bytes -#define FLASH_UART_FLAG 0x1C931F // 1 Byte -#define FLASH_IDU_MODE 0x1CA600 // 1 Byte - -void ReadFlash(off_t Offset, void* Data, unsigned int Size); \ No newline at end of file diff --git a/Playstation/OrbisToolbox-2.0/SocketListener.cpp b/Playstation/OrbisToolbox-2.0/LocalSocketListener.cpp similarity index 68% rename from Playstation/OrbisToolbox-2.0/SocketListener.cpp rename to Playstation/OrbisToolbox-2.0/LocalSocketListener.cpp index dbebc58..85875ef 100644 --- a/Playstation/OrbisToolbox-2.0/SocketListener.cpp +++ b/Playstation/OrbisToolbox-2.0/LocalSocketListener.cpp @@ -1,19 +1,14 @@ #include "Common.h" -#include "SocketListener.h" +#include "LocalSocketListener.h" +#include -struct ClientThreadParams -{ - SocketListener* socketListener; - OrbisNetId Sock; -}; - -void* SocketListener::ClientThread(void* tdParam) +void* LocalSocketListener::ClientThread(void* tdParam) { ClientThreadParams* Params = (ClientThreadParams*)tdParam; - SocketListener* socketListener = Params->socketListener; + LocalSocketListener* localSocketListener = Params->LocalSocketListener; OrbisNetId Sock = Params->Sock; - socketListener->ClientCallBack(socketListener->tdParam, Sock); + localSocketListener->ClientCallBack(localSocketListener->tdParam, Sock); sceNetSocketClose(Sock); free(Params); @@ -23,15 +18,14 @@ void* SocketListener::ClientThread(void* tdParam) return nullptr; } -void* SocketListener::DoWork() +void* LocalSocketListener::DoWork() { - OrbisNetSockaddrIn addr = { 0 }; - addr.sin_family = ORBIS_NET_AF_INET; - addr.sin_addr.s_addr = ORBIS_NET_INADDR_ANY; // Any incoming address - addr.sin_port = sceNetHtons(this->Port); // Our desired listen port + OrbisNetSockaddrUn addr = { 0 }; + addr.sun_family = ORBIS_NET_AF_LOCAL; + strncpy(addr.sun_path, this->ServerAddress, sizeof(addr.sun_path)); - // Make new TCP Socket - this->Socket = sceNetSocket("Listener Socket", ORBIS_NET_AF_INET, ORBIS_NET_SOCK_STREAM, ORBIS_NET_IPPROTO_TCP); + // Make new local Socket + this->Socket = sceNetSocket("Local Listener Socket", ORBIS_NET_AF_LOCAL, ORBIS_NET_SOCK_STREAM, 0); // Set Sending and reciving time out to 1000 ms int sock_timeout = 10000; @@ -42,10 +36,10 @@ void* SocketListener::DoWork() int reusePort = 1; sceNetSetsockopt(this->Socket, ORBIS_NET_SOL_SOCKET, ORBIS_NET_SO_REUSEPORT, &reusePort, sizeof(reusePort)); - auto bindError = sceNetBind(this->Socket, (OrbisNetSockaddr*)&addr, sizeof(addr)); + auto bindError = sceNetBind(this->Socket, (OrbisNetSockaddr*)&addr, SUN_LEN(&addr)); if (bindError != 0) { - klog("Failed to bind Listener to port %i\nError: %X", this->Port, bindError); + klog("Failed to bind Listener to address %s\nError: %X", this->ServerAddress, bindError); goto Cleanup; } @@ -67,7 +61,7 @@ void* SocketListener::DoWork() timeout.tv_sec = 2; timeout.tv_usec = 0; - // Wait fo rincoming connections. + // Wait for incoming connections. auto rv = select((int)this->Socket + 1, &set, NULL, NULL, &timeout); if (rv == -1) goto Cleanup; @@ -77,7 +71,7 @@ void* SocketListener::DoWork() goto Cleanup; continue; } - else + else { if (!this->ServerRunning) goto Cleanup; @@ -94,12 +88,13 @@ void* SocketListener::DoWork() sceNetSetsockopt(ClientSocket, ORBIS_NET_SOL_SOCKET, ORBIS_NET_SO_NOSIGPIPE, &optval, sizeof(optval)); // Set up thread params. ClientThreadParams* Params = new ClientThreadParams(); - Params->socketListener = this; + Params->LocalSocketListener = this; Params->Sock = ClientSocket; // Create Thread to handle connection. OrbisPthread* Thread; scePthreadCreate(&Thread, NULL, &ClientThread, Params, "Client Thread"); + scePthreadDetach(*Thread); // Reset ClientSocket. ClientSocket = -1; @@ -110,8 +105,6 @@ void* SocketListener::DoWork() Cleanup: klog("Listener Thread Exiting!\n"); - // Clean up. - this->ThreadCleanedUp = true; // Clean up. sceNetSocketClose(this->Socket); @@ -121,30 +114,29 @@ Cleanup: return nullptr; } -void* SocketListener::ListenThread(void* tdParam) +void* LocalSocketListener::ListenThread(void* tdParam) { - return ((SocketListener*)tdParam)->DoWork(); + return ((LocalSocketListener*)tdParam)->DoWork(); } - -SocketListener::SocketListener(void(*ClientCallBack)(void* tdParam, OrbisNetId Sock), void* tdParam, unsigned short Port) +LocalSocketListener::LocalSocketListener(void(*ClientCallBack)(void* tdParam, OrbisNetId Sock), void* tdParam, char* ServerAddress) { klog("Socket Listener.\n"); this->ClientCallBack = ClientCallBack; this->tdParam = tdParam; this->ServerRunning = true; - this->ThreadCleanedUp = false; - this->Port = Port; + strcpy(this->ServerAddress, ServerAddress); - scePthreadCreate(&ListenThreadHandle, NULL, &ListenThread, this, "Listen Thread"); + scePthreadCreate(&ListenThreadHandle, NULL, &ListenThread, this, "Local Listen Thread"); + scePthreadDetach(*ListenThreadHandle); } -SocketListener::~SocketListener() +LocalSocketListener::~LocalSocketListener() { klog("~Socket Listener.\n"); this->ServerRunning = false; - while (!this->ThreadCleanedUp) { sceKernelUsleep(10); } + scePthreadJoin(*ListenThreadHandle, nullptr); klog("Destruction sucessful.\n"); } \ No newline at end of file diff --git a/Playstation/OrbisToolbox-2.0/SocketListener.h b/Playstation/OrbisToolbox-2.0/LocalSocketListener.h similarity index 53% rename from Playstation/OrbisToolbox-2.0/SocketListener.h rename to Playstation/OrbisToolbox-2.0/LocalSocketListener.h index 28de07a..8e9012d 100644 --- a/Playstation/OrbisToolbox-2.0/SocketListener.h +++ b/Playstation/OrbisToolbox-2.0/LocalSocketListener.h @@ -1,16 +1,13 @@ #pragma once -class SocketListener +class LocalSocketListener { private: - OrbisPthread Thread; + OrbisPthread* ListenThreadHandle; OrbisNetId Socket; /// Used to signal thread to shut down bool ServerRunning; - /// Used to see when listen thread has closed. - bool ThreadCleanedUp; - unsigned short Port; - OrbisPthread* ListenThreadHandle; + char ServerAddress[0x100]; void* DoWork(); static void* ClientThread(void* tdParam); @@ -19,6 +16,12 @@ private: static void* ListenThread(void* tdParam); public: - SocketListener(void(*ClientCallBack)(void* tdParam, OrbisNetId Sock), void* tdParam, unsigned short Port); - ~SocketListener(); + LocalSocketListener(void(*ClientCallBack)(void* tdParam, OrbisNetId Sock), void* tdParam, char* ServerAddress); + ~LocalSocketListener(); +}; + +struct ClientThreadParams +{ + LocalSocketListener* LocalSocketListener; + OrbisNetId Sock; }; \ No newline at end of file diff --git a/Playstation/OrbisToolbox-2.0/OrbisToolbox-2.0.vcxproj b/Playstation/OrbisToolbox-2.0/OrbisToolbox-2.0.vcxproj index 9db0ae9..530361c 100644 --- a/Playstation/OrbisToolbox-2.0/OrbisToolbox-2.0.vcxproj +++ b/Playstation/OrbisToolbox-2.0/OrbisToolbox-2.0.vcxproj @@ -84,23 +84,20 @@ del /s /q /f $(IntDir)\*.oelf - + - - - @@ -117,24 +114,21 @@ del /s /q /f $(IntDir)\*.oelf - + - - - diff --git a/Playstation/OrbisToolbox-2.0/OrbisToolbox-2.0.vcxproj.filters b/Playstation/OrbisToolbox-2.0/OrbisToolbox-2.0.vcxproj.filters index 43d6cd3..84bfded 100644 --- a/Playstation/OrbisToolbox-2.0/OrbisToolbox-2.0.vcxproj.filters +++ b/Playstation/OrbisToolbox-2.0/OrbisToolbox-2.0.vcxproj.filters @@ -123,9 +123,6 @@ Header Files\Toolbox\UI - - Header Files\Utilities - Header Files\Utilities @@ -150,15 +147,6 @@ Header Files\Utilities\Mono - - Header Files\Utilities\PS Utils - - - Header Files\Utilities\PS Utils - - - Header Files\Utilities\PS Utils - Header Files\Utilities\PS Utils @@ -168,6 +156,9 @@ Header Files\Utilities\Memory Utils + + Header Files\Utilities + @@ -215,9 +206,6 @@ Source Files\Toolbox\UI\Elements - - Source Files\Utilities - Source Files\Utilities @@ -242,21 +230,15 @@ Source Files\Utilities\Memory Utils - - Source Files\Utilities\PS Utils - - - Source Files\Utilities\PS Utils - - - Source Files\Utilities\PS Utils - Source Files\Utilities\PS Utils Source Files\Utilities\Memory Utils + + Source Files\Utilities + diff --git a/Playstation/OrbisToolbox-2.0/OrbisToolbox.cpp b/Playstation/OrbisToolbox-2.0/OrbisToolbox.cpp index bcb4481..6f95854 100644 --- a/Playstation/OrbisToolbox-2.0/OrbisToolbox.cpp +++ b/Playstation/OrbisToolbox-2.0/OrbisToolbox.cpp @@ -3,8 +3,39 @@ #include "System_Monitor.h" #include "GamePad.h" #include "RemoteCaller.h" +#include "LocalSocketListener.h" +#include "../../Misc/ShellUI_IPC.h" -RemoteCaller* CallInMonoThread = NULL; +RemoteCaller* CallInMonoThread = nullptr; +LocalSocketListener* LocalListener = nullptr; + +void ListenerClientThread(void* tdParam, OrbisNetId Sock) +{ + int Command = RecieveInt(Sock); + if (Command != -1) + { + switch (Command) + { + default: + klog("Invalid Command enum %i\n", Command); + break; + + case SIPC_HANDLE: + + break; + + case SIPC_REFRESH_CONTENT_AREA: + + CallInMonoThread->RemoteCall(UI::Utilities::ReloadItemList); + + break; + + case SIPC_SETTINGS_RW: + + break; + } + } +} void* InitThread(void* args) { @@ -25,6 +56,7 @@ void* InitThread(void* args) // API CallInMonoThread = new RemoteCaller(); + LocalListener = new LocalSocketListener(ListenerClientThread, nullptr, SHELL_IPC_ADDR); Notify(ORBIS_TOOLBOX_NOTIFY); @@ -49,10 +81,11 @@ extern "C" // Toolbox Settings_Menu::Term(); System_Monitor::Term(); - //Title_Menu::Term(); 0x83D1E4A78 + //Title_Menu::Term(); // API delete CallInMonoThread; + delete LocalListener; sceKernelSleep(4); diff --git a/Playstation/OrbisToolbox-2.0/Registry.cpp b/Playstation/OrbisToolbox-2.0/Registry.cpp deleted file mode 100644 index cfad297..0000000 --- a/Playstation/OrbisToolbox-2.0/Registry.cpp +++ /dev/null @@ -1,663 +0,0 @@ -#include "Common.h" -#include "Registry.h" - -uint Registry_Find_By_Name(const char* Name) -{ - static std::map RegistryEntries; - static bool Initialized; - if (!Initialized) - { - RegistryEntries.insert(std::pair("/REGISTRY/version", 0x1010000)); - RegistryEntries.insert(std::pair("/REGISTRY", 0x1000000)); - RegistryEntries.insert(std::pair("/REGISTRY/install", 0x1020000)); - RegistryEntries.insert(std::pair("/REGISTRY/update", 0x1030000)); - RegistryEntries.insert(std::pair("/REGISTRY/not_save", 0x1040000)); - RegistryEntries.insert(std::pair("/REGISTRY/recover", 0x1050000)); - RegistryEntries.insert(std::pair("/REGISTRY/downgrade", 0x1060000)); - RegistryEntries.insert(std::pair("/REGISTRY/bootcount", 0x1070000)); - RegistryEntries.insert(std::pair("/REGISTRY/lastver", 0x1080000)); - RegistryEntries.insert(std::pair("/REGISTRY/init_flag", 0x1400000)); - RegistryEntries.insert(std::pair("/SYSTEM", 0x2000000)); - RegistryEntries.insert(std::pair("/SYSTEM/update_mode", 0x2010000)); - RegistryEntries.insert(std::pair("/SYSTEM/language", 0x2020000)); - RegistryEntries.insert(std::pair("/SYSTEM/initialize", 0x2040000)); - RegistryEntries.insert(std::pair("/SYSTEM/nickname", 0x2050000)); - RegistryEntries.insert(std::pair("/SYSTEM/dimmer_interval", 0x2060000)); - RegistryEntries.insert(std::pair("/SYSTEM/eapfunction", 0x2070000)); - RegistryEntries.insert(std::pair("/SYSTEM/enable_voicercg", 0x2080000)); - RegistryEntries.insert(std::pair("/SYSTEM/profilech_ver", 0x20A0000)); - RegistryEntries.insert(std::pair("/SYSTEM/button_assign", 0x20B0000)); - RegistryEntries.insert(std::pair("/SYSTEM/backup_mode", 0x20C0000)); - RegistryEntries.insert(std::pair("/SYSTEM/pon_memory_test", 0x20D0000)); - RegistryEntries.insert(std::pair("/SYSTEM/game_rec_mode", 0x20E0000)); - RegistryEntries.insert(std::pair("/SYSTEM/shell_function", 0x20F0000)); - RegistryEntries.insert(std::pair("/SYSTEM/pad_connection", 0x2100000)); - RegistryEntries.insert(std::pair("/SYSTEM/data_transfer", 0x2110000)); - RegistryEntries.insert(std::pair("/SYSTEM/base_mode_clkup", 0x2120000)); - RegistryEntries.insert(std::pair("/SYSTEM/neo_vddnb_vid_offset", 0x2400000)); - RegistryEntries.insert(std::pair("/SYSTEM/UPDATE", 0x2800000)); - RegistryEntries.insert(std::pair("/SYSTEM/UPDATE/server_url", 0x2800100)); - RegistryEntries.insert(std::pair("/SYSTEM/UPDATE/eula_version", 0x2800200)); - RegistryEntries.insert(std::pair("/SYSTEM/UPDATE/pscode", 0x2800300)); - RegistryEntries.insert(std::pair("/SYSTEM/UPDATE/reboot_flag", 0x2800400)); - RegistryEntries.insert(std::pair("/SYSTEM/UPDATE/auto_download", 0x2800500)); - RegistryEntries.insert(std::pair("/SYSTEM/UPDATE/idu_version", 0x2800600)); - RegistryEntries.insert(std::pair("/SYSTEM/UPDATE/next_check", 0x2800700)); - RegistryEntries.insert(std::pair("/SYSTEM/UPDATE/auto_update", 0x2800800)); - RegistryEntries.insert(std::pair("/SYSTEM/UPDATE/last_version", 0x2800900)); - RegistryEntries.insert(std::pair("/SYSTEM/UPDATE/last_updversion", 0x2800A00)); - RegistryEntries.insert(std::pair("/SYSTEM/UPDATE/build_number", 0x2804000)); - RegistryEntries.insert(std::pair("/SYSTEM/UPDATE/auto_update_int", 0x2808000)); - RegistryEntries.insert(std::pair("/SYSTEM/UPDATE/tool_update_chk", 0x2808100)); - RegistryEntries.insert(std::pair("/SYSTEM/UPDATE/server_url_beta", 0x2808200)); - RegistryEntries.insert(std::pair("/SYSTEM/UPDATE/check_limit", 0x2808300)); - RegistryEntries.insert(std::pair("/SYSTEM/UPDATE/ignore_entcheck", 0x2808400)); - RegistryEntries.insert(std::pair("/SYSTEM/UPDATE/strict_verchk", 0x2808500)); - RegistryEntries.insert(std::pair("/SYSTEM/POWER", 0x2820000)); - RegistryEntries.insert(std::pair("/SYSTEM/POWER/charge", 0x2820100)); - RegistryEntries.insert(std::pair("/SYSTEM/POWER/signin", 0x2820200)); - RegistryEntries.insert(std::pair("/SYSTEM/POWER/remote", 0x2820300)); - RegistryEntries.insert(std::pair("/SYSTEM/POWER/controller_off", 0x2820400)); - RegistryEntries.insert(std::pair("/SYSTEM/POWER/auto_off_media", 0x2820500)); - RegistryEntries.insert(std::pair("/SYSTEM/POWER/auto_off_other", 0x2820600)); - RegistryEntries.insert(std::pair("/SYSTEM/POWER/auto_power_down", 0x2820700)); - RegistryEntries.insert(std::pair("/SYSTEM/POWER/suspend_to_ram", 0x2820800)); - RegistryEntries.insert(std::pair("/SYSTEM/POWER/standby_start", 0x2820900)); - RegistryEntries.insert(std::pair("/SYSTEM/POWER/power_history", 0x2820B00)); - RegistryEntries.insert(std::pair("/SYSTEM/POWER/spwakeup", 0x2820C00)); - RegistryEntries.insert(std::pair("/SYSTEM/POWER/charge_minutes", 0x2828000)); - RegistryEntries.insert(std::pair("/SYSTEM/NOTIFICATION", 0x2840000)); - RegistryEntries.insert(std::pair("/SYSTEM/NOTIFICATION/invisible_items", 0x2840100)); - RegistryEntries.insert(std::pair("/SYSTEM/ACTIVATION", 0x2780000)); - RegistryEntries.insert(std::pair("/SYSTEM/ACTIVATION/mpeg2", 0x2780100)); - RegistryEntries.insert(std::pair("/SYSTEM/ACTIVATION/vc1", 0x2780200)); - RegistryEntries.insert(std::pair("/SYSTEM/ACTIVATION/hevc", 0x2780300)); - RegistryEntries.insert(std::pair("/SYSTEM/ACTIVATION/hevc_soft", 0x2780400)); - RegistryEntries.insert(std::pair("/SYSTEM/PLATFORMPRIVACY", 0x27C0000)); - RegistryEntries.insert(std::pair("/SYSTEM/PLATFORMPRIVACY/eu_ws1", 0x27C0100)); - RegistryEntries.insert(std::pair("/SYSTEM/SPECIFIC", 0x2860000)); - RegistryEntries.insert(std::pair("/SYSTEM/SPECIFIC/idu_mode", 0x2860100)); - RegistryEntries.insert(std::pair("/SYSTEM/SPECIFIC/show_mode", 0x2860200)); - RegistryEntries.insert(std::pair("/SYSTEM/SPECIFIC/arcade_mode", 0x2860300)); - RegistryEntries.insert(std::pair("/SYSTEM/SPECIFIC/arcade_id", 0x2860500)); - RegistryEntries.insert(std::pair("/SYSTEM/DOWNLOAD", 0x2880000)); - RegistryEntries.insert(std::pair("/SYSTEM/DOWNLOAD/autodl_featured", 0x2880100)); - RegistryEntries.insert(std::pair("/SYSTEM/DOWNLOAD/default_hdd", 0x2880200)); - RegistryEntries.insert(std::pair("/SYSTEM/DOWNLOAD/bgft_env_slot", 0x2888000)); - RegistryEntries.insert(std::pair("/SYSTEM/DOWNLOAD/bgft_debug_log", 0x2888100)); - RegistryEntries.insert(std::pair("/SYSTEM/DOWNLOAD/bgft_debug_ntf", 0x2888200)); - RegistryEntries.insert(std::pair("/SYSTEM/DOWNLOAD/bgft_debug_bwct", 0x2888300)); - RegistryEntries.insert(std::pair("/SYSTEM/DB", 0x2900000)); - RegistryEntries.insert(std::pair("/SYSTEM/DB/default_player", 0x2900100)); - RegistryEntries.insert(std::pair("/SYSTEM/DB/manifest_usb", 0x2908000)); - RegistryEntries.insert(std::pair("/SYSTEM/BGDC", 0x2A00000)); - RegistryEntries.insert(std::pair("/SYSTEM/BGDC/last_modified", 0x2A00100)); - RegistryEntries.insert(std::pair("/SYSTEM/BGDC/server_url", 0x2A08000)); - RegistryEntries.insert(std::pair("/SYSTEM/SELF", 0x2B00000)); - RegistryEntries.insert(std::pair("/SYSTEM/SELF/verr_count", 0x2B00100)); - RegistryEntries.insert(std::pair("/SYSTEM/SELF/ierr_count", 0x2B00200)); - RegistryEntries.insert(std::pair("/SYSTEM/WCTL", 0x2B40000)); - RegistryEntries.insert(std::pair("/SYSTEM/WCTL/server_env", 0x2B40100)); - RegistryEntries.insert(std::pair("/SYSTEM/AUTO/MOUNTER", 0x2B80000)); - RegistryEntries.insert(std::pair("/SYSTEM/AUTO/MOUNTER/previous_hdd_id", 0x2B80100)); - RegistryEntries.insert(std::pair("/SYSTEM/HDD/WRITE/STATS", 0x2BC0000)); - RegistryEntries.insert(std::pair("/SYSTEM/HDD/WRITE/STATS/last_report", 0x2BC0100)); - RegistryEntries.insert(std::pair("/SYSTEM/HDD/WRITE/STATS/process_time", 0x2BC0200)); - RegistryEntries.insert(std::pair("/SYSTEM/HDD/WRITE/STATS/real_time_dur", 0x2BC0300)); - RegistryEntries.insert(std::pair("/SYSTEM/HDD/WRITE/STATS/sys_int_hdd_r", 0x2BC0400)); - RegistryEntries.insert(std::pair("/SYSTEM/HDD/WRITE/STATS/sys_int_hdd_w", 0x2BC0500)); - RegistryEntries.insert(std::pair("/SYSTEM/HDD/WRITE/STATS/sys_ext_hdd_r", 0x2BC0600)); - RegistryEntries.insert(std::pair("/SYSTEM/HDD/WRITE/STATS/sys_ext_hdd_w", 0x2BC0700)); - RegistryEntries.insert(std::pair("/SYSTEM/HDD/WRITE/STATS/game_int_hdd_r", 0x2BC0800)); - RegistryEntries.insert(std::pair("/SYSTEM/HDD/WRITE/STATS/game_int_hdd_w", 0x2BC0900)); - RegistryEntries.insert(std::pair("/SYSTEM/HDD/WRITE/STATS/game_ext_hdd_r", 0x2BC0A00)); - RegistryEntries.insert(std::pair("/SYSTEM/HDD/WRITE/STATS/game_ext_hdd_w", 0x2BC0B00)); - RegistryEntries.insert(std::pair("/SYSTEM/SMR_HDD", 0x2BE0000)); - RegistryEntries.insert(std::pair("/SYSTEM/SMR_HDD/statechange_ntf", 0x2BE8000)); - RegistryEntries.insert(std::pair("/SECURITY/PARENTAL", 0x3800000)); - RegistryEntries.insert(std::pair("/SECURITY/PARENTAL/game", 0x3800100)); - RegistryEntries.insert(std::pair("/SECURITY/PARENTAL/bd", 0x3800200)); - RegistryEntries.insert(std::pair("/SECURITY/PARENTAL/bd_age", 0x3800300)); - RegistryEntries.insert(std::pair("/SECURITY/PARENTAL/dvd_region", 0x3800400)); - RegistryEntries.insert(std::pair("/SECURITY/PARENTAL/dvd", 0x3800500)); - RegistryEntries.insert(std::pair("/SECURITY/PARENTAL/browser", 0x3800600)); - RegistryEntries.insert(std::pair("/SECURITY/PARENTAL/create_account", 0x3800700)); - RegistryEntries.insert(std::pair("/SECURITY/PARENTAL/passcode", 0x3800800)); - RegistryEntries.insert(std::pair("/SECURITY/PARENTAL/morpheus", 0x3800900)); - RegistryEntries.insert(std::pair("/SECURITY/PARENTAL/papc_all_ok", 0x3800A00)); - RegistryEntries.insert(std::pair("/DATE", 0x5000000)); - RegistryEntries.insert(std::pair("/DATE/time_zone", 0x5010000)); - RegistryEntries.insert(std::pair("/DATE/date_format", 0x5020000)); - RegistryEntries.insert(std::pair("/DATE/time_format", 0x5030000)); - RegistryEntries.insert(std::pair("/DATE/summer_time", 0x5040000)); - RegistryEntries.insert(std::pair("/DATE/set_auto", 0x5050000)); - RegistryEntries.insert(std::pair("/DATE/is_summer_time", 0x5060000)); - RegistryEntries.insert(std::pair("/DATE/utc_offset", 0x5070000)); - RegistryEntries.insert(std::pair("/DATE/timezone_offset", 0x5080000)); - RegistryEntries.insert(std::pair("/DATE/tzdata_update", 0x5090000)); - RegistryEntries.insert(std::pair("/DATE/is_tz_adjusted", 0x50A0000)); - RegistryEntries.insert(std::pair("/DATE/rtc_offset", 0x5140000)); - RegistryEntries.insert(std::pair("/DATE/rtc_net", 0x5150000)); - RegistryEntries.insert(std::pair("/DATE/rtc_net_dbg", 0x5160000)); - RegistryEntries.insert(std::pair("/DATE/rtc_net_ad", 0x5170000)); - RegistryEntries.insert(std::pair("/DATE/fake_geoip", 0x5800000)); - RegistryEntries.insert(std::pair("/DATE/use_test_cdn", 0x5810000)); - RegistryEntries.insert(std::pair("/DATE/testserver_slot", 0x5820000)); - RegistryEntries.insert(std::pair("/USER", 0x7000000)); - RegistryEntries.insert(std::pair("/USER/auto_login_user", 0x7010000)); - RegistryEntries.insert(std::pair("/USER/max_used_home_u", 0x7020000)); - RegistryEntries.insert(std::pair("/USER/init_user", 0x7030000)); - RegistryEntries.insert(std::pair("/USER/enable_facercg", 0x7040000)); - RegistryEntries.insert(std::pair("/USER/max_used_guest_", 0x7050000)); - RegistryEntries.insert(std::pair("/USER/max_used_sharep", 0x7060000)); - RegistryEntries.insert(std::pair("/USER/cumulative_user", 0x7070000)); - RegistryEntries.insert(std::pair("/USER/disp_acc_info", 0x7400000)); - RegistryEntries.insert(std::pair("/USER/new_user_group", 0x7410000)); - RegistryEntries.insert(std::pair("/ACCESSIBILITY", 0x9000000)); - RegistryEntries.insert(std::pair("/ACCESSIBILITY/invert_color", 0x9010000)); - RegistryEntries.insert(std::pair("/ACCESSIBILITY/large_text", 0x9020000)); - RegistryEntries.insert(std::pair("/ACCESSIBILITY/bold_text", 0x9030000)); - RegistryEntries.insert(std::pair("/ACCESSIBILITY/contrast", 0x9040000)); - RegistryEntries.insert(std::pair("/ACCESSIBILITY/shortcut", 0x9050000)); - RegistryEntries.insert(std::pair("/ACCESSIBILITY/marquee_speed", 0x9060000)); - RegistryEntries.insert(std::pair("/ACCESSIBILITY/long_press_time", 0x9070000)); - RegistryEntries.insert(std::pair("/ACCESSIBILITY/TTS", 0x9400000)); - RegistryEntries.insert(std::pair("/ACCESSIBILITY/TTS/enable", 0x9400100)); - RegistryEntries.insert(std::pair("/ACCESSIBILITY/TTS/speed", 0x9400200)); - RegistryEntries.insert(std::pair("/ACCESSIBILITY/TTS/volume", 0x9400300)); - RegistryEntries.insert(std::pair("/ACCESSIBILITY/TTS/readout", 0x9400400)); - RegistryEntries.insert(std::pair("/ACCESSIBILITY/DEBUG", 0x9C00000)); - RegistryEntries.insert(std::pair("/ACCESSIBILITY/DEBUG/text_to_speech", 0x9C00100)); - RegistryEntries.insert(std::pair("/ACCESSIBILITY/DEBUG/large_text", 0x9C00200)); - RegistryEntries.insert(std::pair("/ACCESSIBILITY/DEBUG/bold_text", 0x9C00300)); - RegistryEntries.insert(std::pair("/ACCESSIBILITY/DEBUG/speech_tag", 0x9C04000)); - RegistryEntries.insert(std::pair("/ACCESSIBILITY/DEBUG/use_ext_tts_dic", 0x9C04100)); - RegistryEntries.insert(std::pair("/ACCESSIBILITY/DEBUG/tts_debug_log", 0x9C04200)); - RegistryEntries.insert(std::pair("/VIDEOOUT", 0xA000000)); - RegistryEntries.insert(std::pair("/VIDEOOUT/mode", 0xA030000)); - RegistryEntries.insert(std::pair("/VIDEOOUT/color_depth", 0xA040000)); - RegistryEntries.insert(std::pair("/VIDEOOUT/signal_range", 0xA060000)); - RegistryEntries.insert(std::pair("/VIDEOOUT/screen_size", 0xA070000)); - RegistryEntries.insert(std::pair("/VIDEOOUT/enable_cec", 0xA080000)); - RegistryEntries.insert(std::pair("/VIDEOOUT/yuv_range", 0xA0A0000)); - RegistryEntries.insert(std::pair("/VIDEOOUT/display_area", 0xA0D0000)); - RegistryEntries.insert(std::pair("/VIDEOOUT/hdmi_history", 0xA0F0000)); - RegistryEntries.insert(std::pair("/VIDEOOUT/screen_size_uns", 0xA100000)); - RegistryEntries.insert(std::pair("/VIDEOOUT/hdcp_off_mode", 0xA110000)); - RegistryEntries.insert(std::pair("/VIDEOOUT/setting_options", 0xA120000)); - RegistryEntries.insert(std::pair("/VIDEOOUT/reset_reso_flag", 0xA130000)); - RegistryEntries.insert(std::pair("/VIDEOOUT/hdcp_version", 0xA140000)); - RegistryEntries.insert(std::pair("/VIDEOOUT/hdr", 0xA150000)); - RegistryEntries.insert(std::pair("/VIDEOOUT/hdr_confirmed", 0xA160000)); - RegistryEntries.insert(std::pair("/VIDEOOUT/disable_hdcp", 0xA320000)); - RegistryEntries.insert(std::pair("/VIDEOOUT/force_hdr_cap", 0xA330000)); - RegistryEntries.insert(std::pair("/AUDIOOUT", 0xB000000)); - RegistryEntries.insert(std::pair("/AUDIOOUT/mode", 0xB010000)); - RegistryEntries.insert(std::pair("/AUDIOOUT/headphone_out", 0xB030000)); - RegistryEntries.insert(std::pair("/AUDIOOUT/keytone", 0xB040000)); - RegistryEntries.insert(std::pair("/AUDIOOUT/system_bgm", 0xB050000)); - RegistryEntries.insert(std::pair("/AUDIOOUT/connector_type", 0xB060000)); - RegistryEntries.insert(std::pair("/AUDIOOUT/codec", 0xB070000)); - RegistryEntries.insert(std::pair("/AUDIOOUT/sound_format", 0xB080000)); - RegistryEntries.insert(std::pair("/AUDIOOUT/config_options", 0xB090000)); - RegistryEntries.insert(std::pair("/AUDIOOUT/measure_enable", 0xB800000)); - RegistryEntries.insert(std::pair("/AUDIOOUT/run_options", 0xB810000)); - RegistryEntries.insert(std::pair("/NET/IP", 0x14140000)); - RegistryEntries.insert(std::pair("/NET/IP/ip_address", 0x14140100)); - RegistryEntries.insert(std::pair("/NET/IP/netmask", 0x14140200)); - RegistryEntries.insert(std::pair("/NET/IP/default_route", 0x14140300)); - RegistryEntries.insert(std::pair("/NET/IP/dns_flag", 0x14140400)); - RegistryEntries.insert(std::pair("/NET/IP/primary_dns", 0x14140500)); - RegistryEntries.insert(std::pair("/NET/IP/secondary_dns", 0x14140600)); - RegistryEntries.insert(std::pair("/NET/IP/ip_config", 0x14140700)); - RegistryEntries.insert(std::pair("/NET/IP/dhcp_hostname", 0x14140800)); - RegistryEntries.insert(std::pair("/NET/IP/auth_name", 0x14140C00)); - RegistryEntries.insert(std::pair("/NET/IP/auth_key", 0x14140D00)); - RegistryEntries.insert(std::pair("/NET/IP/leased_ip", 0x14140E00)); - RegistryEntries.insert(std::pair("/NET/IP/leased_exp_tick", 0x14140F00)); - RegistryEntries.insert(std::pair("/NET/COMMON", 0x14190000)); - RegistryEntries.insert(std::pair("/NET/COMMON/device", 0x14190100)); - RegistryEntries.insert(std::pair("/NET/COMMON/net_flag", 0x14190600)); - RegistryEntries.insert(std::pair("/NET/COMMON/conf_type", 0x14190700)); - RegistryEntries.insert(std::pair("/NET/COMMON/mtu", 0x14190800)); - RegistryEntries.insert(std::pair("/NET/COMMON/ether_mode", 0x14190900)); - RegistryEntries.insert(std::pair("/NET/COMMON/ap_auto_config", 0x14190A00)); - RegistryEntries.insert(std::pair("/NET/WIFI", 0x141E0000)); - RegistryEntries.insert(std::pair("/NET/WIFI/ssid", 0x141E0100)); - RegistryEntries.insert(std::pair("/NET/WIFI/wifi_security", 0x141E0200)); - RegistryEntries.insert(std::pair("/NET/WIFI/wep_key", 0x141E0300)); - RegistryEntries.insert(std::pair("/NET/WIFI/wpa_key", 0x141E0400)); - RegistryEntries.insert(std::pair("/NET/WIFI/freq_band", 0x141E0500)); - RegistryEntries.insert(std::pair("/NET/WIFI/COMMON", 0x141E4000)); - RegistryEntries.insert(std::pair("/NET/WIFI/COMMON/mtu", 0x141E4001)); - RegistryEntries.insert(std::pair("/NET/WIFI/IP", 0x141E6000)); - RegistryEntries.insert(std::pair("/NET/WIFI/IP/ip_config", 0x141E6001)); - RegistryEntries.insert(std::pair("/NET/WIFI/IP/dhcp_hostname", 0x141E6002)); - RegistryEntries.insert(std::pair("/NET/WIFI/IP/auth_name", 0x141E6003)); - RegistryEntries.insert(std::pair("/NET/WIFI/IP/auth_key", 0x141E6004)); - RegistryEntries.insert(std::pair("/NET/WIFI/IP/ip_address", 0x141E6005)); - RegistryEntries.insert(std::pair("/NET/WIFI/IP/netmask", 0x141E6006)); - RegistryEntries.insert(std::pair("/NET/WIFI/IP/default_route", 0x141E6007)); - RegistryEntries.insert(std::pair("/NET/WIFI/IP/dns_flag", 0x141E6008)); - RegistryEntries.insert(std::pair("/NET/WIFI/IP/primary_dns", 0x141E6009)); - RegistryEntries.insert(std::pair("/NET/WIFI/IP/secondary_dns", 0x141E600A)); - RegistryEntries.insert(std::pair("/NET/WIFI/IP/leased_ip", 0x141E600B)); - RegistryEntries.insert(std::pair("/NET/WIFI/IP/leased_exp_tick", 0x141E600C)); - RegistryEntries.insert(std::pair("/NET/WIFI/APP", 0x141E8000)); - RegistryEntries.insert(std::pair("/NET/WIFI/APP/http_proxy_flag", 0x141E8001)); - RegistryEntries.insert(std::pair("/NET/WIFI/APP/http_proxy_svr", 0x141E8002)); - RegistryEntries.insert(std::pair("/NET/WIFI/APP/http_proxy_port", 0x141E8003)); - RegistryEntries.insert(std::pair("/NET/AOSS", 0x14230000)); - RegistryEntries.insert(std::pair("/NET/AOSS/wpa_aes_ssid", 0x14230100)); - RegistryEntries.insert(std::pair("/NET/AOSS/wpa_tkip_ssid", 0x14230200)); - RegistryEntries.insert(std::pair("/NET/AOSS/wep128_ssid", 0x14230300)); - RegistryEntries.insert(std::pair("/NET/AOSS/wep64_ssid", 0x14230400)); - RegistryEntries.insert(std::pair("/NET/AOSS/wpa_aes_key", 0x14230500)); - RegistryEntries.insert(std::pair("/NET/AOSS/wpa_tkip_key", 0x14230600)); - RegistryEntries.insert(std::pair("/NET/AOSS/wep128_key", 0x14230700)); - RegistryEntries.insert(std::pair("/NET/AOSS/wep64_key", 0x14230800)); - RegistryEntries.insert(std::pair("/NET/AOSS/5G", 0x14234000)); - RegistryEntries.insert(std::pair("/NET/AOSS/5G/wep64_ssid", 0x14234001)); - RegistryEntries.insert(std::pair("/NET/AOSS/5G/wep64_key", 0x14234002)); - RegistryEntries.insert(std::pair("/NET/AOSS/5G/wep128_ssid", 0x14234003)); - RegistryEntries.insert(std::pair("/NET/AOSS/5G/wep128_key", 0x14234004)); - RegistryEntries.insert(std::pair("/NET/AOSS/5G/wpa_tkip_ssid", 0x14234005)); - RegistryEntries.insert(std::pair("/NET/AOSS/5G/wpa_tkip_key", 0x14234006)); - RegistryEntries.insert(std::pair("/NET/AOSS/5G/wpa_aes_ssid", 0x14234007)); - RegistryEntries.insert(std::pair("/NET/AOSS/5G/wpa_aes_key", 0x14234008)); - RegistryEntries.insert(std::pair("/NET/APP", 0x14280000)); - RegistryEntries.insert(std::pair("/NET/APP/http_proxy_flag", 0x14280100)); - RegistryEntries.insert(std::pair("/NET/APP/http_proxy_svr", 0x14280200)); - RegistryEntries.insert(std::pair("/NET/APP/http_proxy_port", 0x14280300)); - RegistryEntries.insert(std::pair("/NET/APP/ssl_cert_ignore", 0x14288000)); - RegistryEntries.insert(std::pair("/NET/APP/ssl_psn_trace", 0x14288100)); - RegistryEntries.insert(std::pair("/NET/AP", 0x142D0000)); - RegistryEntries.insert(std::pair("/NET/AP/ap_flag", 0x142D0100)); - RegistryEntries.insert(std::pair("/NET/AP/ssid", 0x142D0200)); - RegistryEntries.insert(std::pair("/NET/AP/wpa_key", 0x142D0300)); - RegistryEntries.insert(std::pair("/NET/AP/channel", 0x142D0400)); - RegistryEntries.insert(std::pair("/NET/GAME_AP", 0x142E0000)); - RegistryEntries.insert(std::pair("/NET/GAME_AP/wpa_key", 0x142E0100)); - RegistryEntries.insert(std::pair("/NET/GAME_AP/wpa_key_for_qa", 0x142E0200)); - RegistryEntries.insert(std::pair("/NET", 0x14000000)); - RegistryEntries.insert(std::pair("/NET/dbg_ip_address", 0x14700000)); - RegistryEntries.insert(std::pair("/NET/dbg_netmask", 0x14710000)); - RegistryEntries.insert(std::pair("/NET/dbg_route", 0x14740000)); - RegistryEntries.insert(std::pair("/NET/dbg_route_mask", 0x14750000)); - RegistryEntries.insert(std::pair("/NET/dbg_gateway", 0x14760000)); - RegistryEntries.insert(std::pair("/NET/dbg_ip_config", 0x14770000)); - RegistryEntries.insert(std::pair("/NET/dbg_dhcp_hname", 0x14780000)); - RegistryEntries.insert(std::pair("/NET/emulation_type", 0x14790000)); - RegistryEntries.insert(std::pair("/NET/always_lan", 0x147A0000)); - RegistryEntries.insert(std::pair("/NP", 0x19000000)); - RegistryEntries.insert(std::pair("/NP/patch_auto_dl", 0x19010000)); - RegistryEntries.insert(std::pair("/NP/cache_pssdc", 0x19020000)); - RegistryEntries.insert(std::pair("/NP/env", 0x19800000)); - RegistryEntries.insert(std::pair("/NP/debug", 0x19810000)); - RegistryEntries.insert(std::pair("/NP/test_patch", 0x19820000)); - RegistryEntries.insert(std::pair("/NP/tpps_proxy_flag", 0x19830000)); - RegistryEntries.insert(std::pair("/NP/tpps_proxy_svr", 0x19840000)); - RegistryEntries.insert(std::pair("/NP/tpps_proxy_port", 0x19850000)); - RegistryEntries.insert(std::pair("/NP/tpps_proxy_user", 0x19860000)); - RegistryEntries.insert(std::pair("/NP/tpps_proxy_pwd", 0x19870000)); - RegistryEntries.insert(std::pair("/NP/dbg_upgradable", 0x19880000)); - RegistryEntries.insert(std::pair("/NP/fake_plus", 0x19890000)); - RegistryEntries.insert(std::pair("/NP/dbg_commerce", 0x198A0000)); - RegistryEntries.insert(std::pair("/NP/quick_signup_pw", 0x198B0000)); - RegistryEntries.insert(std::pair("/NP/geo_filtering", 0x198C0000)); - RegistryEntries.insert(std::pair("/NP/trophy_debug", 0x198D0000)); - RegistryEntries.insert(std::pair("/NP/ignore_fakerif", 0x198E0000)); - RegistryEntries.insert(std::pair("/NP/patch_check", 0x198F0000)); - RegistryEntries.insert(std::pair("/NP/dbg_videosrv", 0x19900000)); - RegistryEntries.insert(std::pair("/NP/sf_debug", 0x19910000)); - RegistryEntries.insert(std::pair("/NP/fake_ratelimit", 0x19930000)); - RegistryEntries.insert(std::pair("/NP/ignore_titleid", 0x19940000)); - RegistryEntries.insert(std::pair("/NP/npdrm_debug_log", 0x19950000)); - RegistryEntries.insert(std::pair("/NP/npdrm_debug_ntf", 0x19960000)); - RegistryEntries.insert(std::pair("/NP/sslchk_secure", 0x19970000)); - RegistryEntries.insert(std::pair("/NP/sslchk_liveitem", 0x19980000)); - RegistryEntries.insert(std::pair("/NP/plus_recheck", 0x19990000)); - RegistryEntries.insert(std::pair("/NP/regicam_url", 0x199A0000)); - RegistryEntries.insert(std::pair("/NP/manifest_url", 0x199B0000)); - RegistryEntries.insert(std::pair("/NP/per_act_sync", 0x199C0000)); - RegistryEntries.insert(std::pair("/NP/geo_location", 0x199D0000)); - RegistryEntries.insert(std::pair("/NP/ev_fake_clock", 0x199E0000)); - RegistryEntries.insert(std::pair("/NP/dailymotion_lng", 0x199F0000)); - RegistryEntries.insert(std::pair("/NP/diskcache_quota", 0x19A00000)); - RegistryEntries.insert(std::pair("/NP/fake_dispname", 0x19A10000)); - RegistryEntries.insert(std::pair("/NP/deathstar_url", 0x19A30000)); - RegistryEntries.insert(std::pair("/NP/ds_family_url", 0x19A40000)); - RegistryEntries.insert(std::pair("/NP/fake_version", 0x19A50000)); - RegistryEntries.insert(std::pair("/CAMERA", 0x1E000000)); - RegistryEntries.insert(std::pair("/CAMERA/camera_hw_info", 0x1E010000)); - RegistryEntries.insert(std::pair("/CAMERA/mute_mic", 0x1E020000)); - RegistryEntries.insert(std::pair("/VRTRACKER", 0x20000000)); - RegistryEntries.insert(std::pair("/VRTRACKER/vrtracker_info", 0x20010000)); - RegistryEntries.insert(std::pair("/VRTRACKER/telemetry", 0x20400000)); - RegistryEntries.insert(std::pair("/VRTRACKER/vision_mgr_if", 0x20410000)); - RegistryEntries.insert(std::pair("/VRTRACKER/green_ds4_track", 0x20800000)); - RegistryEntries.insert(std::pair("/BDDVD", 0x23000000)); - RegistryEntries.insert(std::pair("/BDDVD/bd_menu_lang", 0x23010000)); - RegistryEntries.insert(std::pair("/BDDVD/bd_sound_lang", 0x23020000)); - RegistryEntries.insert(std::pair("/BDDVD/bd_cap_lang", 0x23030000)); - RegistryEntries.insert(std::pair("/BDDVD/nr", 0x23040000)); - RegistryEntries.insert(std::pair("/BDDVD/display_mode", 0x23050000)); - RegistryEntries.insert(std::pair("/BDDVD/hd50hz_output", 0x23060000)); - RegistryEntries.insert(std::pair("/BDDVD/drc", 0x23070000)); - RegistryEntries.insert(std::pair("/BDDVD/bd_audio_mix", 0x23080000)); - RegistryEntries.insert(std::pair("/BDDVD/network_connect", 0x23090000)); - RegistryEntries.insert(std::pair("/BDDVD/dvd_menu_lang", 0x230A0000)); - RegistryEntries.insert(std::pair("/BDDVD/dvd_sound_lang", 0x230B0000)); - RegistryEntries.insert(std::pair("/BDDVD/dvd_cap_lang", 0x230C0000)); - RegistryEntries.insert(std::pair("/BDDVD/sound_format", 0x230D0000)); - RegistryEntries.insert(std::pair("/BDDVD/s3d_on_hmd", 0x230E0000)); - RegistryEntries.insert(std::pair("/BDDVD/flag", 0x230F0000)); - RegistryEntries.insert(std::pair("/EVENT", 0x2A000000)); - RegistryEntries.insert(std::pair("/EVENT/auto_boot_tick", 0x2A010000)); - RegistryEntries.insert(std::pair("/GLS", 0x32000000)); - RegistryEntries.insert(std::pair("/GLS/bc_mode", 0x32010000)); - RegistryEntries.insert(std::pair("/GLS/social_mode", 0x32020000)); - RegistryEntries.insert(std::pair("/GLS/broadcast_url", 0x32030000)); - RegistryEntries.insert(std::pair("/GLS/rpin", 0x320C0000)); - RegistryEntries.insert(std::pair("/GLS/irc_url", 0x32810000)); - RegistryEntries.insert(std::pair("/GLS/irc_channel", 0x32820000)); - RegistryEntries.insert(std::pair("/GLS/irc_user", 0x32830000)); - RegistryEntries.insert(std::pair("/GLS/irc_passwd", 0x32840000)); - RegistryEntries.insert(std::pair("/GLS/sf_latency", 0x32850000)); - RegistryEntries.insert(std::pair("/GLS/debug_info_url", 0x32870000)); - RegistryEntries.insert(std::pair("/GLS/emb_svr_ur", 0x32880000)); - RegistryEntries.insert(std::pair("/GLS/live_quality_d", 0x32890000)); - RegistryEntries.insert(std::pair("/SHARE", 0x37000000)); - RegistryEntries.insert(std::pair("/SHARE/sound_mix", 0x37050000)); - RegistryEntries.insert(std::pair("/SHARE/rec_prohibit", 0x37060000)); - RegistryEntries.insert(std::pair("/SHARE/ctr_share_test", 0x37070000)); - RegistryEntries.insert(std::pair("/SHARE/cpy_share_item", 0x37080000)); - RegistryEntries.insert(std::pair("/SHARE/rec_time", 0x37090000)); - RegistryEntries.insert(std::pair("/SHARE/status", 0x370A0000)); - RegistryEntries.insert(std::pair("/SHARE/ctr_share_range", 0x37800000)); - RegistryEntries.insert(std::pair("/SHARE/title_check", 0x37810000)); - RegistryEntries.insert(std::pair("/SHARE/ctr_share_save", 0x37820000)); - RegistryEntries.insert(std::pair("/SHAREFACTORY", 0x39000000)); - RegistryEntries.insert(std::pair("/SHAREFACTORY/direct_boot_id", 0x39010000)); - RegistryEntries.insert(std::pair("/BROWSER", 0x3C000000)); - RegistryEntries.insert(std::pair("/BROWSER/enable_cookie", 0x3C020000)); - RegistryEntries.insert(std::pair("/BROWSER/enable_js", 0x3C030000)); - RegistryEntries.insert(std::pair("/BROWSER/check_signup", 0x3C040000)); - RegistryEntries.insert(std::pair("/BROWSER/DEBUG", 0x3CC80000)); - RegistryEntries.insert(std::pair("/BROWSER/DEBUG/calist_loadmode", 0x3CC80100)); - RegistryEntries.insert(std::pair("/BROWSER/DEBUG/verify_ssl", 0x3CC80200)); - RegistryEntries.insert(std::pair("/BROWSER/DEBUG/dfg_jit_enabled", 0x3CC80300)); - RegistryEntries.insert(std::pair("/BROWSER/DEBUG/net_dbg_config", 0x3CC80400)); - RegistryEntries.insert(std::pair("/BROWSER/DEBUG/check_iframe", 0x3CC80500)); - RegistryEntries.insert(std::pair("/BROWSER/DEBUG/enable_jslog", 0x3CC80600)); - RegistryEntries.insert(std::pair("/BROWSER/DEBUG/notification", 0x3CC80700)); - RegistryEntries.insert(std::pair("/REMOTEPLAY", 0x41000000)); - RegistryEntries.insert(std::pair("/REMOTEPLAY/rp_enable", 0x41810000)); - RegistryEntries.insert(std::pair("/REMOTEPLAY/ap_flag", 0x41820000)); - RegistryEntries.insert(std::pair("/REMOTEPLAY/log_enable", 0x41C00000)); - RegistryEntries.insert(std::pair("/SHAREPLAY", 0x44000000)); - RegistryEntries.insert(std::pair("/SHAREPLAY/mode", 0x44800000)); - RegistryEntries.insert(std::pair("/SHAREPLAY/ip_direct", 0x44810000)); - RegistryEntries.insert(std::pair("/SHAREPLAY/resolution", 0x44820000)); - RegistryEntries.insert(std::pair("/SHAREPLAY/bitrate", 0x44830000)); - RegistryEntries.insert(std::pair("/SHAREPLAY/framerate", 0x44840000)); - RegistryEntries.insert(std::pair("/SHAREPLAY/quality_graph", 0x44850000)); - RegistryEntries.insert(std::pair("/SHAREPLAY/ephemeral_port", 0x44860000)); - RegistryEntries.insert(std::pair("/SHAREPLAY/pcl_check", 0x44870000)); - RegistryEntries.insert(std::pair("/SHAREPLAY/store_check", 0x44880000)); - RegistryEntries.insert(std::pair("/SHAREPLAY/age_check", 0x44890000)); - RegistryEntries.insert(std::pair("/SHAREPLAY/gav_check", 0x448A0000)); - RegistryEntries.insert(std::pair("/SHAREPLAY/fake_time_limit", 0x448B0000)); - RegistryEntries.insert(std::pair("/PARTY", 0x45000000)); - RegistryEntries.insert(std::pair("/PARTY/volume_down", 0x45010000)); - RegistryEntries.insert(std::pair("/PARTY/voice_priority", 0x45020000)); - RegistryEntries.insert(std::pair("/PARTY/upstream_bandw", 0x45030000)); - RegistryEntries.insert(std::pair("/PLAYTOGETHER", 0x55000000)); - RegistryEntries.insert(std::pair("/PLAYTOGETHER/game_played", 0x55010000)); - RegistryEntries.insert(std::pair("/SYSCORE", 0x5A000000)); - RegistryEntries.insert(std::pair("/SYSCORE/shell_watch_dog", 0x5A020000)); - RegistryEntries.insert(std::pair("/COMPANION", 0x64000000)); - RegistryEntries.insert(std::pair("/COMPANION/dbg_launch_mode", 0x64010000)); - RegistryEntries.insert(std::pair("/COMPANION/dbg_ip_chk_flg", 0x64020000)); - RegistryEntries.insert(std::pair("/COMPANION/user_bind_mode", 0x64030000)); - RegistryEntries.insert(std::pair("/MUSIC/MUSIC/APP", 0x46010000)); - RegistryEntries.insert(std::pair("/MUSIC/MUSIC/APP/repeat_mode", 0x46010100)); - RegistryEntries.insert(std::pair("/MUSIC/MUSIC/APP/shuffle_mode", 0x46010200)); - RegistryEntries.insert(std::pair("/MUSIC/MUSIC/APP/audio_balance", 0x46010300)); - RegistryEntries.insert(std::pair("/VIDEOPLAYER", 0x49000000)); - RegistryEntries.insert(std::pair("/VIDEOPLAYER/1080_24p", 0x49010000)); - RegistryEntries.insert(std::pair("/VIDEOPLAYER/CC", 0x49020000)); - RegistryEntries.insert(std::pair("/VIDEOPLAYER/CC/enable_cc", 0x49020100)); - RegistryEntries.insert(std::pair("/VIDEOPLAYER/CC/content_specifi", 0x49020200)); - RegistryEntries.insert(std::pair("/VIDEOPLAYER/CC/char_color", 0x49020300)); - RegistryEntries.insert(std::pair("/VIDEOPLAYER/CC/char_opacity", 0x49020400)); - RegistryEntries.insert(std::pair("/VIDEOPLAYER/CC/char_size", 0x49020500)); - RegistryEntries.insert(std::pair("/VIDEOPLAYER/CC/font_type", 0x49020600)); - RegistryEntries.insert(std::pair("/VIDEOPLAYER/CC/char_edge", 0x49020700)); - RegistryEntries.insert(std::pair("/VIDEOPLAYER/CC/char_edge_color", 0x49020800)); - RegistryEntries.insert(std::pair("/VIDEOPLAYER/CC/char_bg_color", 0x49020900)); - RegistryEntries.insert(std::pair("/VIDEOPLAYER/CC/char_bg_opacity", 0x49020A00)); - RegistryEntries.insert(std::pair("/VIDEOPLAYER/CC/window_color", 0x49020B00)); - RegistryEntries.insert(std::pair("/VIDEOPLAYER/CC/window_opacity", 0x49020C00)); - RegistryEntries.insert(std::pair("/VIDEOEDIT", 0x4B000000)); - RegistryEntries.insert(std::pair("/VIDEOEDIT/first_time_act", 0x4B010000)); - RegistryEntries.insert(std::pair("/MUSICUNLIMITED", 0x4E000000)); - RegistryEntries.insert(std::pair("/MUSICUNLIMITED/debug_url", 0x4E800000)); - RegistryEntries.insert(std::pair("/PRJSP", 0x4F000000)); - RegistryEntries.insert(std::pair("/PRJSP/app_installed", 0x4F010000)); - RegistryEntries.insert(std::pair("/PRJSP/enable_zeroconf", 0x4F800000)); - RegistryEntries.insert(std::pair("/PLAYGO", 0x50000000)); - RegistryEntries.insert(std::pair("/PLAYGO/content_id", 0x50010000)); - RegistryEntries.insert(std::pair("/PLAYGO/package_url", 0x50020000)); - RegistryEntries.insert(std::pair("/PLAYGO/scenario_id", 0x50030000)); - RegistryEntries.insert(std::pair("/PLAYGO/dl_content_id", 0x50040000)); - RegistryEntries.insert(std::pair("/PLAYGO/auto_download", 0x50050000)); - RegistryEntries.insert(std::pair("/PLAYGO/json_url", 0x50060000)); - RegistryEntries.insert(std::pair("/PLAYGO/package_ex_url", 0x50070000)); - RegistryEntries.insert(std::pair("/MORPHEUS/VR2D", 0x50400000)); - RegistryEntries.insert(std::pair("/MORPHEUS/VR2D/gyro_bias", 0x50400100)); - RegistryEntries.insert(std::pair("/MORPHEUS/UPDATE", 0x58600000)); - RegistryEntries.insert(std::pair("/MORPHEUS/UPDATE/server_url", 0x58600100)); - RegistryEntries.insert(std::pair("/MORPHEUS/UPDATE/enable_upd_chk", 0x58600200)); - RegistryEntries.insert(std::pair("/MORPHEUS/DEBUG", 0x58800000)); - RegistryEntries.insert(std::pair("/MORPHEUS/DEBUG/demo_mode", 0x58800100)); - RegistryEntries.insert(std::pair("/MORPHEUS/DEBUG/debug_mode", 0x58800200)); - RegistryEntries.insert(std::pair("/MORPHEUS/DEBUG/social_screen", 0x58800300)); - RegistryEntries.insert(std::pair("/MORPHEUS/DEBUG/debug_text", 0x58800400)); - RegistryEntries.insert(std::pair("/MORPHEUS/DEBUG/ex_mode_chat", 0x58800500)); - RegistryEntries.insert(std::pair("/MORPHEUS/DEBUG/show_tutorials", 0x58800600)); - RegistryEntries.insert(std::pair("/MORPHEUS/DEBUG/hmu_auto_detect", 0x58800700)); - RegistryEntries.insert(std::pair("/MORPHEUS/DEBUG/show_safe_area", 0x58800800)); - RegistryEntries.insert(std::pair("/MORPHEUS/DEBUG/play_area_warn", 0x58800900)); - RegistryEntries.insert(std::pair("/MORPHEUS/DEBUG/ignore_separate", 0x58800A00)); - RegistryEntries.insert(std::pair("/MORPHEUS/DEBUG/dbg_launch_mode", 0x58800B00)); - RegistryEntries.insert(std::pair("/MORPHEUS/DEBUG/vr_capture", 0x58800C00)); - RegistryEntries.insert(std::pair("/COREDUMP", 0x6E000000)); - RegistryEntries.insert(std::pair("/COREDUMP/dump_mode", 0x6E010000)); - RegistryEntries.insert(std::pair("/COREDUMP/internal_mode", 0x6E020000)); - RegistryEntries.insert(std::pair("/COREDUMP/always_enc_dump", 0x6E030000)); - RegistryEntries.insert(std::pair("/COREDUMP/dump_level", 0x6E040000)); - RegistryEntries.insert(std::pair("/COREDUMP/video_duration", 0x6E060000)); - RegistryEntries.insert(std::pair("/COREDUMP/video_bitrate", 0x6E070000)); - RegistryEntries.insert(std::pair("/COREDUMP/sys_dump_level", 0x6E080000)); - RegistryEntries.insert(std::pair("/COREDUMP/gpudump", 0x6E090000)); - RegistryEntries.insert(std::pair("/COREDUMP/screenshot", 0x6E0A0000)); - RegistryEntries.insert(std::pair("/COREDUMP/UPLOADER", 0x6E800000)); - RegistryEntries.insert(std::pair("/COREDUMP/UPLOADER/enable_uploader", 0x6E800100)); - RegistryEntries.insert(std::pair("/COREDUMP/UPLOADER/uploader_url", 0x6E800200)); - RegistryEntries.insert(std::pair("/COREDUMP/UPLOADER/auto_upload", 0x6E800300)); - RegistryEntries.insert(std::pair("/CRASHREPORTING", 0x70000000)); - RegistryEntries.insert(std::pair("/CRASHREPORTING/enable_report", 0x70010000)); - RegistryEntries.insert(std::pair("/CRASHREPORTING/keep_corefiles", 0x70020000)); - RegistryEntries.insert(std::pair("/CRASHREPORTING/autosending", 0x70030000)); - RegistryEntries.insert(std::pair("/CRASHREPORTING/operatestatus", 0x70040000)); - RegistryEntries.insert(std::pair("/CRASHREPORTING/attachvideoclip", 0x70050000)); - RegistryEntries.insert(std::pair("/CRASHREPORTING/qa_auto_send", 0x70060000)); - RegistryEntries.insert(std::pair("/CRASHREPORTING/fake_optload", 0x70070000)); - RegistryEntries.insert(std::pair("/CRASHREPORTING/fake_cfss", 0x70080000)); - RegistryEntries.insert(std::pair("/CRASHREPORTING/set_task_title", 0x700A0000)); - RegistryEntries.insert(std::pair("/SYSTEMLOGGER/PLATFORMPRIVACY", 0x73010000)); - RegistryEntries.insert(std::pair("/SYSTEMLOGGER/PLATFORMPRIVACY/last_mod_bi", 0x73010100)); - RegistryEntries.insert(std::pair("/SYSTEMLOGGER/PLATFORMPRIVACY/last_mod_tel", 0x73010200)); - RegistryEntries.insert(std::pair("/SYSTEMLOGGER/PLATFORMPRIVACY/last_mod_kmg", 0x73010300)); - RegistryEntries.insert(std::pair("/SYSTEMLOGGER/PLATFORMPRIVACY/last_cfm_bi", 0x73010400)); - RegistryEntries.insert(std::pair("/SYSTEMLOGGER/PLATFORMPRIVACY/last_cfm_tel", 0x73010500)); - RegistryEntries.insert(std::pair("/SYSTEMLOGGER/PLATFORMPRIVACY/last_cfm_kmg", 0x73010600)); - RegistryEntries.insert(std::pair("/SYSTEMLOGGER/DEBUG", 0x73800000)); - RegistryEntries.insert(std::pair("/SYSTEMLOGGER/DEBUG/config_dir", 0x73800100)); - RegistryEntries.insert(std::pair("/SYSTEMLOGGER/DEBUG/user_time", 0x73800200)); - RegistryEntries.insert(std::pair("/SYSTEMLOGGER/DEBUG/click_through", 0x73800300)); - RegistryEntries.insert(std::pair("/SYSTEMLOGGER/DEBUG/dummy_aws", 0x73800400)); - RegistryEntries.insert(std::pair("/SYSTEMLOGGER/DEBUG/debug_message", 0x73800500)); - RegistryEntries.insert(std::pair("/SYSTEMLOGGER/DEBUG/config_dir2", 0x73800600)); - RegistryEntries.insert(std::pair("/SYSTEMLOGGER/DEBUG/config_dir3", 0x73800800)); - RegistryEntries.insert(std::pair("/SYSTEMLOGGER/DEBUG/delivery_mode", 0x73800900)); - RegistryEntries.insert(std::pair("/SYSTEMLOGGER/DEBUG/delivery_url", 0x73800A00)); - RegistryEntries.insert(std::pair("/SYSTEMLOGGER/DEBUG/pri_def_dir", 0x73800B00)); - RegistryEntries.insert(std::pair("/SYSTEMLOGGER/DEBUG/pri_def_dir2", 0x73800C00)); - RegistryEntries.insert(std::pair("/SYSTEMLOGGER/DEBUG/pri_def_dir3", 0x73800D00)); - RegistryEntries.insert(std::pair("/PSCLOUD", 0x76000000)); - RegistryEntries.insert(std::pair("/PSCLOUD/gf_version", 0x76010000)); - RegistryEntries.insert(std::pair("/PSCLOUD/gko_sdk_version", 0x76020000)); - RegistryEntries.insert(std::pair("/FS/UFS", 0xC0800000)); - RegistryEntries.insert(std::pair("/FS/UFS/compat_pkg", 0xC0808000)); - RegistryEntries.insert(std::pair("/FS/UFS/compat_pkg_mode", 0xC0808100)); - RegistryEntries.insert(std::pair("/FS/GAME_PROC", 0xC0880000)); - RegistryEntries.insert(std::pair("/FS/GAME_PROC/nolmt_pe_sldata", 0xC0888000)); - RegistryEntries.insert(std::pair("/DEVENV/HOST", 0x78010000)); - RegistryEntries.insert(std::pair("/DEVENV/HOST/devkitname", 0x78010100)); - RegistryEntries.insert(std::pair("/DEVENV/HOST/host_internal", 0x78010200)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL", 0x78020000)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/dl_debug_flags", 0x78020100)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/region_masq", 0x78020200)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/boot_param", 0x78020300)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/gpi00", 0x78020400)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/preload_chk_off", 0x78020500)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/trc_notify", 0x78026400)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/sysdl_from_host", 0x78028100)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/preserve_dmem", 0x78028200)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/use_default_lib", 0x78028300)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/dev_auto_assign", 0x78028400)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/razor_gpu", 0x78028600)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/pa_debug", 0x78028B00)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/gpu_validate", 0x78028C00)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/system_load", 0x78028D00)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/sys_prx_preload", 0x78028A00)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/reg_not_save", 0x78028800)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/use_dev_login", 0x78028900)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/appsuspend_test", 0x7802A000)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/pad_connection", 0x7802A100)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/mbus_mode", 0x7802A200)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/force_use_cam", 0x7802A300)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/host_overlay", 0x7802A400)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/pscode_masq", 0x7802A500)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/submit_done_exc", 0x7802A600)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/shutdown_debug", 0x7802A700)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/shell_debug", 0x7802A900)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/postmortem", 0x7802AA00)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/pad_auto_detect", 0x7802AB00)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/use_host_theme", 0x7802AC00)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/compositor_dbg", 0x7802AD00)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/vsh4k_rendering", 0x7802AE00)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/theme_preview", 0x7802AF00)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/submit_done", 0x7802B000)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/force_gpu_idle", 0x7802B100)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/qaflag_masq", 0x7802B200)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/vsh_gpu_control", 0x7802B400)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/multi_install", 0x7802B500)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/game_heap_trace", 0x7802B700)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/expose_under_2k", 0x7802B900)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/fake_neo4k_mode", 0x7802BA00)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/friendprof_f", 0x7802BB00)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/ipmi_dbg_flags", 0x7802BC00)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/loginmgr_debug", 0x7802BD00)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/sys_heap_trace", 0x7802BE00)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/game_intmem_dbg", 0x7802BF00)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/sce_module_dbg", 0x7802C000)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/piglet_rt_shdrc", 0x7802C100)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/gc_halt", 0x7802C200)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/asan_prog", 0x7802C300)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/asan_option", 0x7802C400)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/skip_modal_msg", 0x7802C500)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/video_core_dbg", 0x7802C600)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/dd_fake_trans", 0x7802C700)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/SHELLCORE", 0x7802C800)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/SHELLCORE/boot_disable", 0x7802C801)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/SHELLCORE/pathname", 0x7802C802)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/SHELLCORE/load_config", 0x7802C804)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/SHELLCORE/host_standby_rq", 0x7802C805)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/SHELLUI", 0x7802C900)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/SHELLUI/debug_menu", 0x7802C901)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/SHELLUI/screenshot", 0x7802C914)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/SHELLUI/shell_crash", 0x7802C915)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/SHELLUI/disp_titleid", 0x7802C916)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/SHELLUI/content_info", 0x7802C9C8)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/SHELLUI/webinspector", 0x7802C9C9)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/SHELLUI/webprofile", 0x7802C9CA)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/SHELLUI/webproxy", 0x7802C9CB)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/SHELLUI/webpreference", 0x7802C9CC)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/SHELLUI/fake_beta", 0x7802C9CD)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/COMMONDIALOG", 0x7802CD00)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/COMMONDIALOG/watch_dog", 0x7802CD01)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/COMMONDIALOG/crash_test", 0x7802CD02)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/COMMONDIALOG/suspendmode", 0x7802CD03)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/KEYBOARD", 0x7802D200)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/KEYBOARD/enable_pause", 0x7802D201)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/KEYBOARD/enable_printsc", 0x7802D202)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/VOICE_RECOG", 0x7802DC00)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/VOICE_RECOG/auto_start", 0x7802DC01)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/VOICE_RECOG/term_of_command", 0x7802DC02)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/VOICE_RECOG/transition", 0x7802DC03)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/VOICE_RECOG/recording_mode", 0x7802DC04)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/MONO/DEBUG", 0x7802E600)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/MONO/DEBUG/profiling", 0x7802E601)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/MONO/DEBUG/trace", 0x7802E602)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/MONO/DEBUG/trace_mask", 0x7802E603)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/MONO/DEBUG/debug_option", 0x7802E604)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/MONO/DEBUG/use_new_gc", 0x7802E605)); - RegistryEntries.insert(std::pair("/DEVENV/TOOL/MONO/DEBUG/enable_full_aot", 0x7802E606)); - RegistryEntries.insert(std::pair("/DEVENV/ACTIVATE", 0x78030000)); - RegistryEntries.insert(std::pair("/DEVENV/ACTIVATE/auto_renewal", 0x78030100)); - RegistryEntries.insert(std::pair("/DEVENV/ACTIVATE/prev_date", 0x78030200)); - RegistryEntries.insert(std::pair("/DEVENV/ACTIVATE/prev_result", 0x78030300)); - RegistryEntries.insert(std::pair("/DEVENV/QA", 0x78400000)); - RegistryEntries.insert(std::pair("/DEVENV/QA/eapcrash", 0x78408000)); - RegistryEntries.insert(std::pair("/DEVENV/QA/auto_test_type", 0x78408100)); - RegistryEntries.insert(std::pair("/DEVENV/QA/error_masq", 0x78408200)); - RegistryEntries.insert(std::pair("/DEVENV/QA/disable_bg_wave", 0x78408300)); - RegistryEntries.insert(std::pair("/DEVENV/QA/enable_exthdd", 0x78408400)); - RegistryEntries.insert(std::pair("/DEVENV/QA/intro_video_url", 0x78408600)); - RegistryEntries.insert(std::pair("/DEVENV/QA/fake_exthddspec", 0x78408700)); - RegistryEntries.insert(std::pair("/DEVENV/QA/enable_eu_ws1", 0x78408800)); - RegistryEntries.insert(std::pair("/DEVENV/QA/GAME", 0x78400100)); - RegistryEntries.insert(std::pair("/DEVENV/QA/GAME/sd_fake_space", 0x78400101)); - RegistryEntries.insert(std::pair("/DEVENV/QA/GAME/sd_fake_owner", 0x78400102)); - RegistryEntries.insert(std::pair("/DEVENV/QA/GAME/fake_finalized", 0x78400103)); - RegistryEntries.insert(std::pair("/DEVENV/QA/GAME/bdcopy", 0x78400104)); - RegistryEntries.insert(std::pair("/DEVENV/QA/GAME/ac_fake_space", 0x78400105)); - RegistryEntries.insert(std::pair("/DEVENV/QA/GAME/sd_rebuild", 0x78400106)); - RegistryEntries.insert(std::pair("/DEVENV/QA/GAME/vr_fake_space", 0x78400107)); - RegistryEntries.insert(std::pair("/DEVENV/QA/GAME/store_country", 0x78400108)); - RegistryEntries.insert(std::pair("/DEVENV/QA/GAME/sd_format", 0x7840010A)); - RegistryEntries.insert(std::pair("/DEVENV/QA/GAME/skip_asm_for_ac", 0x7840010B)); - RegistryEntries.insert(std::pair("/DEVENV/QA/GAME/game_rec_target", 0x7840010C)); - RegistryEntries.insert(std::pair("/DEVENV/QA/GAME/game_rec_area", 0x7840010D)); - RegistryEntries.insert(std::pair("/DEVENV/QA/GAME/game_rec_force", 0x7840010E)); - RegistryEntries.insert(std::pair("/DEVENV/QA/GAME/dd_boot_block", 0x7840010F)); - RegistryEntries.insert(std::pair("/DEVENV/QA/STANDBY", 0x78400200)); - RegistryEntries.insert(std::pair("/DEVENV/QA/STANDBY/actest_pattern", 0x78400201)); - RegistryEntries.insert(std::pair("/DEVENV/QA/STANDBY/actest_interval", 0x78400202)); - RegistryEntries.insert(std::pair("/DEVENV/QA/POWERTEST", 0x78400300)); - RegistryEntries.insert(std::pair("/DEVENV/QA/POWERTEST/navigation", 0x78400301)); - RegistryEntries.insert(std::pair("/DEVENV/QA/POWERTEST/shell_mediaplay", 0x78400302)); - RegistryEntries.insert(std::pair("/DEVENV/QA/POWERTEST/disc_player", 0x78400303)); - RegistryEntries.insert(std::pair("/DEVENV/QA/POWERTEST/psvideo", 0x78400304)); - - Initialized = true; - } - - if (RegistryEntries.find(Name) == RegistryEntries.end()) - return -1; - else - return RegistryEntries[Name]; -} \ No newline at end of file diff --git a/Playstation/OrbisToolbox-2.0/Registry.h b/Playstation/OrbisToolbox-2.0/Registry.h deleted file mode 100644 index 2537380..0000000 --- a/Playstation/OrbisToolbox-2.0/Registry.h +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once - -uint Registry_Find_By_Name(const char* Name); \ No newline at end of file diff --git a/Playstation/OrbisToolbox-2.0/RemoteCaller.h b/Playstation/OrbisToolbox-2.0/RemoteCaller.h index c882bfe..47b3151 100644 --- a/Playstation/OrbisToolbox-2.0/RemoteCaller.h +++ b/Playstation/OrbisToolbox-2.0/RemoteCaller.h @@ -32,5 +32,23 @@ public: return result; } + template + void RemoteCall(Func method, Args... args) + { + bool isWaiting = true; + auto internalMethod = std::bind(method, args...); // Bind our call to pass into the lambda easier. + + // Set up lambda for function call. + auto isWaitingPtr = &isWaiting; + CallList.push([internalMethod, isWaitingPtr]() -> void + { + internalMethod(); + *isWaitingPtr = false; + }); + + // Wait while the call is happening. + while (isWaiting) { sceKernelUsleep(10); } + } + void DoRemoteCalls(); }; diff --git a/Playstation/OrbisToolbox-2.0/System.cpp b/Playstation/OrbisToolbox-2.0/System.cpp deleted file mode 100644 index e0e0244..0000000 --- a/Playstation/OrbisToolbox-2.0/System.cpp +++ /dev/null @@ -1,143 +0,0 @@ -#include "Common.h" -#include "System.h" -#include "Registry.h" - -int ChangeSystemState(System_State State) -{ - OrbisKernelEventFlag EventFlag = 0; - int ret = 0; - - // sceSysCoreSetRebootFlag - ret = sceKernelOpenEventFlag(&EventFlag, "SceSysCoreReboot"); - if (!ret) - { - ret = sceKernelCancelEventFlag(EventFlag, State, 0); - if (!ret) - { - sceKernelCloseEventFlag(EventFlag); - ret = 0; - } - } - - sceKernelIccIndicatorShutdown(); - kill(1, 30); //Terminate Process 1 (mini-syscore.elf) with the signal 30. - - return ret; -} - -void SetConsoleLED(ConsoleLEDColours Colour) -{ - switch (Colour) - { - default: - case white: - sceKernelIccIndicatorBootDone(); - break; - - case white_Blinking: - sceKernelIccIndicatorShutdown(); - break; - - case Blue_Blinking: - sceKernelIccIndicatorStandbyBoot(); - break; - } -} - -void SetControllerLED() -{ - -} - -void RingBuzzer(BuzzerType Type) -{ - if (Type < 6) - sceKernelIccSetBuzzer(Type); -} - -int32_t GetCPUTemp() -{ - int32_t CPUTemp = 0; - if (sceKernelGetCpuTemperature(&CPUTemp) == 0) - return CPUTemp; - else - return -1; -} - -int32_t GetSOCTemp() -{ - int32_t SOCTemp = 0; - if (sceKernelGetSocSensorTemperature(0, &SOCTemp) == 0) - return SOCTemp; - else - return -1; -} - -int GetSDKVersion() -{ - int sdk_version = 0; - size_t sdk_versionlen = 4; - - sysctlbyname("kern.sdk_version", (char*)&sdk_version, &sdk_versionlen, nullptr, 0); - - return sdk_version; -} - -int GetUpdateVersion() -{ - int sdk_version = 0; - size_t sdk_versionlen = 4; - - sysctlbyname("machdep.upd_version", (char*)&sdk_version, &sdk_versionlen, nullptr, 0); - - return sdk_version; -} - -bool GetConsoleName(char* Out, size_t len) -{ - return sceRegMgrGetStr(Registry_Find_By_Name("/SYSTEM/nickname"), Out, len) == 0; -} - -int GetIDPS(char* Out) -{ - size_t IDPSlen = 16; - return sysctlbyname("machdep.idps", Out, &IDPSlen, NULL, NULL); -} - -int GetPSID(char* Out) -{ - size_t PSID = 16; - return sysctlbyname("machdep.openpsid", Out, &PSID, NULL, NULL); -} - -Console_Types GetConsoleType() -{ - char IDPS[16] = { 0 }; - size_t IDPSlen = 16; - sysctlbyname("machdep.idps", (char*)&IDPS, &IDPSlen, NULL, NULL); - - switch (IDPS[5] & 0xffU) - { - case 0x80: - return CT_DIAG; - break; - - case 0x81: - return CT_DEVKIT; - break; - - case 0x82: - return CT_TESTKIT; - break; - - case 0x83 ... 0x8F: - return CT_RETAIL; - break; - - case 0xA0: - return CT_KRATOS; - break; - } - - return CT_UNK; -} \ No newline at end of file diff --git a/Playstation/OrbisToolbox-2.0/System.h b/Playstation/OrbisToolbox-2.0/System.h deleted file mode 100644 index 5837391..0000000 --- a/Playstation/OrbisToolbox-2.0/System.h +++ /dev/null @@ -1,38 +0,0 @@ -#pragma once - -enum System_State -{ - Suspend = 0x8004000, - Shutdown = 0x4000, - Reboot = 0x0, -}; - -enum ConsoleLEDColours -{ - white, - white_Blinking, - Blue_Blinking, -}; - -enum Console_Types -{ - CT_UNK, - CT_DIAG, //0x80 - CT_DEVKIT, //0x81 - CT_TESTKIT, //0x82 - CT_RETAIL, //0x83 -> 0x8F - CT_KRATOS, //0xA0 IMPOSSIBLE?? -}; - -int ChangeSystemState(System_State State); -void SetConsoleLED(ConsoleLEDColours Colour); -void SetControllerLED(); -void RingBuzzer(BuzzerType Type); -int32_t GetCPUTemp(); -int32_t GetSOCTemp(); -int GetSDKVersion(); -int GetUpdateVersion(); -bool GetConsoleName(char* Out, size_t len); -int GetIDPS(char* Out); -int GetPSID(char* Out); -Console_Types GetConsoleType(); \ No newline at end of file diff --git a/Playstation/OrbisToolbox-2.0/Utilities.cpp b/Playstation/OrbisToolbox-2.0/Utilities.cpp index 43bcb45..30c9d8e 100644 --- a/Playstation/OrbisToolbox-2.0/Utilities.cpp +++ b/Playstation/OrbisToolbox-2.0/Utilities.cpp @@ -134,9 +134,25 @@ void Get_Page_Table_Stats(int vm, int type, int* Used, int* Free, int* Total) *Total = _Total; } -char* GetBigAppTitleId() +bool SockSendInt(OrbisNetId Sock, int val) { - auto bigAppId = sceSystemServiceGetAppIdOfBigApp(); + return !(sceNetSend(Sock, &val, sizeof(int), 0) < 0); +} - return LncUtil::GetAppTitleId(bigAppId); +bool SockRecvInt(OrbisNetId Sock, int* val) +{ + return !(sceNetRecv(Sock, val, sizeof(int), 0) < 0); +} + +int RecieveInt(OrbisNetId Sock) +{ + int Int = 0; + if (sceNetRecv(Sock, &Int, sizeof(int), 0) < 0) + { + SockSendInt(Sock, 0); + return 0; + } + + SockSendInt(Sock, 1); + return Int; } \ No newline at end of file diff --git a/Playstation/OrbisToolbox-2.0/Utilities.h b/Playstation/OrbisToolbox-2.0/Utilities.h index efb313e..3c5ffae 100644 --- a/Playstation/OrbisToolbox-2.0/Utilities.h +++ b/Playstation/OrbisToolbox-2.0/Utilities.h @@ -22,4 +22,6 @@ void Notify_Custom(const char* IconURI, const char* MessageFMT, ...); void Get_Page_Table_Stats(int vm, int type, int* Used, int* Free, int* Total); -char* GetBigAppTitleId(); \ No newline at end of file +bool SockSendInt(OrbisNetId Sock, int val); +bool SockRecvInt(OrbisNetId Sock, int* val); +int RecieveInt(OrbisNetId Sock); \ No newline at end of file diff --git a/Playstation/OrbisToolbox-2.0/Version.h b/Playstation/OrbisToolbox-2.0/Version.h index b7610e8..4b64c37 100644 --- a/Playstation/OrbisToolbox-2.0/Version.h +++ b/Playstation/OrbisToolbox-2.0/Version.h @@ -1,11 +1,11 @@ -#pragma once -#define ORBIS_TOOLBOX_MAJOR 2 -#define ORBIS_TOOLBOX_MINOR 0 -#define ORBIS_TOOLBOX_BUILDVERSION 283 -#define stringify(a) stringify_(a) -#define stringify_(a) #a -#if defined(ORBIS_TOOLBOX_DEBUG) -#define ORBIS_TOOLBOX_BUILDSTRING ("[Orbis Toolbox " stringify(ORBIS_TOOLBOX_MAJOR) "." stringify(ORBIS_TOOLBOX_MINOR) "] Dev Build " stringify(ORBIS_TOOLBOX_BUILDVERSION) " " __DATE__ " " __TIME__) -#else -#define ORBIS_TOOLBOX_BUILDSTRING ("[Orbis Toolbox " stringify(ORBIS_TOOLBOX_MAJOR) "." stringify(ORBIS_TOOLBOX_MINOR) "] Build " stringify(ORBIS_TOOLBOX_BUILDVERSION) " " __DATE__ " " __TIME__) -#endif +#pragma once +#define ORBIS_TOOLBOX_MAJOR 2 +#define ORBIS_TOOLBOX_MINOR 0 +#define ORBIS_TOOLBOX_BUILDVERSION 290 +#define stringify(a) stringify_(a) +#define stringify_(a) #a +#if defined(ORBIS_TOOLBOX_DEBUG) +#define ORBIS_TOOLBOX_BUILDSTRING ("[Orbis Toolbox " stringify(ORBIS_TOOLBOX_MAJOR) "." stringify(ORBIS_TOOLBOX_MINOR) "] Dev Build " stringify(ORBIS_TOOLBOX_BUILDVERSION) " " __DATE__ " " __TIME__) +#else +#define ORBIS_TOOLBOX_BUILDSTRING ("[Orbis Toolbox " stringify(ORBIS_TOOLBOX_MAJOR) "." stringify(ORBIS_TOOLBOX_MINOR) "] Build " stringify(ORBIS_TOOLBOX_BUILDVERSION) " " __DATE__ " " __TIME__) +#endif diff --git a/Windows/Libraries/OrbisLib2/Common/API/API.cs b/Windows/Libraries/OrbisLib2/Common/API/API.cs index 875dd0e..be81d65 100644 --- a/Windows/Libraries/OrbisLib2/Common/API/API.cs +++ b/Windows/Libraries/OrbisLib2/Common/API/API.cs @@ -37,24 +37,32 @@ namespace OrbisLib2.Common.API return APIResults.API_ERROR_COULDNT_CONNECT; } - if (Connect(DesiredTarget.IPAddress, Settings.CreateInstance().APIPort, TimeOut, out Socket Sock)) + try { - // Send Inital Packet. - var result = SendNextPacket(Sock, new APIPacket() { PacketVersion = Config.PacketVersion, Command = Command }); - - // Call lambda for additional calls. - if (result == APIResults.API_OK && AdditionalCommunications != null) + if (Connect(DesiredTarget.IPAddress, Settings.CreateInstance().APIPort, TimeOut, out Socket Sock)) { - AdditionalCommunications.Invoke(Sock, result); + // Send Inital Packet. + var result = SendNextPacket(Sock, new APIPacket() { PacketVersion = Config.PacketVersion, Command = Command }); + + // Call lambda for additional calls. + if (result == APIResults.API_OK && AdditionalCommunications != null) + { + AdditionalCommunications.Invoke(Sock, result); + } + + // Clean up. + Sock.Close(); + + return result; } - - // Clean up. - Sock.Close(); - - return result; + else + return APIResults.API_ERROR_COULDNT_CONNECT; } - else + catch (SocketException ex) + { + Console.WriteLine($"SendCommand() Sock Error: {ex.Message}"); return APIResults.API_ERROR_COULDNT_CONNECT; + } } /// diff --git a/Windows/Libraries/OrbisLib2/Common/API/APIPackets.cs b/Windows/Libraries/OrbisLib2/Common/API/APIPackets.cs index 8ecab29..0bd45bb 100644 --- a/Windows/Libraries/OrbisLib2/Common/API/APIPackets.cs +++ b/Windows/Libraries/OrbisLib2/Common/API/APIPackets.cs @@ -25,6 +25,8 @@ namespace OrbisLib2.Common.API API_APPS_SUSPEND, API_APPS_RESUME, API_APPS_DELETE, + API_APPS_SET_VISIBILITY, + API_APPS_GET_VISIBILITY, APP_END, /* ############################## */ @@ -239,8 +241,6 @@ namespace OrbisLib2.Common.API public int prot; } - - public enum ConsoleTypes { UNK, @@ -267,14 +267,23 @@ namespace OrbisLib2.Common.API public float Percentage; }; + [StructLayout(LayoutKind.Sequential, Pack = 8, CharSet = CharSet.Ansi), Serializable] + public struct CurrentBigApp + { + public int Pid; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + public string Name; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 10)] + public string TitleId; + }; + [StructLayout(LayoutKind.Sequential, Pack = 8, CharSet = CharSet.Ansi), Serializable] public struct TargetInfoPacket { public int SDKVersion; public int SoftwareVersion; public int FactorySoftwareVersion; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 10)] - public string CurrentTitleID; + public CurrentBigApp BigApp; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 100)] public string ConsoleName; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 14)] diff --git a/Windows/Libraries/OrbisLib2/Common/Database/TargetInfo.cs b/Windows/Libraries/OrbisLib2/Common/Database/TargetInfo.cs index 34d168c..9ed94f6 100644 --- a/Windows/Libraries/OrbisLib2/Common/Database/TargetInfo.cs +++ b/Windows/Libraries/OrbisLib2/Common/Database/TargetInfo.cs @@ -61,11 +61,23 @@ namespace OrbisLib2.Common.Database [NotNull] public string FactorySoftwareVersion { get; set; } = "-"; + /// + /// The process index of the current big app. + /// + [NotNull] + public int BigAppPid { get; set; } = -1; + + /// + /// The process name of the current big app. + /// + [NotNull] + public string BigAppProcessName { get; set; } = "-"; + /// /// The current big game titleId running on the target. /// [NotNull] - public string CurrentTitleID { get; set; } = "-"; + public string BigAppTitleID { get; set; } = "-"; /// /// The name of the target as set on the target. diff --git a/Windows/Libraries/OrbisLib2/Targets/Application.cs b/Windows/Libraries/OrbisLib2/Targets/Application.cs index 1b87403..07dca9b 100644 --- a/Windows/Libraries/OrbisLib2/Targets/Application.cs +++ b/Windows/Libraries/OrbisLib2/Targets/Application.cs @@ -12,6 +12,13 @@ namespace OrbisLib2.Targets public class Application { + public enum VisibilityType : int + { + VT_NONE, + VT_VISIBLE, + VT_INVISIBLE, + }; + private Target Target; public Application(Target Target) @@ -194,5 +201,74 @@ namespace OrbisLib2.Targets return (result == 1); } + + public bool Delete(string TitleId) + { + if (!Regex.IsMatch(TitleId, @"[a-zA-Z]{4}\d{5}")) + { + Console.WriteLine($"Invaild titleId format {TitleId}"); + return false; + } + + int result = 0; + API.SendCommand(Target, 5, APICommands.API_APPS_DELETE, (Socket Sock, APIResults Result) => + { + // Send the titleId of the app. + var bytes = Encoding.ASCII.GetBytes(TitleId.PadRight(10, '\0')).Take(10).ToArray(); + Sock.Send(bytes); + + // Get the state from API. + result = Sock.RecvInt32(); + }); + + return (result == 1); + } + + public bool SetVisibility(string TitleId, VisibilityType Visibility) + { + if (!Regex.IsMatch(TitleId, @"[a-zA-Z]{4}\d{5}")) + { + Console.WriteLine($"Invaild titleId format {TitleId}"); + return false; + } + + int result = 0; + API.SendCommand(Target, 5, APICommands.API_APPS_SET_VISIBILITY, (Socket Sock, APIResults Result) => + { + // Send the titleId of the app. + var bytes = Encoding.ASCII.GetBytes(TitleId.PadRight(10, '\0')).Take(10).ToArray(); + Sock.Send(bytes); + + // Send the visibility state. + Sock.SendInt32((int)Visibility); + + // Get the state from API. + result = Sock.RecvInt32(); + }); + + return (result == 1); + } + + public VisibilityType GetVisibility(string TitleId) + { + if (!Regex.IsMatch(TitleId, @"[a-zA-Z]{4}\d{5}")) + { + Console.WriteLine($"Invaild titleId format {TitleId}"); + return VisibilityType.VT_NONE; + } + + VisibilityType result = VisibilityType.VT_NONE; + API.SendCommand(Target, 5, APICommands.API_APPS_GET_VISIBILITY, (Socket Sock, APIResults Result) => + { + // Send the titleId of the app. + var bytes = Encoding.ASCII.GetBytes(TitleId.PadRight(10, '\0')).Take(10).ToArray(); + Sock.Send(bytes); + + // Get the state from API. + result = (VisibilityType)Sock.RecvInt32(); + }); + + return result; + } } } diff --git a/Windows/Libraries/OrbisLib2/Targets/TargetManager.cs b/Windows/Libraries/OrbisLib2/Targets/TargetManager.cs index 5023315..dd20622 100644 --- a/Windows/Libraries/OrbisLib2/Targets/TargetManager.cs +++ b/Windows/Libraries/OrbisLib2/Targets/TargetManager.cs @@ -134,7 +134,9 @@ namespace OrbisLib2.Targets savedTarget.Info.SDKVersion = $"{(Packet.SDKVersion >> 24 & 0xFF).ToString("X1")}.{(Packet.SDKVersion >> 12 & 0xFFF).ToString("X3")}.{(Packet.SDKVersion & 0xFFF).ToString("X3")}"; savedTarget.Info.SoftwareVersion = $"{(Packet.SoftwareVersion >> 24 & 0xFF).ToString("X1")}.{(Packet.SoftwareVersion >> 16 & 0xFF).ToString("X2")}"; savedTarget.Info.FactorySoftwareVersion = $"{(Packet.FactorySoftwareVersion >> 24 & 0xFF).ToString("X1")}.{(Packet.FactorySoftwareVersion >> 12 & 0xFFF).ToString("X3")}.{(Packet.FactorySoftwareVersion & 0xFFF).ToString("X3")}"; - savedTarget.Info.CurrentTitleID = Packet.CurrentTitleID; + savedTarget.Info.BigAppPid = Packet.BigApp.Pid; + savedTarget.Info.BigAppProcessName = Packet.BigApp.Name; + savedTarget.Info.BigAppTitleID = Packet.BigApp.TitleId; savedTarget.Info.ConsoleName = Packet.ConsoleName; savedTarget.Info.MotherboardSerial = Packet.MotherboardSerial; savedTarget.Info.Serial = Packet.Serial; diff --git a/Windows/OrbisLibraryManager/Controls/CurrentTargetDisplay.xaml.cs b/Windows/OrbisLibraryManager/Controls/CurrentTargetDisplay.xaml.cs index 6a80a48..e2b385f 100644 --- a/Windows/OrbisLibraryManager/Controls/CurrentTargetDisplay.xaml.cs +++ b/Windows/OrbisLibraryManager/Controls/CurrentTargetDisplay.xaml.cs @@ -67,7 +67,7 @@ namespace OrbisLibraryManager.Controls CurrentTargetName.Text = CurrentTarget.IsDefault ? $"★{CurrentTarget.Name}" : CurrentTarget.Name; - if (CurrentTarget.Info.CurrentTitleID == null || !Regex.IsMatch(CurrentTarget.Info.CurrentTitleID, @"CUSA\d{5}")) + if (CurrentTarget.Info.BigAppTitleID == null || !Regex.IsMatch(CurrentTarget.Info.BigAppTitleID, @"CUSA\d{5}")) { CurrentTargetTitleName.Text = "Unknown Title"; CurrentTargetTitleId.Text = "-"; @@ -75,7 +75,7 @@ namespace OrbisLibraryManager.Controls } else { - var Title = new TMDB(CurrentTarget.Info.CurrentTitleID); + var Title = new TMDB(CurrentTarget.Info.BigAppTitleID); Regex rgx = new Regex(@"[^0-9a-zA-Z +.:']"); CurrentTargetTitleName.Text = Title.Names.First(); CurrentTargetTitleId.Text = Title.NPTitleID; @@ -89,9 +89,9 @@ namespace OrbisLibraryManager.Controls { var CurrentTarget = TargetManager.SelectedTarget; - if (CurrentTarget != null && CurrentTarget.Info.CurrentTitleID != null && Regex.IsMatch(CurrentTarget.Info.CurrentTitleID, @"CUSA\d{5}")) + if (CurrentTarget != null && CurrentTarget.Info.BigAppTitleID != null && Regex.IsMatch(CurrentTarget.Info.BigAppTitleID, @"CUSA\d{5}")) { - var Title = new TMDB(CurrentTarget.Info.CurrentTitleID); + var Title = new TMDB(CurrentTarget.Info.BigAppTitleID); var url = $"https://store.playstation.com/product/{Title.ContentID}/"; System.Diagnostics.Process.Start(new ProcessStartInfo diff --git a/Windows/OrbisNeighborHood/Controls/AppPanel.xaml.cs b/Windows/OrbisNeighborHood/Controls/AppPanel.xaml.cs index 4a6161b..85873b6 100644 --- a/Windows/OrbisNeighborHood/Controls/AppPanel.xaml.cs +++ b/Windows/OrbisNeighborHood/Controls/AppPanel.xaml.cs @@ -2,12 +2,14 @@ using OrbisLib2.General; using OrbisLib2.Targets; using System; +using System.Diagnostics; using System.IO; using System.Threading; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Media.Imaging; +using static OrbisLib2.Targets.Application; namespace OrbisNeighborHood.Controls { @@ -19,6 +21,7 @@ namespace OrbisNeighborHood.Controls public AppInfo App; private AppState AppState = AppState.STATE_NOT_RUNNING; + private VisibilityType Visible = VisibilityType.VT_NONE; public AppPanel(AppInfo App, string AppVersion) { @@ -115,7 +118,8 @@ namespace OrbisNeighborHood.Controls } // App Visibility. - if (App.Visible == 0 || App.Visible == 2) + Visible = currentTarget.Application.GetVisibility(App.TitleId); + if (Visible == VisibilityType.VT_NONE || Visible == VisibilityType.VT_INVISIBLE) { Dispatcher.Invoke(() => Visibility.ToolTip = $"Show {App.TitleName} from Home Menu."); } @@ -164,7 +168,24 @@ namespace OrbisNeighborHood.Controls private void Visibility_Click(object sender, RoutedEventArgs e) { - + Task.Run(() => + { + var currentTarget = TargetManager.SelectedTarget; + if (Visible == VisibilityType.VT_NONE || Visible == VisibilityType.VT_INVISIBLE) + { + if(currentTarget.Application.SetVisibility(App.TitleId, VisibilityType.VT_VISIBLE)) + { + Visible = VisibilityType.VT_VISIBLE; + } + } + else + { + if(currentTarget.Application.SetVisibility(App.TitleId, VisibilityType.VT_INVISIBLE)) + { + Visible = VisibilityType.VT_INVISIBLE; + } + } + }); } private void ChangeIcon_Click(object sender, RoutedEventArgs e) @@ -174,7 +195,21 @@ namespace OrbisNeighborHood.Controls private void OpenStore_Click(object sender, RoutedEventArgs e) { + try + { + var Title = new TMDB(App.TitleId); + var url = $"https://store.playstation.com/product/{Title.ContentID}/"; + System.Diagnostics.Process.Start(new ProcessStartInfo + { + FileName = url, + UseShellExecute = true + }); + } + catch + { + + } } private void MoreInfo_Click(object sender, RoutedEventArgs e) @@ -184,7 +219,8 @@ namespace OrbisNeighborHood.Controls private void Delete_Click(object sender, RoutedEventArgs e) { - + // TODO: Add are you sure? + Task.Run(() => TargetManager.SelectedTarget.Application.Delete(App.TitleId)); } #endregion diff --git a/Windows/OrbisNeighborHood/Controls/CurrentTargetDisplay.xaml.cs b/Windows/OrbisNeighborHood/Controls/CurrentTargetDisplay.xaml.cs index cc9bc90..28856f3 100644 --- a/Windows/OrbisNeighborHood/Controls/CurrentTargetDisplay.xaml.cs +++ b/Windows/OrbisNeighborHood/Controls/CurrentTargetDisplay.xaml.cs @@ -67,7 +67,7 @@ namespace OrbisNeighborHood.Controls CurrentTargetName.Text = CurrentTarget.IsDefault ? $"★{CurrentTarget.Name}" : CurrentTarget.Name; - if (CurrentTarget.Info.CurrentTitleID == null || !Regex.IsMatch(CurrentTarget.Info.CurrentTitleID, @"CUSA\d{5}")) + if (CurrentTarget.Info.BigAppTitleID == null || !Regex.IsMatch(CurrentTarget.Info.BigAppTitleID, @"CUSA\d{5}")) { CurrentTargetTitleName.Text = "Unknown Title"; CurrentTargetTitleId.Text = "-"; @@ -75,7 +75,7 @@ namespace OrbisNeighborHood.Controls } else { - var Title = new TMDB(CurrentTarget.Info.CurrentTitleID); + var Title = new TMDB(CurrentTarget.Info.BigAppTitleID); Regex rgx = new Regex(@"[^0-9a-zA-Z +.:']"); CurrentTargetTitleName.Text = Title.Names.First(); CurrentTargetTitleId.Text = Title.NPTitleID; @@ -89,9 +89,9 @@ namespace OrbisNeighborHood.Controls { var CurrentTarget = TargetManager.SelectedTarget; - if (CurrentTarget != null && CurrentTarget.Info.CurrentTitleID != null && Regex.IsMatch(CurrentTarget.Info.CurrentTitleID, @"CUSA\d{5}")) + if (CurrentTarget != null && CurrentTarget.Info.BigAppTitleID != null && Regex.IsMatch(CurrentTarget.Info.BigAppTitleID, @"CUSA\d{5}")) { - var Title = new TMDB(CurrentTarget.Info.CurrentTitleID); + var Title = new TMDB(CurrentTarget.Info.BigAppTitleID); var url = $"https://store.playstation.com/product/{Title.ContentID}/"; System.Diagnostics.Process.Start(new ProcessStartInfo diff --git a/Windows/OrbisNeighborHood/MVVM/View/DashboardView.xaml.cs b/Windows/OrbisNeighborHood/MVVM/View/DashboardView.xaml.cs index 7798dca..8d55650 100644 --- a/Windows/OrbisNeighborHood/MVVM/View/DashboardView.xaml.cs +++ b/Windows/OrbisNeighborHood/MVVM/View/DashboardView.xaml.cs @@ -219,7 +219,7 @@ namespace OrbisNeighborHood.MVVM.View RamUsage = $"{CurrentTarget.Info.RamUsage} MB"; VRamUsage = $"{CurrentTarget.Info.VRamUsage} MB"; - if (CurrentTarget.Info.CurrentTitleID == null || !Regex.IsMatch(CurrentTarget.Info.CurrentTitleID, @"CUSA\d{5}")) + if (CurrentTarget.Info.BigAppTitleID == null || !Regex.IsMatch(CurrentTarget.Info.BigAppTitleID, @"CUSA\d{5}")) { TitleName = "Unknown Title"; TitleId = "-"; @@ -228,11 +228,11 @@ namespace OrbisNeighborHood.MVVM.View } else { - var Title = new TMDB(CurrentTarget.Info.CurrentTitleID); + var Title = new TMDB(CurrentTarget.Info.BigAppTitleID); Regex rgx = new Regex(@"[^0-9a-zA-Z +.:']"); TitleName = Title.Names.First(); TitleId = Title.NPTitleID; - ProcessName = "-"; // TODO: In the future we will need to pull the processname(processId) for the current big app. + ProcessName = $"{CurrentTarget.Info.BigAppProcessName} ({CurrentTarget.Info.BigAppPid})"; var test = Title.BGM; TitleImage.Source = new BitmapImage(new Uri(Title.Icons.First())); } diff --git a/Windows/OrbisNeighborHood/Resources/BuildNumber.txt b/Windows/OrbisNeighborHood/Resources/BuildNumber.txt index 6a36181..0bbd854 100644 --- a/Windows/OrbisNeighborHood/Resources/BuildNumber.txt +++ b/Windows/OrbisNeighborHood/Resources/BuildNumber.txt @@ -1 +1 @@ -2053 +2073 diff --git a/Windows/OrbisNeighborHood/Resources/BuildString.txt b/Windows/OrbisNeighborHood/Resources/BuildString.txt index 9422fbd..8350fab 100644 --- a/Windows/OrbisNeighborHood/Resources/BuildString.txt +++ b/Windows/OrbisNeighborHood/Resources/BuildString.txt @@ -1 +1 @@ -Version 3.0.2053 Release Build Friday December 23 2022 10:59 AM +Version 3.0.2073 Debug Build Friday December 23 2022 11:44 PM diff --git a/Windows/OrbisSuiteService/Service/TargetWatcher.cs b/Windows/OrbisSuiteService/Service/TargetWatcher.cs index cc8334c..0cf88b8 100644 --- a/Windows/OrbisSuiteService/Service/TargetWatcher.cs +++ b/Windows/OrbisSuiteService/Service/TargetWatcher.cs @@ -51,7 +51,7 @@ namespace OrbisSuiteService.Service Target.Info.BusyCore = 0; Target.Info.RamUsage = 0; Target.Info.VRamUsage = 0; - Target.Info.CurrentTitleID = "-"; + Target.Info.BigAppTitleID = "-"; Target.Info.Save(); }