Save client path automatically

pull/4/head
wh201906 4 years ago
parent 7dfabb60e9
commit 7e4dedeff1

@ -297,7 +297,7 @@ QString Mifare::_readblk(int blockId, KeyType keyType, const QString& key, int w
data.remove(" "); data.remove(" ");
// when the target block is a key block and the given key type is KeyA, try to check whether the KeyB is valid(by Access Bits) // when the target block is a key block and the given key type is KeyA, try to check whether the KeyB is valid(by Access Bits)
// if the given key type is KeyB, it will never get the KeyA from the key block // if the given key type is KeyB, it will never get the KeyA from the key block
if(isKeyBlock && keyType == KEY_A) if(isKeyBlock && keyType == KEY_A) // in this case, the Access Bits is always accessible
{ {
data.replace(0, 12, key); data.replace(0, 12, key);
QList<quint8> ACBits = data_getACBits(data.mid(12, 8)); QList<quint8> ACBits = data_getACBits(data.mid(12, 8));

@ -77,6 +77,7 @@ void MainWindow::on_PM3_connectButton_clicked()
QMessageBox::information(NULL, tr("Info"), tr("Plz choose a port first"), QMessageBox::Ok); QMessageBox::information(NULL, tr("Info"), tr("Plz choose a port first"), QMessageBox::Ok);
else else
{ {
saveClientPath(ui->PM3_pathEdit->text());
emit connectPM3(ui->PM3_pathEdit->text(), port); emit connectPM3(ui->PM3_pathEdit->text(), port);
} }
} }
@ -237,6 +238,12 @@ void MainWindow::on_MF_fillKeysButton_clicked()
mifare->data_fillKeys(); mifare->data_fillKeys();
} }
void MainWindow::on_MF_trailerDecoderButton_clicked()
{
decDialog = new MF_trailerDecoderDialog(this);
decDialog->show();
}
void MainWindow::on_MF_fontButton_clicked() void MainWindow::on_MF_fontButton_clicked()
{ {
bool isOK = false; bool isOK = false;
@ -773,6 +780,10 @@ void MainWindow::uiInit()
} }
settings->endGroup(); settings->endGroup();
settings->beginGroup("Client_Path");
ui->PM3_pathEdit->setText(settings->value("path", "proxmark3").toString());
settings->endGroup();
ui->MF_RW_keyTypeBox->addItem("A", Mifare::KEY_A); ui->MF_RW_keyTypeBox->addItem("A", Mifare::KEY_A);
ui->MF_RW_keyTypeBox->addItem("B", Mifare::KEY_B); ui->MF_RW_keyTypeBox->addItem("B", Mifare::KEY_B);
@ -896,6 +907,12 @@ void MainWindow::on_GroupBox_clicked(bool checked)
settings->endGroup(); settings->endGroup();
} }
void MainWindow::saveClientPath(const QString& path)
{
settings->beginGroup("Client_Path");
settings->setValue("path", path);
settings->endGroup();
}
// *********************************************** // ***********************************************
@ -904,9 +921,3 @@ void MainWindow::on_testButton_clicked()
{ {
mifare->_readsec(0, Mifare::KEY_A, "FFFFFFFFFFFF"); mifare->_readsec(0, Mifare::KEY_A, "FFFFFFFFFFFF");
} }
void MainWindow::on_MF_trailerDecoderButton_clicked()
{
decDialog = new MF_trailerDecoderDialog(this);
decDialog->show();
}

@ -173,6 +173,7 @@ private:
void MF_widgetReset(); void MF_widgetReset();
void setTableItem(QTableWidget *widget, int row, int column, const QString &text); void setTableItem(QTableWidget *widget, int row, int column, const QString &text);
void setState(bool st); void setState(bool st);
void saveClientPath(const QString &path);
signals: signals:
void connectPM3(const QString path, const QString port); void connectPM3(const QString path, const QString port);
void killPM3(); void killPM3();

@ -58,11 +58,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLineEdit" name="PM3_pathEdit"> <widget class="QLineEdit" name="PM3_pathEdit"/>
<property name="text">
<string notr="true">../pm3/iceman-64/win64/proxmark3</string>
</property>
</widget>
</item> </item>
<item> <item>
<widget class="QComboBox" name="PM3_portBox"> <widget class="QComboBox" name="PM3_portBox">

Loading…
Cancel
Save