mirror of
https://github.com/Lime3DS/Lime3DS
synced 2024-10-31 20:27:52 +00:00
Services/AM: Detect encrypted CIAs
This commit is contained in:
parent
c0eb233bf1
commit
70ff3c72f1
1 changed files with 8 additions and 0 deletions
|
@ -297,6 +297,14 @@ InstallStatus InstallCIA(const std::string& path,
|
|||
Service::AM::CIAFile installFile(
|
||||
Service::AM::GetTitleMediaType(container.GetTitleMetadata().GetTitleID()));
|
||||
|
||||
for (size_t i = 0; i < container.GetTitleMetadata().GetContentCount(); i++) {
|
||||
if (container.GetTitleMetadata().GetContentTypeByIndex(i) &
|
||||
FileSys::TMDContentTypeFlag::Encrypted) {
|
||||
LOG_ERROR(Service_AM, "File %s is encrypted! Aborting...", path.c_str());
|
||||
return InstallStatus::ErrorEncrypted;
|
||||
}
|
||||
}
|
||||
|
||||
FileUtil::IOFile file(path, "rb");
|
||||
if (!file.IsOpen())
|
||||
return InstallStatus::ErrorFailedToOpenFile;
|
||||
|
|
Loading…
Reference in a new issue