mirror of
https://github.com/wh201906/Proxmark3GUI.git
synced 2026-07-14 22:55:32 +08:00
Refactor project structure
This commit is contained in:
@@ -0,0 +1,516 @@
|
||||
#include "mainwindow.h"
|
||||
#include "ui_mainwindow.h"
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent)
|
||||
: QMainWindow(parent)
|
||||
, ui(new Ui::MainWindow)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
pm3Thread=new QThread(this);
|
||||
pm3 = new PM3Process(pm3Thread);
|
||||
// pm3->moveToThread(pm3Thread);
|
||||
// pm3->init();
|
||||
pm3Thread->start();
|
||||
pm3state=false;
|
||||
|
||||
util = new Util(this);
|
||||
mifare = new Mifare(util,this);
|
||||
|
||||
|
||||
uiInit();
|
||||
signalInit();
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
delete ui;
|
||||
emit killPM3();
|
||||
pm3Thread->exit(0);
|
||||
pm3Thread->wait(5000);
|
||||
delete pm3;
|
||||
delete pm3Thread;
|
||||
}
|
||||
|
||||
// ******************** basic functions ********************
|
||||
|
||||
void MainWindow::on_PM3_refreshPortButton_clicked()
|
||||
{
|
||||
ui->PM3_portBox->clear();
|
||||
ui->PM3_portBox->addItem("");
|
||||
QSerialPort serial;
|
||||
QStringList serialList;
|
||||
foreach(const QSerialPortInfo &info, QSerialPortInfo::availablePorts())
|
||||
{
|
||||
qDebug()<<info.isBusy()<<info.isNull()<<info.portName();
|
||||
serial.setPort(info);
|
||||
|
||||
if(serial.open(QIODevice::ReadWrite))
|
||||
{
|
||||
serialList<<info.portName();
|
||||
serial.close();
|
||||
}
|
||||
}
|
||||
foreach(QString port, serialList)
|
||||
{
|
||||
ui->PM3_portBox->addItem(port);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_PM3_connectButton_clicked()
|
||||
{
|
||||
qDebug()<<"Main:"<<QThread::currentThread();
|
||||
QString port = ui->PM3_portBox->currentText();
|
||||
if(port == "")
|
||||
QMessageBox::information(NULL, "Info", "Plz choose a port first", QMessageBox::Ok);
|
||||
else
|
||||
{
|
||||
emit connectPM3(ui->PM3_pathEdit->text(), port);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::onPM3StateChanged(bool st, QString info)
|
||||
{
|
||||
pm3state=st;
|
||||
if(st==true)
|
||||
{
|
||||
setStatusBar(PM3VersionBar,info);
|
||||
setStatusBar(connectStatusBar,"Connected");
|
||||
}
|
||||
else
|
||||
{
|
||||
setStatusBar(connectStatusBar,"Not Connected");
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_PM3_disconnectButton_clicked()
|
||||
{
|
||||
pm3state=false;
|
||||
emit killPM3();
|
||||
emit setSerialListener("", false);
|
||||
setStatusBar(connectStatusBar,"Not Connected");
|
||||
}
|
||||
|
||||
// *********************************************************
|
||||
|
||||
// ******************** raw command ********************
|
||||
|
||||
void MainWindow::on_Raw_sendCMDButton_clicked()
|
||||
{
|
||||
execCMD(ui->Raw_CMDEdit->text());
|
||||
}
|
||||
|
||||
void MainWindow::on_Raw_clearOutputButton_clicked()
|
||||
{
|
||||
ui->Raw_outputEdit->clear();
|
||||
}
|
||||
|
||||
void MainWindow::on_Raw_CMDHistoryBox_stateChanged(int arg1)
|
||||
{
|
||||
if(arg1==Qt::Checked)
|
||||
{
|
||||
ui->Raw_CMDHistoryWidget->setVisible(true);
|
||||
ui->Raw_clearHistoryButton->setVisible(true);
|
||||
ui->Raw_CMDHistoryBox->setText("History:");
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->Raw_CMDHistoryWidget->setVisible(false);
|
||||
ui->Raw_clearHistoryButton->setVisible(false);
|
||||
ui->Raw_CMDHistoryBox->setText("");
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_Raw_clearHistoryButton_clicked()
|
||||
{
|
||||
ui->Raw_CMDHistoryWidget->clear();
|
||||
}
|
||||
|
||||
void MainWindow::on_Raw_CMDHistoryWidget_itemDoubleClicked(QListWidgetItem *item)
|
||||
{
|
||||
ui->Raw_CMDEdit->setText(item->text());
|
||||
ui->Raw_CMDEdit->setFocus();
|
||||
}
|
||||
|
||||
// *****************************************************
|
||||
|
||||
// ******************** mifare ********************
|
||||
|
||||
void MainWindow::on_MF_Attack_infoButton_clicked()
|
||||
{
|
||||
execCMD("hf 14a info", true);
|
||||
}
|
||||
|
||||
void MainWindow::on_MF_Attack_chkButton_clicked()
|
||||
{
|
||||
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++)
|
||||
{
|
||||
ui->MF_keyWidget->setItem(i, 1, new QTableWidgetItem(keys[i + 3].mid(7, 12).trimmed().toUpper()));
|
||||
ui->MF_keyWidget->setItem(i, 2, new QTableWidgetItem(keys[i + 3].mid(24, 12).trimmed().toUpper()));
|
||||
}
|
||||
qDebug() << "***********\n" << keys << "***********\n";
|
||||
}
|
||||
|
||||
void MainWindow::on_MF_Attack_nestedButton_clicked()
|
||||
{
|
||||
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++)
|
||||
{
|
||||
if(keys[i + 3].at(23) == '1')
|
||||
ui->MF_keyWidget->setItem(i, 1, new QTableWidgetItem(keys[i + 3].mid(7, 12).trimmed().toUpper()));
|
||||
if(keys[i + 3].at(44) == '1')
|
||||
ui->MF_keyWidget->setItem(i, 2, new QTableWidgetItem(keys[i + 3].mid(28, 12).trimmed().toUpper()));
|
||||
}
|
||||
qDebug() << "***********\n" << keys << "***********\n";
|
||||
}
|
||||
|
||||
void MainWindow::on_MF_Attack_hardnestedButton_clicked()
|
||||
{
|
||||
MF_Attack_hardnestedDialog dialog;
|
||||
connect(&dialog, &MF_Attack_hardnestedDialog::sendCMD, this, &MainWindow::execCMD);
|
||||
dialog.exec();
|
||||
}
|
||||
|
||||
void MainWindow::on_MF_Attack_sniffButton_clicked()
|
||||
{
|
||||
execCMD("hf mf sniff", true);
|
||||
}
|
||||
|
||||
void MainWindow::on_MF_Attack_listButton_clicked()
|
||||
{
|
||||
execCMD("hf list mf", true);
|
||||
}
|
||||
|
||||
void MainWindow::on_MF_RW_readAllButton_clicked()
|
||||
{
|
||||
QString result;
|
||||
bool isKeyAValid;
|
||||
bool isKeyBValid;
|
||||
const int waitTime = 500;
|
||||
for(int i = 0; i < 16; i++)
|
||||
{
|
||||
QApplication::processEvents();
|
||||
result = "";
|
||||
isKeyAValid = false;
|
||||
isKeyBValid = false;
|
||||
|
||||
// check keys and read the first block of each sector
|
||||
if(ui->MF_keyWidget->item(i, 1) != nullptr && 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)
|
||||
{
|
||||
isKeyAValid = true;
|
||||
ui->MF_dataWidget->setItem(4 * i, 2, new QTableWidgetItem(result.mid(result.indexOf("isOk:01") + 13, 47).toUpper()));
|
||||
}
|
||||
}
|
||||
QApplication::processEvents();
|
||||
if(ui->MF_keyWidget->item(i, 2) != nullptr && 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)
|
||||
{
|
||||
isKeyBValid = true;
|
||||
ui->MF_dataWidget->setItem(4 * i, 2, new QTableWidgetItem(result.mid(result.indexOf("isOk:01") + 13, 47).toUpper()));
|
||||
}
|
||||
}
|
||||
|
||||
// read the rest blocks of a sector
|
||||
if(isKeyAValid || isKeyBValid)
|
||||
{
|
||||
for(int j = 1; j < 4; j++)
|
||||
{
|
||||
QApplication::processEvents();
|
||||
result = execCMDWithOutput("hf mf rdbl "
|
||||
+ QString::number(4 * i + j)
|
||||
+ " "
|
||||
+ (isKeyAValid ? "A" : "B")
|
||||
+ " "
|
||||
+ ui->MF_keyWidget->item(i, (isKeyAValid ? 1 : 2))->text(), waitTime);
|
||||
result = result.mid(result.indexOf("isOk:01") + 13, 47).toUpper();
|
||||
ui->MF_dataWidget->setItem(4 * i + j, 2, new QTableWidgetItem(result));
|
||||
}
|
||||
|
||||
QApplication::processEvents();
|
||||
// fill the MF_dataWidget with the known valid key
|
||||
//
|
||||
// check whether the MF_dataWidget contains the valid key,
|
||||
// and fill MF_keyWidget(when you only have KeyA but the ReadBlock output contains the KeyB)
|
||||
//
|
||||
// the structure is not symmetric, since you cannot get KeyA from output
|
||||
// this program will only process the provided KeyA(in MF_keyWidget)
|
||||
result = ui->MF_dataWidget->item(4 * i + 3, 2)->text();
|
||||
if(isKeyAValid)
|
||||
{
|
||||
for(int j = 0; j < 6; j++)
|
||||
{
|
||||
result = result.replace(j * 3, 2, ui->MF_keyWidget->item(i, 1)->text().mid(j * 2, 2));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
result = result.replace(0, 18, "?? ?? ?? ?? ?? ?? ");
|
||||
}
|
||||
ui->MF_dataWidget->setItem(4 * i + 3, 2, new QTableWidgetItem(result));
|
||||
|
||||
if(isKeyBValid)
|
||||
{
|
||||
for(int j = 0; j < 6; j++)
|
||||
{
|
||||
result = result.replace(30 + j * 3, 2, ui->MF_keyWidget->item(i, 2)->text().mid(j * 2, 2));
|
||||
ui->MF_dataWidget->setItem(4 * i + 3, 2, new QTableWidgetItem(result));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
QString tmpKey = result.right(18).replace(" ", "");
|
||||
result = execCMDWithOutput("hf mf rdbl "
|
||||
+ QString::number(4 * i + 3)
|
||||
+ " B "
|
||||
+ tmpKey, waitTime);
|
||||
if(result.indexOf("isOk:01") != -1)
|
||||
{
|
||||
ui->MF_keyWidget->setItem(i, 2, new QTableWidgetItem(tmpKey));
|
||||
}
|
||||
else
|
||||
{
|
||||
result = ui->MF_dataWidget->item(4 * i + 3, 2)->text();
|
||||
result = result.replace(30, 17, "?? ?? ?? ?? ?? ??");
|
||||
ui->MF_dataWidget->setItem(4 * i + 3, 2, new QTableWidgetItem(result));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void MainWindow::on_MF_RW_readBlockButton_clicked()
|
||||
{
|
||||
QString result = execCMDWithOutput("hf mf rdbl "
|
||||
+ ui->MF_RW_blockBox->currentText()
|
||||
+ " "
|
||||
+ ui->MF_RW_keyTypeBox->currentText()
|
||||
+ " "
|
||||
+ ui->MF_RW_keyEdit->text());
|
||||
if(result.indexOf("isOk:01") != -1)
|
||||
{
|
||||
result = result.mid(result.indexOf("isOk:01") + 13, 47).toUpper();
|
||||
if((ui->MF_RW_blockBox->currentText().toInt() + 1) % 4 == 0)
|
||||
{
|
||||
if(ui->MF_RW_keyTypeBox->currentText() == "A")
|
||||
{
|
||||
for(int i = 0; i < 6; i++)
|
||||
{
|
||||
result = result.replace(i * 3, 2, ui->MF_RW_keyEdit->text().mid(i * 2, 2));
|
||||
}
|
||||
ui->MF_RW_dataEdit->setText(result);
|
||||
QString tmpKey = result.right(18).replace(" ", "");
|
||||
result = execCMDWithOutput("hf mf rdbl "
|
||||
+ ui->MF_RW_keyTypeBox->currentText()
|
||||
+ " B "
|
||||
+ tmpKey);
|
||||
if(result.indexOf("isOk:01") == -1)
|
||||
{
|
||||
result = ui->MF_RW_dataEdit->text();
|
||||
result = result.replace(30, 17, "?? ?? ?? ?? ?? ??");
|
||||
ui->MF_RW_dataEdit->setText(result);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for(int i = 0; i < 6; i++)
|
||||
{
|
||||
result = result.replace(30 + i * 3, 2, ui->MF_RW_keyEdit->text().mid(i * 2, 2));
|
||||
}
|
||||
result = result.replace(0, 18, "?? ?? ?? ?? ?? ?? ");
|
||||
ui->MF_RW_dataEdit->setText(result);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_MF_RW_writeBlockButton_clicked()
|
||||
{
|
||||
QString result = execCMDWithOutput("hf mf wrbl "
|
||||
+ ui->MF_RW_blockBox->currentText()
|
||||
+ " "
|
||||
+ ui->MF_RW_keyTypeBox->currentText()
|
||||
+ " "
|
||||
+ ui->MF_RW_keyEdit->text()
|
||||
+ " "
|
||||
+ ui->MF_RW_dataEdit->text().replace(" ", ""));
|
||||
if(result.indexOf("isOk:01") != -1)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_MF_RW_writeAllButton_clicked()
|
||||
{
|
||||
QString result;
|
||||
for(int i = 0; i < 16; i++)
|
||||
{
|
||||
for(int j = 0; j < 4; j++)
|
||||
{
|
||||
result = execCMDWithOutput("hf mf wrbl "
|
||||
+ QString::number(i * 4 + j)
|
||||
+ " A "
|
||||
+ ui->MF_keyWidget->item(i, 1)->text()
|
||||
+ " "
|
||||
+ ui->MF_dataWidget->item(2, i * 4 + j)->text().replace(" ", ""));
|
||||
if(result.indexOf("isOk:01") == -1)
|
||||
{
|
||||
result = execCMDWithOutput("hf mf wrbl "
|
||||
+ QString::number(i * 4 + j)
|
||||
+ " B "
|
||||
+ ui->MF_keyWidget->item(i, 2)->text()
|
||||
+ " "
|
||||
+ ui->MF_dataWidget->item(2, i * 4 + j)->text().replace(" ", ""));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************
|
||||
|
||||
|
||||
// ******************** other ********************
|
||||
|
||||
void MainWindow::refresh()
|
||||
{
|
||||
QString btay = pm3->readLine();
|
||||
while(btay != "")
|
||||
{
|
||||
qDebug() << btay;
|
||||
ui->Raw_outputEdit->insertPlainText(btay);
|
||||
btay = pm3->readLine();
|
||||
}
|
||||
ui->Raw_outputEdit->moveCursor(QTextCursor::End);
|
||||
}
|
||||
|
||||
void MainWindow::sendMSG()
|
||||
{
|
||||
if(ui->Raw_CMDEdit->hasFocus())
|
||||
on_Raw_sendCMDButton_clicked();
|
||||
}
|
||||
|
||||
void MainWindow::uiInit()
|
||||
{
|
||||
connect(ui->Raw_CMDEdit, &QLineEdit::editingFinished, this, &MainWindow::sendMSG);
|
||||
|
||||
connectStatusBar = new QLabel(this);
|
||||
programStatusBar = new QLabel(this);
|
||||
PM3VersionBar = new QLabel(this);
|
||||
setStatusBar(connectStatusBar, "Not Connected");
|
||||
setStatusBar(programStatusBar, "Idle");
|
||||
setStatusBar(PM3VersionBar, "");
|
||||
ui->statusbar->addPermanentWidget(PM3VersionBar, 1);
|
||||
ui->statusbar->addPermanentWidget(connectStatusBar, 1);
|
||||
ui->statusbar->addPermanentWidget(programStatusBar, 1);
|
||||
|
||||
ui->MF_dataWidget->setColumnCount(3);
|
||||
ui->MF_dataWidget->setRowCount(64);
|
||||
ui->MF_dataWidget->setHorizontalHeaderItem(0, new QTableWidgetItem("Sector"));
|
||||
ui->MF_dataWidget->setHorizontalHeaderItem(1, new QTableWidgetItem("Block"));
|
||||
ui->MF_dataWidget->setHorizontalHeaderItem(2, new QTableWidgetItem("Data"));
|
||||
for(int i = 0; i < 64; i++)
|
||||
ui->MF_dataWidget->setItem(i, 1, new QTableWidgetItem(QString::number(i)));
|
||||
for(int i = 0; i < 16; i++)
|
||||
ui->MF_dataWidget->setItem(i * 4, 0, new QTableWidgetItem(QString::number(i)));
|
||||
ui->MF_dataWidget->verticalHeader()->setVisible(false);
|
||||
ui->MF_dataWidget->setColumnWidth(0, 50);
|
||||
ui->MF_dataWidget->setColumnWidth(1, 40);
|
||||
ui->MF_dataWidget->setColumnWidth(2, 400);
|
||||
|
||||
ui->MF_keyWidget->setColumnCount(3);
|
||||
ui->MF_keyWidget->setRowCount(16);
|
||||
ui->MF_keyWidget->setHorizontalHeaderItem(0, new QTableWidgetItem("Sector"));
|
||||
ui->MF_keyWidget->setHorizontalHeaderItem(1, new QTableWidgetItem("KeyA"));
|
||||
ui->MF_keyWidget->setHorizontalHeaderItem(2, new QTableWidgetItem("KeyB"));
|
||||
for(int i = 0; i < 16; i++)
|
||||
ui->MF_keyWidget->setItem(i, 0, new QTableWidgetItem(QString::number(i)));
|
||||
ui->MF_keyWidget->verticalHeader()->setVisible(false);
|
||||
ui->MF_keyWidget->setColumnWidth(0, 50);
|
||||
ui->MF_keyWidget->setColumnWidth(1, 200);
|
||||
ui->MF_keyWidget->setColumnWidth(2, 200);
|
||||
|
||||
for(int i = 0; i < 64; i++)
|
||||
{
|
||||
ui->MF_RW_blockBox->addItem(QString::number(i));
|
||||
ui->MF_UID_blockBox->addItem(QString::number(i));
|
||||
}
|
||||
|
||||
on_Raw_CMDHistoryBox_stateChanged(Qt::Unchecked);
|
||||
on_PM3_refreshPortButton_clicked();
|
||||
}
|
||||
|
||||
void MainWindow::signalInit()
|
||||
{
|
||||
// connect(pm3, &PM3Process::readyRead, util, &MainWindow::refresh);
|
||||
|
||||
connect(this,&MainWindow::requiringOutput,pm3,&PM3Process::setRequiringOutput);
|
||||
connect(this,&MainWindow::connectPM3,pm3,&PM3Process::connectPM3);
|
||||
connect(pm3, &PM3Process::PM3StatedChanged, this, &MainWindow::onPM3StateChanged);
|
||||
connect(this,&MainWindow::killPM3,pm3,&PM3Process::kill);
|
||||
|
||||
connect(this,&MainWindow::write,pm3,&PM3Process::write);
|
||||
}
|
||||
|
||||
void MainWindow::setStatusBar(QLabel* target, const QString & text)
|
||||
{
|
||||
if(target == PM3VersionBar)
|
||||
target->setText("HW Version:" + text);
|
||||
else if(target == connectStatusBar)
|
||||
target->setText("Connecton State:" + text);
|
||||
else if(target == programStatusBar)
|
||||
target->setText("Program State:" + text);
|
||||
}
|
||||
|
||||
void MainWindow::execCMD(QString cmd, bool gotoRawTab)
|
||||
{
|
||||
ui->Raw_CMDEdit->setText(cmd);
|
||||
if(ui->Raw_CMDHistoryWidget->count() == 0 || ui->Raw_CMDHistoryWidget->item(ui->Raw_CMDHistoryWidget->count() - 1)->text() != cmd)
|
||||
ui->Raw_CMDHistoryWidget->addItem(cmd);
|
||||
qDebug() << cmd;
|
||||
emit write(cmd + "\r\n");
|
||||
if(gotoRawTab)
|
||||
ui->funcTab->setCurrentIndex(1);
|
||||
}
|
||||
|
||||
QString MainWindow::execCMDWithOutput(QString cmd, int msec)
|
||||
{
|
||||
emit requiringOutput(true);
|
||||
execCMD(cmd);
|
||||
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;
|
||||
}
|
||||
// ***********************************************
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
#ifndef MAINWINDOW_H
|
||||
#define MAINWINDOW_H
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QThread>
|
||||
#include <QProcess>
|
||||
#include <QDebug>
|
||||
#include <QMessageBox>
|
||||
#include <QListWidgetItem>
|
||||
#include <QtSerialPort/QSerialPortInfo>
|
||||
#include <QtSerialPort/QSerialPort>
|
||||
|
||||
#include "common/pm3process.h"
|
||||
#include "module/mifare.h"
|
||||
#include "common/util.h"
|
||||
#include "ui/mf_attack_hardnesteddialog.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace Ui { class MainWindow; }
|
||||
QT_END_NAMESPACE
|
||||
|
||||
class MainWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MainWindow(QWidget *parent = nullptr);
|
||||
~MainWindow();
|
||||
|
||||
bool MF_isKeyValid(const QString key);
|
||||
QString execCMDWithOutput(QString cmd, int msec=2000);
|
||||
public slots:
|
||||
void refresh();
|
||||
void setStatusBar(QLabel* target,const QString & text);
|
||||
void execCMD(QString cmd, bool gotoRawTab=false);
|
||||
void onPM3StateChanged(bool st, QString info);
|
||||
private slots:
|
||||
|
||||
void on_PM3_connectButton_clicked();
|
||||
|
||||
void on_Raw_sendCMDButton_clicked();
|
||||
|
||||
void on_PM3_disconnectButton_clicked();
|
||||
|
||||
void on_Raw_clearOutputButton_clicked();
|
||||
|
||||
void sendMSG();
|
||||
void on_PM3_refreshPortButton_clicked();
|
||||
|
||||
void on_Raw_CMDHistoryBox_stateChanged(int arg1);
|
||||
|
||||
void on_Raw_clearHistoryButton_clicked();
|
||||
|
||||
void on_Raw_CMDHistoryWidget_itemDoubleClicked(QListWidgetItem *item);
|
||||
|
||||
void on_MF_Attack_chkButton_clicked();
|
||||
|
||||
void on_MF_Attack_nestedButton_clicked();
|
||||
|
||||
void on_MF_Attack_hardnestedButton_clicked();
|
||||
|
||||
void on_MF_Attack_sniffButton_clicked();
|
||||
|
||||
void on_MF_Attack_listButton_clicked();
|
||||
|
||||
void on_MF_RW_readAllButton_clicked();
|
||||
|
||||
void on_MF_RW_readBlockButton_clicked();
|
||||
|
||||
void on_MF_RW_writeBlockButton_clicked();
|
||||
|
||||
void on_MF_Attack_infoButton_clicked();
|
||||
|
||||
void on_MF_RW_writeAllButton_clicked();
|
||||
|
||||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
PM3Process* pm3;
|
||||
bool pm3state;
|
||||
QThread* pm3Thread;
|
||||
Mifare* mifare;
|
||||
Util* util;
|
||||
void uiInit();
|
||||
QLabel* connectStatusBar;
|
||||
QLabel* programStatusBar;
|
||||
QLabel* PM3VersionBar;
|
||||
void signalInit();
|
||||
signals:
|
||||
void requiringOutput(bool st);
|
||||
void connectPM3(const QString path, const QString port);
|
||||
void killPM3();
|
||||
void setSerialListener(const QString &name, bool state);
|
||||
void write(QString data);
|
||||
};
|
||||
#endif // MAINWINDOW_H
|
||||
@@ -0,0 +1,980 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>787</width>
|
||||
<height>770</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>450</width>
|
||||
<height>300</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Proxmark3GUI</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetMaximumSize</enum>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Path:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="PM3_pathEdit">
|
||||
<property name="text">
|
||||
<string>E:\Documents\source\qt\pm3\win64\proxmark3</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="PM3_portBox">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="PM3_refreshPortButton">
|
||||
<property name="text">
|
||||
<string>Refresh</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="PM3_connectButton">
|
||||
<property name="text">
|
||||
<string>Connect</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="PM3_disconnectButton">
|
||||
<property name="text">
|
||||
<string>Disconnect</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTabWidget" name="funcTab">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="mifareTab">
|
||||
<attribute name="title">
|
||||
<string>Mifare</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QTableWidget" name="MF_dataWidget">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>2</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<attribute name="verticalHeaderMinimumSectionSize">
|
||||
<number>20</number>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderDefaultSectionSize">
|
||||
<number>20</number>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTableWidget" name="MF_keyWidget">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>1</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<attribute name="verticalHeaderMinimumSectionSize">
|
||||
<number>20</number>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderDefaultSectionSize">
|
||||
<number>20</number>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="MF_attackGroupBox">
|
||||
<property name="title">
|
||||
<string>Attack</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="MF_Attack_infoButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Card Info</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="MF_Attack_chkButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Check Default</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="MF_Attack_nestedButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Nested</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="MF_Attack_hardnestedButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Hardnested</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="MF_Attack_sniffButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Sniff</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="MF_Attack_listButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>List Sniff Data</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="MF_RWGroupBox">
|
||||
<property name="title">
|
||||
<string>Read/Write</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_8">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_8">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="MF_RW_readAllButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Read All</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="MF_RW_writeAllButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Write All</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="MF_RW_dumpButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Dump</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="MF_RW_restoreButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Restore</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_9">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_12">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Block:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="MF_RW_blockBox">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="editable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Key:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="MF_RW_keyEdit">
|
||||
<property name="text">
|
||||
<string>FFFFFFFFFFFF</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Key Type:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="MF_RW_keyTypeBox">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>35</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>35</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>A</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>B</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="MF_RW_readBlockButton">
|
||||
<property name="text">
|
||||
<string>Read Block</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="MF_RW_writeBlockButton">
|
||||
<property name="text">
|
||||
<string>Write Block</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_10">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="MF_RW_dataEdit"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="MF_UIDGroupBox">
|
||||
<property name="title">
|
||||
<string>Chinese Magic Card(UID Card)</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_9">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_11">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="MF_UID_readAllButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Read All</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="MF_UID_writeAllButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Write All</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="MF_UID_wipeButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Wipe</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="MF_UID_writeUIDButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Write UID</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Lock UFUID Card</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_2">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>About UID Card</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_12">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_13">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>Block:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="MF_UID_blockBox">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="editable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="MF_UID_readBlockButton">
|
||||
<property name="text">
|
||||
<string>Read Block</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="MF_UID_writeBlockButton">
|
||||
<property name="text">
|
||||
<string>Write Block</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_13">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="MF_UID_dataEdit"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="MF_simGroupBox">
|
||||
<property name="title">
|
||||
<string>Simulate</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_11">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="MF_Sim_loadFileButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Load from .eml</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="MF_Sim_loadDataButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Load from data above</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="MF_Sim_clearButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Clear</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="MF_Sim_simButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Simulate</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_6">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="rawTab">
|
||||
<attribute name="title">
|
||||
<string>RawCommand</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||
<item>
|
||||
<widget class="QPlainTextEdit" name="Raw_outputEdit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>2</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="verticalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAlwaysOn</enum>
|
||||
</property>
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QAbstractScrollArea::AdjustIgnored</enum>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="Raw_CMDHistoryBox">
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>History:</string>
|
||||
</property>
|
||||
<property name="tristate">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QListWidget" name="Raw_CMDHistoryWidget">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>1</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="Raw_clearHistoryButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>ClearHistory</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetMaximumSize</enum>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="Raw_CMDEdit"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="Raw_sendCMDButton">
|
||||
<property name="text">
|
||||
<string>Send</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="Raw_clearOutputButton">
|
||||
<property name="text">
|
||||
<string>ClearOutput</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>787</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar">
|
||||
<property name="sizeGripEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -0,0 +1,34 @@
|
||||
#include "mf_attack_hardnesteddialog.h"
|
||||
#include "ui_mf_attack_hardnesteddialog.h"
|
||||
|
||||
MF_Attack_hardnestedDialog::MF_Attack_hardnestedDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::MF_Attack_hardnestedDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
for(int i=0;i<64;i++)
|
||||
{
|
||||
ui->knownKeySectorBox->addItem(QString::number(i));
|
||||
ui->targetKeySectorBox->addItem(QString::number(i));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
MF_Attack_hardnestedDialog::~MF_Attack_hardnestedDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void MF_Attack_hardnestedDialog::on_buttonBox_accepted()
|
||||
{
|
||||
emit sendCMD("hf mf hardnested "
|
||||
+ui->knownKeySectorBox->currentText()
|
||||
+" "
|
||||
+ui->knownKeyTypeBox->currentText()
|
||||
+" "
|
||||
+ui->knownKeyBox->text()
|
||||
+" "
|
||||
+ui->targetKeySectorBox->currentText()
|
||||
+" "
|
||||
+ui->targetKeyTypeBox->currentText());
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
#ifndef MF_ATTACK_HARDNESTEDDIALOG_H
|
||||
#define MF_ATTACK_HARDNESTEDDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class MF_Attack_hardnestedDialog;
|
||||
}
|
||||
|
||||
class MF_Attack_hardnestedDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit MF_Attack_hardnestedDialog(QWidget *parent = nullptr);
|
||||
~MF_Attack_hardnestedDialog();
|
||||
|
||||
|
||||
private:
|
||||
Ui::MF_Attack_hardnestedDialog *ui;
|
||||
signals:
|
||||
void sendCMD(QString cmd, bool requireJump = true);
|
||||
private slots:
|
||||
void on_buttonBox_accepted();
|
||||
};
|
||||
|
||||
#endif // MF_ATTACK_HARDNESTEDDIALOG_H
|
||||
@@ -0,0 +1,223 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MF_Attack_hardnestedDialog</class>
|
||||
<widget class="QDialog" name="MF_Attack_hardnestedDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>287</width>
|
||||
<height>173</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Known Key:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Block:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="knownKeySectorBox">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="editable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="knownKeyTypeBox">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>35</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>35</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>A</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>B</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="knownKeyBox">
|
||||
<property name="text">
|
||||
<string>FFFFFFFFFFFF</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Target Key: </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Block:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="targetKeySectorBox">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="editable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="targetKeyTypeBox">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>35</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>35</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>A</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>B</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>31</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>MF_Attack_hardnestedDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>MF_Attack_hardnestedDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
Reference in New Issue
Block a user