diff --git a/src/main.cpp b/src/main.cpp index 967bd227..b37702b2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -6,6 +6,7 @@ #include #include +#include #include "common/config.h" #include "common/discord.h" #include "common/logging/backend.h" @@ -48,6 +49,23 @@ int main(int argc, char* argv[]) { std::filesystem::path p = std::string(path); mnt->Mount(p.parent_path(), "/app0"); + // Loading param.sfo file if exists + std::filesystem::path sce_sys_folder = p.parent_path() / "sce_sys"; + if (std::filesystem::is_directory(sce_sys_folder)) { + for (const auto& entry : std::filesystem::directory_iterator(sce_sys_folder)) { + if (entry.path().filename() == "param.sfo") { + auto* param_sfo = Common::Singleton::Instance(); + param_sfo->open(sce_sys_folder.string() + "/param.sfo"); + std::string id(param_sfo->GetString("CONTENT_ID"), 7, 9); + std::string title(param_sfo->GetString("TITLE")); + LOG_INFO(Loader, "Game id: {} Title: {}", id, title); + u32 fw_version = param_sfo->GetInteger("SYSTEM_VER"); + std::string app_version = param_sfo->GetString("APP_VER"); + LOG_INFO(Loader, "Fw: {:#x} App Version: {}", fw_version, app_version); + } + } + } + auto linker = Common::Singleton::Instance(); Libraries::InitHLELibs(&linker->getHLESymbols()); linker->LoadModule(path);