diff --git a/module/mifare.cpp b/module/mifare.cpp
index a6960ee..de253ed 100644
--- a/module/mifare.cpp
+++ b/module/mifare.cpp
@@ -1049,3 +1049,19 @@ void Mifare::data_setKey(int sector, KeyType keyType, const QString &key)
else
keyBList->replace(sector, key);
}
+
+void Mifare::data_fillKeys()
+{
+ for(int i = 0; i < cardType.sectors; i++)
+ {
+ if(!data_isKeyValid(keyAList->at(i)))
+ {
+ keyAList->replace(i, "FFFFFFFFFFFF");
+ }
+ if(!data_isKeyValid(keyBList->at(i)))
+ {
+ keyBList->replace(i, "FFFFFFFFFFFF");
+ }
+ }
+ data_syncWithKeyWidget();
+}
diff --git a/module/mifare.h b/module/mifare.h
index c496b1e..ddc4011 100644
--- a/module/mifare.h
+++ b/module/mifare.h
@@ -118,6 +118,7 @@ public:
void simulate();
void loadSniff(const QString& file);
void saveSniff(const QString& file);
+ void data_fillKeys();
public slots:
signals:
diff --git a/ui/mainwindow.cpp b/ui/mainwindow.cpp
index b93ff86..4464ca8 100644
--- a/ui/mainwindow.cpp
+++ b/ui/mainwindow.cpp
@@ -223,16 +223,21 @@ void MainWindow::on_MF_checkAllBox_stateChanged(int arg1)
ui->MF_checkAllBox->blockSignals(false);
}
-void MainWindow::on_MF_data2KeyBotton_clicked()
+void MainWindow::on_MF_data2KeyButton_clicked()
{
mifare->data_data2Key();
}
-void MainWindow::on_MF_key2DataBotton_clicked()
+void MainWindow::on_MF_key2DataButton_clicked()
{
mifare->data_key2Data();
}
+void MainWindow::on_MF_fillKeysButton_clicked()
+{
+ mifare->data_fillKeys();
+}
+
void MainWindow::on_MF_fontButton_clicked()
{
bool isOK = false;
diff --git a/ui/mainwindow.h b/ui/mainwindow.h
index 0fb94b3..37d89b1 100644
--- a/ui/mainwindow.h
+++ b/ui/mainwindow.h
@@ -103,9 +103,9 @@ private slots:
void on_MF_File_saveButton_clicked();
- void on_MF_data2KeyBotton_clicked();
+ void on_MF_data2KeyButton_clicked();
- void on_MF_key2DataBotton_clicked();
+ void on_MF_key2DataButton_clicked();
void on_MF_dataWidget_itemChanged(QTableWidgetItem *item);
@@ -139,6 +139,8 @@ private slots:
void on_MF_checkAllBox_stateChanged(int arg1);
+ void on_MF_fillKeysButton_clicked();
+
private:
Ui::MainWindow* ui;
QButtonGroup* typeBtnGroup;
diff --git a/ui/mainwindow.ui b/ui/mainwindow.ui
index 5603ed5..d678bdb 100644
--- a/ui/mainwindow.ui
+++ b/ui/mainwindow.ui
@@ -193,23 +193,30 @@
-
-
+
- >>
+ KeyBlocks->Key
-
-
+
- <<
+ KeyBlocks<-Key
+
+
+
+ -
+
+
+ Fill Keys
-
- Fonts
+ Set Fonts