|
|
|
@ -110,13 +110,7 @@ void MainWindow::on_Raw_CMDHistoryWidget_itemDoubleClicked(QListWidgetItem *item
|
|
|
|
|
|
|
|
|
|
void MainWindow::on_MF_Attack_chkButton_clicked()
|
|
|
|
|
{
|
|
|
|
|
pm3->setRequiringOutput(true);
|
|
|
|
|
execCMD("hf mf chk *1 ?",false);
|
|
|
|
|
on_Raw_sendCMDButton_clicked();
|
|
|
|
|
while(pm3->waitForReadyRead())
|
|
|
|
|
;
|
|
|
|
|
QString result=pm3->getRequiredOutput();
|
|
|
|
|
pm3->setRequiringOutput(false);
|
|
|
|
|
QString result = execCMDWithOutput("hf mf chk *1 ?");
|
|
|
|
|
result = result.mid(result.indexOf("|---|----------------|----------------|"));
|
|
|
|
|
QStringList keys = result.split("\r\n");
|
|
|
|
|
for(int i = 0; i < 16; i++)
|
|
|
|
@ -129,12 +123,7 @@ void MainWindow::on_MF_Attack_chkButton_clicked()
|
|
|
|
|
|
|
|
|
|
void MainWindow::on_MF_Attack_nestedButton_clicked()
|
|
|
|
|
{
|
|
|
|
|
pm3->setRequiringOutput(true);
|
|
|
|
|
execCMD("hf mf nested 1 *",false);
|
|
|
|
|
while(pm3->waitForReadyRead())
|
|
|
|
|
;
|
|
|
|
|
QString result=pm3->getRequiredOutput();
|
|
|
|
|
pm3->setRequiringOutput(false);
|
|
|
|
|
QString result = execCMDWithOutput("hf mf nested 1 *");
|
|
|
|
|
result = result.mid(result.indexOf("|---|----------------|---|----------------|---|"));
|
|
|
|
|
QStringList keys = result.split("\r\n");
|
|
|
|
|
for(int i = 0; i < 16; i++)
|
|
|
|
@ -164,6 +153,58 @@ void MainWindow::on_MF_Attack_listButton_clicked()
|
|
|
|
|
execCMD("hf list mf", true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindow::on_MF_RW_readAllButton_clicked()
|
|
|
|
|
{
|
|
|
|
|
QString result;
|
|
|
|
|
int validkey;
|
|
|
|
|
const int waitTime=500;
|
|
|
|
|
for(int i = 0; i < 16; i++)
|
|
|
|
|
{
|
|
|
|
|
QApplication::processEvents();
|
|
|
|
|
result = "";
|
|
|
|
|
validkey = -1;
|
|
|
|
|
if(MF_isKeyValid(ui->MF_keyWidget->item(i, 1)->text()))
|
|
|
|
|
{
|
|
|
|
|
result = execCMDWithOutput("hf mf rdbl "
|
|
|
|
|
+ QString::number(4 * i)
|
|
|
|
|
+ " A "
|
|
|
|
|
+ ui->MF_keyWidget->item(i, 1)->text(),waitTime);
|
|
|
|
|
if(result.indexOf("isOk:01") != -1)
|
|
|
|
|
{
|
|
|
|
|
validkey = 1;
|
|
|
|
|
ui->MF_dataWidget->setItem(4 * i, 2,new QTableWidgetItem(result.mid(result.indexOf("isOk:01")+13, 47).toUpper()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(validkey == -1 && MF_isKeyValid(ui->MF_keyWidget->item(i, 2)->text()))
|
|
|
|
|
{
|
|
|
|
|
result = execCMDWithOutput("hf mf rdbl "
|
|
|
|
|
+ QString::number(4 * i)
|
|
|
|
|
+ " B "
|
|
|
|
|
+ ui->MF_keyWidget->item(i, 2)->text(),waitTime);
|
|
|
|
|
if(result.indexOf("isOk:01") != -1)
|
|
|
|
|
{
|
|
|
|
|
validkey = 2;
|
|
|
|
|
ui->MF_dataWidget->setItem(4 * i, 2,new QTableWidgetItem(result.mid(result.indexOf("isOk:01")+13, 47).toUpper()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(validkey!=-1)
|
|
|
|
|
{
|
|
|
|
|
for(int j = 1; j < 4; j++)
|
|
|
|
|
{
|
|
|
|
|
QApplication::processEvents();
|
|
|
|
|
result = execCMDWithOutput("hf mf rdbl "
|
|
|
|
|
+ QString::number(4 * i + j)
|
|
|
|
|
+ " "
|
|
|
|
|
+ (validkey==1?"A":"B")
|
|
|
|
|
+ " "
|
|
|
|
|
+ ui->MF_keyWidget->item(i, validkey)->text(),waitTime);
|
|
|
|
|
ui->MF_dataWidget->setItem(4 * i + j, 2,new QTableWidgetItem(result.mid(result.indexOf("isOk:01")+13, 47).toUpper()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ************************************************
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -246,4 +287,26 @@ void MainWindow::execCMD(QString cmd,bool gotoRawTab)
|
|
|
|
|
if(gotoRawTab)
|
|
|
|
|
ui->funcTab->setCurrentIndex(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString MainWindow::execCMDWithOutput(QString cmd, int msec)
|
|
|
|
|
{
|
|
|
|
|
pm3->setRequiringOutput(true);
|
|
|
|
|
execCMD(cmd, false);
|
|
|
|
|
while(pm3->waitForReadyRead(msec))
|
|
|
|
|
;
|
|
|
|
|
pm3->setRequiringOutput(false);
|
|
|
|
|
return pm3->getRequiredOutput();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool MainWindow::MF_isKeyValid(const QString key)
|
|
|
|
|
{
|
|
|
|
|
if(key.length() != 12)
|
|
|
|
|
return false;
|
|
|
|
|
for(int i = 0; i < 12; i++)
|
|
|
|
|
{
|
|
|
|
|
if(!((key[i] >= '0' && key[i] <= '9') || (key[i] >= 'A' && key[i] <= 'F')))
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
// ***********************************************
|
|
|
|
|