ncch: Fix some issues with DecryptToFile

Now have byte-for-byte accuracy against Godmode9

Now uses a file instead of a path

Preliminary work to support non-executable files
This commit is contained in:
zhupengfei
2020-08-06 20:34:10 +08:00
parent c8f510188c
commit 13409503bf
3 changed files with 80 additions and 51 deletions
+2 -1
View File
@@ -56,6 +56,7 @@ struct NCCH_Header {
BitField<1, 1, u8> no_romfs;
BitField<2, 1, u8> no_crypto;
BitField<5, 1, u8> seed_crypto;
u8 raw_crypto_flags;
};
u32_le plain_region_offset;
u32_le plain_region_size;
@@ -271,7 +272,7 @@ public:
* Decrypts this NCCH and write to the destination file.
* @return ResultStatus result of function.
*/
ResultStatus DecryptToFile(const std::string& destination,
ResultStatus DecryptToFile(std::shared_ptr<FileUtil::IOFile> dest_file,
const ProgressCallback& callback = [](std::size_t, std::size_t) {});
/**