mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-20 20:49:12 +12:00
[Crypto] Slightly more robust error handling
This commit is contained in:
parent
0494ca0064
commit
3cf8427670
5 changed files with 41 additions and 34 deletions
|
@ -54,6 +54,14 @@ bool NCCH::loadFromHeader(Crypto::AESEngine &aesEngine, IOFile& file, const FSIn
|
|||
romFS.hashRegionSize = u64(*(u32*)&header[0x1B8]) * mediaUnit;
|
||||
|
||||
if (encrypted) {
|
||||
if (!aesEngine.haveKeys()) {
|
||||
Helpers::panic(
|
||||
"Loaded an encrypted ROM but AES keys don't seem to have been provided correctly! Navigate to the emulator's\n"
|
||||
"app data folder and make sure you have a sysdata directory with a file called aes_keys.txt which contains your keys!"
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
Crypto::AESKey primaryKeyY;
|
||||
Crypto::AESKey secondaryKeyY;
|
||||
std::memcpy(primaryKeyY.data(), header, primaryKeyY.size());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue