2020-04-06 23:48:08 +08:00
|
|
|
|
#ifndef MAINWINDOW_H
|
|
|
|
|
#define MAINWINDOW_H
|
|
|
|
|
|
|
|
|
|
#include <QMainWindow>
|
2020-04-21 19:12:44 +08:00
|
|
|
|
#include <QThread>
|
2020-04-06 23:48:08 +08:00
|
|
|
|
#include <QProcess>
|
|
|
|
|
#include <QDebug>
|
2020-04-07 18:16:00 +08:00
|
|
|
|
#include <QMessageBox>
|
2020-04-08 18:18:53 +08:00
|
|
|
|
#include <QListWidgetItem>
|
2020-04-21 19:12:44 +08:00
|
|
|
|
#include <QtSerialPort/QSerialPortInfo>
|
|
|
|
|
#include <QtSerialPort/QSerialPort>
|
|
|
|
|
|
2020-04-06 23:48:08 +08:00
|
|
|
|
#include "pm3process.h"
|
2020-04-07 23:57:56 +08:00
|
|
|
|
#include "mifare.h"
|
2020-04-15 00:38:43 +08:00
|
|
|
|
#include "mf_attack_hardnesteddialog.h"
|
2020-04-06 23:48:08 +08:00
|
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
namespace Ui { class MainWindow; }
|
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
|
|
|
|
class MainWindow : public QMainWindow
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
MainWindow(QWidget *parent = nullptr);
|
|
|
|
|
~MainWindow();
|
|
|
|
|
|
2020-04-16 00:39:10 +08:00
|
|
|
|
bool MF_isKeyValid(const QString key);
|
|
|
|
|
QString execCMDWithOutput(QString cmd, int msec=2000);
|
2020-04-07 18:16:00 +08:00
|
|
|
|
public slots:
|
|
|
|
|
void refresh();
|
2020-04-13 15:54:37 +08:00
|
|
|
|
void setStatusBar(QLabel* target,const QString & text);
|
2020-04-15 00:38:43 +08:00
|
|
|
|
void execCMD(QString cmd, bool gotoRawTab);
|
2020-04-21 19:12:44 +08:00
|
|
|
|
void onPM3StateChanged(bool st, QString info);
|
2020-04-06 23:48:08 +08:00
|
|
|
|
private slots:
|
|
|
|
|
|
2020-04-13 15:54:37 +08:00
|
|
|
|
void on_PM3_connectButton_clicked();
|
2020-04-06 23:48:08 +08:00
|
|
|
|
|
2020-04-13 15:54:37 +08:00
|
|
|
|
void on_Raw_sendCMDButton_clicked();
|
2020-04-06 23:48:08 +08:00
|
|
|
|
|
2020-04-13 15:54:37 +08:00
|
|
|
|
void on_PM3_disconnectButton_clicked();
|
|
|
|
|
|
|
|
|
|
void on_Raw_clearOutputButton_clicked();
|
2020-04-07 18:16:00 +08:00
|
|
|
|
|
|
|
|
|
void sendMSG();
|
2020-04-13 15:54:37 +08:00
|
|
|
|
void on_PM3_refreshPortButton_clicked();
|
|
|
|
|
|
|
|
|
|
void on_Raw_moreFuncCheckBox_stateChanged(int arg1);
|
|
|
|
|
|
|
|
|
|
void on_Raw_clearHistoryButton_clicked();
|
|
|
|
|
|
|
|
|
|
void on_Raw_CMDHistoryWidget_itemDoubleClicked(QListWidgetItem *item);
|
2020-04-07 23:57:56 +08:00
|
|
|
|
|
2020-04-13 15:54:37 +08:00
|
|
|
|
void on_MF_Attack_chkButton_clicked();
|
2020-04-08 18:18:53 +08:00
|
|
|
|
|
2020-04-13 15:54:37 +08:00
|
|
|
|
void on_MF_Attack_nestedButton_clicked();
|
2020-04-08 18:18:53 +08:00
|
|
|
|
|
2020-04-13 15:54:37 +08:00
|
|
|
|
void on_MF_Attack_hardnestedButton_clicked();
|
2020-04-08 18:18:53 +08:00
|
|
|
|
|
2020-04-13 15:54:37 +08:00
|
|
|
|
void on_MF_Attack_sniffButton_clicked();
|
2020-04-11 23:53:06 +08:00
|
|
|
|
|
2020-04-13 15:54:37 +08:00
|
|
|
|
void on_MF_Attack_listButton_clicked();
|
2020-04-11 23:59:16 +08:00
|
|
|
|
|
2020-04-16 00:39:10 +08:00
|
|
|
|
void on_MF_RW_readAllButton_clicked();
|
|
|
|
|
|
2020-04-16 01:03:53 +08:00
|
|
|
|
void on_MF_RW_readBlockButton_clicked();
|
|
|
|
|
|
|
|
|
|
void on_MF_RW_writeBlockButton_clicked();
|
|
|
|
|
|
2020-04-18 02:01:42 +08:00
|
|
|
|
void on_MF_Attack_infoButton_clicked();
|
|
|
|
|
|
2020-04-21 19:12:44 +08:00
|
|
|
|
void on_MF_RW_writeAllButton_clicked();
|
|
|
|
|
|
2020-04-06 23:48:08 +08:00
|
|
|
|
private:
|
|
|
|
|
Ui::MainWindow *ui;
|
|
|
|
|
PM3Process* pm3;
|
2020-04-21 19:12:44 +08:00
|
|
|
|
bool pm3state;
|
|
|
|
|
QThread* pm3Thread;
|
2020-04-07 23:57:56 +08:00
|
|
|
|
Mifare* mifare;
|
2020-04-09 09:10:47 +08:00
|
|
|
|
void uiInit();
|
2020-04-13 15:54:37 +08:00
|
|
|
|
QLabel* connectStatusBar;
|
|
|
|
|
QLabel* programStatusBar;
|
|
|
|
|
QLabel* PM3VersionBar;
|
2020-04-21 19:12:44 +08:00
|
|
|
|
void signalInit();
|
|
|
|
|
signals:
|
|
|
|
|
void requiringOutput(bool st);
|
|
|
|
|
void connectPM3(const QString path, const QString port);
|
|
|
|
|
void killPM3();
|
|
|
|
|
void setSerialListener(const QString &name, bool state);
|
2020-04-06 23:48:08 +08:00
|
|
|
|
};
|
|
|
|
|
#endif // MAINWINDOW_H
|