AES: Implement seed crypto

This commit is contained in:
wheremyfoodat
2024-07-30 14:29:18 +03:00
parent 908222f26f
commit f572373fc1
4 changed files with 151 additions and 57 deletions

View File

@@ -220,6 +220,8 @@ bool Emulator::loadROM(const std::filesystem::path& path) {
const std::filesystem::path appDataPath = getAppDataRoot();
const std::filesystem::path dataPath = appDataPath / path.filename().stem();
const std::filesystem::path aesKeysPath = appDataPath / "sysdata" / "aes_keys.txt";
const std::filesystem::path seedDBPath = appDataPath / "sysdata" / "seeddb.bin";
IOFile::setAppDataDir(dataPath);
// Open the text file containing our AES keys if it exists. We use the std::filesystem::exists overload that takes an error code param to
@@ -229,6 +231,10 @@ bool Emulator::loadROM(const std::filesystem::path& path) {
aesEngine.loadKeys(aesKeysPath);
}
if (std::filesystem::exists(seedDBPath, ec) && !ec) {
aesEngine.setSeedPath(seedDBPath);
}
kernel.initializeFS();
auto extension = path.extension();
bool success; // Tracks if we loaded the ROM successfully