NANDImporter: Add support for dumps that don't include keys

This adds support for NAND images that only include the NAND
(i.e. without the OTP/SEEPROM dump appended at the end of the file).
This commit is contained in:
Léo Lam
2017-10-26 21:22:16 +02:00
parent 5d449c00e6
commit 96d7c39891
4 changed files with 56 additions and 20 deletions

View File

@ -51,6 +51,7 @@
#include "DolphinQt2/NetPlay/NetPlayDialog.h"
#include "DolphinQt2/NetPlay/NetPlaySetupDialog.h"
#include "DolphinQt2/QtUtils/QueueOnObject.h"
#include "DolphinQt2/QtUtils/RunOnObject.h"
#include "DolphinQt2/QtUtils/WindowActivationEventFilter.h"
#include "DolphinQt2/Resources.h"
#include "DolphinQt2/Settings.h"
@ -879,13 +880,24 @@ void MainWindow::OnImportNANDBackup()
auto beginning = QDateTime::currentDateTime().toMSecsSinceEpoch();
auto result = std::async(std::launch::async, [&] {
DiscIO::NANDImporter().ImportNANDBin(file.toStdString(), [&dialog, beginning] {
QueueOnObject(dialog, [&dialog, beginning] {
dialog->setLabelText(
tr("Importing NAND backup\n Time elapsed: %1s")
.arg((QDateTime::currentDateTime().toMSecsSinceEpoch() - beginning) / 1000));
});
});
DiscIO::NANDImporter().ImportNANDBin(
file.toStdString(),
[&dialog, beginning] {
QueueOnObject(dialog, [&dialog, beginning] {
dialog->setLabelText(
tr("Importing NAND backup\n Time elapsed: %1s")
.arg((QDateTime::currentDateTime().toMSecsSinceEpoch() - beginning) / 1000));
});
},
[this] {
return RunOnObject(this, [this] {
return QFileDialog::getOpenFileName(this, tr("Select the OTP/SEEPROM dump"),
QDir::currentPath(),
tr("BootMii OTP/SEEPROM dump (*.bin);;"
"All Files (*)"))
.toStdString();
});
});
QueueOnObject(dialog, &QProgressDialog::close);
});