vfsDir usage fixed

This commit is contained in:
Nekotekina 2015-04-26 00:26:54 +03:00
parent 31a41b795e
commit 9cfdce91a1
6 changed files with 32 additions and 32 deletions

View file

@ -100,8 +100,8 @@ int npDrmIsAvailable(u32 k_licensee_addr, vm::ptr<const char> drm_path)
}
}
sceNp.Warning("npDrmIsAvailable: Found DRM license file at %s", drm_path.get_ptr());
sceNp.Warning("npDrmIsAvailable: Using k_licensee 0x%s", k_licensee_str.c_str());
sceNp.Warning("npDrmIsAvailable(): Found DRM license file at %s", drm_path.get_ptr());
sceNp.Warning("npDrmIsAvailable(): Using k_licensee 0x%s", k_licensee_str.c_str());
// Set the necessary file paths.
std::string drm_file_name = fmt::AfterLast(drm_path.get_ptr(), '/');
@ -116,21 +116,20 @@ int npDrmIsAvailable(u32 k_licensee_addr, vm::ptr<const char> drm_path)
std::string rap_path("/dev_hdd0/home/" + pf_str + "/exdata/");
// Search dev_usb000 for a compatible RAP file.
vfsDir raps_dir(rap_path);
if (!raps_dir.IsOpened())
sceNp.Warning("npDrmIsAvailable: Can't find RAP file for DRM!");
else
for (const auto entry : vfsDir(rap_path))
{
for (const DirEntryInfo *entry : raps_dir)
if (entry->name.find(titleID) != std::string::npos)
{
if (entry->name.find(titleID) != std::string::npos)
{
rap_path += entry->name;
break;
}
rap_path += entry->name;
break;
}
}
if (rap_path.back() == '/')
{
sceNp.Warning("npDrmIsAvailable(): Can't find RAP file for '%s' (titleID='%s')", drm_path.get_ptr(), titleID);
}
// Decrypt this EDAT using the supplied k_licensee and matching RAP file.
std::string enc_drm_path_local, dec_drm_path_local, rap_path_local;
Emu.GetVFS().GetDevice(enc_drm_path, enc_drm_path_local);