core: Add DecryptToFile in NCCHContainer

This commit is contained in:
zhupengfei
2020-05-01 11:59:24 +08:00
parent e4c3588aa1
commit c27589ce53
5 changed files with 170 additions and 25 deletions
+2 -2
View File
@@ -59,9 +59,9 @@ bool SDMCDecryptor::DecryptAndWriteFile(const std::string& source, const std::st
return false;
}
auto source_file = std::make_unique<FileUtil::IOFile>(root_folder + source, "rb");
auto source_file = std::make_shared<FileUtil::IOFile>(root_folder + source, "rb");
auto size = source_file->GetSize();
auto destination_file = std::make_unique<FileUtil::IOFile>(destination, "wb");
auto destination_file = std::make_shared<FileUtil::IOFile>(destination, "wb");
auto key = Key::GetNormalKey(Key::SDKey);
auto ctr = GetFileCTR(source);
return quick_decryptor.DecryptAndWriteFile(std::move(source_file), size,