mirror of
https://github.com/wh201906/Proxmark3GUI.git
synced 2025-02-16 22:21:30 +08:00
Complete Mifare module
This commit is contained in:
parent
fe8b9d6161
commit
5816d1b1b6
@ -570,6 +570,17 @@ void Mifare::simulate()
|
|||||||
ui->funcTab->setCurrentIndex(1);
|
ui->funcTab->setCurrentIndex(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Mifare::loadSniff(const QString& file)
|
||||||
|
{
|
||||||
|
util->execCMD("hf list mf -l " + file);
|
||||||
|
ui->funcTab->setCurrentIndex(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Mifare::saveSniff(const QString& file)
|
||||||
|
{
|
||||||
|
util->execCMD("hf list mf -s " + file);
|
||||||
|
ui->funcTab->setCurrentIndex(1);
|
||||||
|
}
|
||||||
|
|
||||||
void Mifare::data_syncWithDataWidget(bool syncAll, int block)
|
void Mifare::data_syncWithDataWidget(bool syncAll, int block)
|
||||||
{
|
{
|
||||||
|
@ -110,6 +110,8 @@ public:
|
|||||||
void readAllE();
|
void readAllE();
|
||||||
void wipeE();
|
void wipeE();
|
||||||
void simulate();
|
void simulate();
|
||||||
|
void loadSniff(const QString& file);
|
||||||
|
void saveSniff(const QString& file);
|
||||||
public slots:
|
public slots:
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ MainWindow::MainWindow(QWidget *parent):
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
// ui->MF_simGroupBox->setVisible(false); // developing...
|
// ui->MF_simGroupBox->setVisible(false); // developing...
|
||||||
ui->MF_sniffGroupBox->setVisible(false); // developing...
|
// ui->MF_sniffGroupBox->setVisible(false); // developing...
|
||||||
myInfo = new QAction("wh201906", this);
|
myInfo = new QAction("wh201906", this);
|
||||||
connect(myInfo, &QAction::triggered, [ = ]()
|
connect(myInfo, &QAction::triggered, [ = ]()
|
||||||
{
|
{
|
||||||
@ -678,3 +678,46 @@ void MainWindow::on_MF_Sim_simButton_clicked()
|
|||||||
{
|
{
|
||||||
mifare->simulate();
|
mifare->simulate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::on_MF_Sniff_loadButton_clicked() // use a tmp file to support complicated path
|
||||||
|
{
|
||||||
|
QString title = "";
|
||||||
|
QString filename = "";
|
||||||
|
|
||||||
|
title = tr("Plz select the trace file:");
|
||||||
|
filename = QFileDialog::getOpenFileName(this, title, "./", tr("Trace Files(*.trc);;All Files(*.*)"));
|
||||||
|
qDebug() << filename;
|
||||||
|
if(filename != "")
|
||||||
|
{
|
||||||
|
QString tmpFile = "tmp" + QString::number(QDateTime::currentDateTime().toTime_t()) + ".trc";
|
||||||
|
if(QFile::copy(filename, "./" + tmpFile))
|
||||||
|
{
|
||||||
|
mifare->loadSniff(tmpFile);
|
||||||
|
QFile::remove("./" + tmpFile);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
QMessageBox::information(this, tr("Info"), tr("Failed to open") + "\n" + filename);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::on_MF_Sniff_saveButton_clicked()
|
||||||
|
{
|
||||||
|
QString title = "";
|
||||||
|
QString filename = "";
|
||||||
|
|
||||||
|
title = tr("Plz select the location to save trace file:");
|
||||||
|
filename = QFileDialog::getSaveFileName(this, title, "./", tr("Trace Files(*.trc)"));
|
||||||
|
qDebug() << filename;
|
||||||
|
if(filename != "")
|
||||||
|
{
|
||||||
|
QString tmpFile = "tmp" + QString::number(QDateTime::currentDateTime().toTime_t()) + ".trc";
|
||||||
|
mifare->saveSniff(tmpFile);
|
||||||
|
if(!QFile::copy("./" + tmpFile, filename))
|
||||||
|
{
|
||||||
|
QMessageBox::information(this, tr("Info"), tr("Failed to save to") + "\n" + filename);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
@ -128,6 +128,10 @@ private slots:
|
|||||||
|
|
||||||
void on_MF_Sim_simButton_clicked();
|
void on_MF_Sim_simButton_clicked();
|
||||||
|
|
||||||
|
void on_MF_Sniff_loadButton_clicked();
|
||||||
|
|
||||||
|
void on_MF_Sniff_saveButton_clicked();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::MainWindow* ui;
|
Ui::MainWindow* ui;
|
||||||
QButtonGroup* typeBtnGroup;
|
QButtonGroup* typeBtnGroup;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user