From c9955050231c7431283e33e49feff51c9c33ae1f Mon Sep 17 00:00:00 2001 From: AniLeo Date: Sat, 18 Sep 2021 17:42:53 +0100 Subject: [PATCH] edat: Check for the correct directory --- rpcs3/Emu/Cell/Modules/sceNp.cpp | 2 +- rpcs3/Emu/system_utils.cpp | 10 +++++----- rpcs3/Emu/system_utils.hpp | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/rpcs3/Emu/Cell/Modules/sceNp.cpp b/rpcs3/Emu/Cell/Modules/sceNp.cpp index 95a7bd3a4a..53bcf85620 100644 --- a/rpcs3/Emu/Cell/Modules/sceNp.cpp +++ b/rpcs3/Emu/Cell/Modules/sceNp.cpp @@ -553,7 +553,7 @@ error_code npDrmVerifyUpgradeLicense(vm::cptr content_id) const std::string content_str(content_id.get_ptr(), std::find(content_id.get_ptr(), content_id.get_ptr() + 0x2f, '\0')); sceNp.warning("npDrmVerifyUpgradeLicense(): content_id='%s'", content_id); - if (!rpcs3::utils::verify_c00_unlock_edat(Emu.GetTitleID(), content_str)) + if (!rpcs3::utils::verify_c00_unlock_edat(content_str)) return SCE_NP_DRM_ERROR_LICENSE_NOT_FOUND; return CELL_OK; diff --git a/rpcs3/Emu/system_utils.cpp b/rpcs3/Emu/system_utils.cpp index b8a1709f11..56d7c830d2 100644 --- a/rpcs3/Emu/system_utils.cpp +++ b/rpcs3/Emu/system_utils.cpp @@ -157,7 +157,7 @@ namespace rpcs3::utils return rap_path; } - std::string get_c00_unlock_edat_path(const std::string_view& title_id, const std::string_view& content_id) + std::string get_c00_unlock_edat_path(const std::string_view& content_id) { const std::string home_dir = get_hdd0_dir() + "home"; @@ -167,7 +167,7 @@ namespace rpcs3::utils { if (entry.is_directory && check_user(entry.name)) { - edat_path = fmt::format("%s/%s/exdata/%s/%s.edat", home_dir, entry.name, title_id, content_id); + edat_path = fmt::format("%s/%s/exdata/%s.edat", home_dir, entry.name, content_id); if (fs::is_file(edat_path)) { return edat_path; @@ -179,9 +179,9 @@ namespace rpcs3::utils return edat_path; } - bool verify_c00_unlock_edat(const std::string_view& title_id, const std::string_view& content_id) + bool verify_c00_unlock_edat(const std::string_view& content_id) { - const std::string edat_path = rpcs3::utils::get_c00_unlock_edat_path(title_id, content_id); + const std::string edat_path = rpcs3::utils::get_c00_unlock_edat_path(content_id); // Check if user has unlock EDAT installed if (!fs::is_file(edat_path)) @@ -287,7 +287,7 @@ namespace rpcs3::utils // This is a trial game. Check if the user has EDAT file to unlock it. const auto c00_title_id = psf::get_string(psf, "TITLE_ID"); - if (fs::is_file(game_path + "/C00/PARAM.SFO") && verify_c00_unlock_edat(c00_title_id, content_id)) + if (fs::is_file(game_path + "/C00/PARAM.SFO") && verify_c00_unlock_edat(content_id)) { // Load full game data. sys_log.notice("Verified EDAT file %s.edat for trial game %s", content_id, c00_title_id); diff --git a/rpcs3/Emu/system_utils.hpp b/rpcs3/Emu/system_utils.hpp index 09ebefbf14..424b1c2030 100644 --- a/rpcs3/Emu/system_utils.hpp +++ b/rpcs3/Emu/system_utils.hpp @@ -23,7 +23,7 @@ namespace rpcs3::utils std::string get_cache_dir(); std::string get_rap_file_path(const std::string_view& rap); - bool verify_c00_unlock_edat(const std::string_view& title_id, const std::string_view& content_id); + bool verify_c00_unlock_edat(const std::string_view& content_id); std::string get_sfo_dir_from_game_path(const std::string& game_path, const std::string& title_id = ""); std::string get_custom_config_dir();