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-24 22:11:35 +08:00
|
|
|
|
#include <QButtonGroup>
|
|
|
|
|
#include <QRadioButton>
|
2020-04-26 21:15:08 +08:00
|
|
|
|
#include <QFileDialog>
|
2020-04-29 14:47:40 +08:00
|
|
|
|
#include <QFontDialog>
|
2020-04-21 19:12:44 +08:00
|
|
|
|
#include <QtSerialPort/QSerialPortInfo>
|
|
|
|
|
#include <QtSerialPort/QSerialPort>
|
2020-04-29 16:30:27 +08:00
|
|
|
|
#include <QMimeData>
|
2020-04-29 19:05:05 +08:00
|
|
|
|
#include <QAction>
|
|
|
|
|
#include <QDesktopServices>
|
2020-06-13 01:27:59 +08:00
|
|
|
|
#include <QGroupBox>
|
|
|
|
|
#include <QSizePolicy>
|
|
|
|
|
#include <QSettings>
|
2020-08-12 12:30:15 +08:00
|
|
|
|
#include <QPushButton>
|
2020-04-21 19:12:44 +08:00
|
|
|
|
|
2020-04-22 16:42:58 +08:00
|
|
|
|
#include "common/pm3process.h"
|
|
|
|
|
#include "module/mifare.h"
|
|
|
|
|
#include "common/util.h"
|
2020-08-04 23:33:14 +08:00
|
|
|
|
#include "ui/mf_trailerdecoderdialog.h"
|
2020-04-06 23:48:08 +08:00
|
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
2020-04-30 20:32:43 +08:00
|
|
|
|
namespace Ui
|
|
|
|
|
{
|
2020-04-22 23:13:00 +08:00
|
|
|
|
class MainWindow;
|
|
|
|
|
}
|
2020-04-06 23:48:08 +08:00
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
|
|
|
|
class MainWindow : public QMainWindow
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
MainWindow(QWidget *parent = nullptr);
|
|
|
|
|
~MainWindow();
|
|
|
|
|
|
2020-04-25 18:15:00 +08:00
|
|
|
|
void initUI();
|
2020-04-29 16:30:27 +08:00
|
|
|
|
bool eventFilter(QObject *watched, QEvent *event);
|
2020-04-07 18:16:00 +08:00
|
|
|
|
public slots:
|
2020-04-22 21:14:33 +08:00
|
|
|
|
void refreshOutput(const QString &output);
|
|
|
|
|
void refreshCMD(const QString &cmd);
|
2020-04-22 23:13:00 +08:00
|
|
|
|
void setStatusBar(QLabel* target, const QString & text);
|
2020-04-21 19:12:44 +08:00
|
|
|
|
void onPM3StateChanged(bool st, QString info);
|
2020-04-24 22:11:35 +08:00
|
|
|
|
void MF_onTypeChanged(int id, bool st);
|
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();
|
|
|
|
|
|
2020-04-21 19:28:38 +08:00
|
|
|
|
void on_Raw_CMDHistoryBox_stateChanged(int arg1);
|
2020-04-13 15:54:37 +08:00
|
|
|
|
|
|
|
|
|
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-25 00:57:28 +08:00
|
|
|
|
void on_MF_Sniff_sniffButton_clicked();
|
2020-04-11 23:53:06 +08:00
|
|
|
|
|
2020-04-25 00:57:28 +08:00
|
|
|
|
void on_MF_Sniff_listButton_clicked();
|
2020-04-11 23:59:16 +08:00
|
|
|
|
|
2020-08-07 23:51:24 +08:00
|
|
|
|
void on_MF_RW_readSelectedButton_clicked();
|
2020-04-16 00:39:10 +08:00
|
|
|
|
|
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-08-08 00:19:37 +08:00
|
|
|
|
void on_MF_RW_writeSelectedButton_clicked();
|
2020-04-21 19:12:44 +08:00
|
|
|
|
|
2020-04-21 19:28:38 +08:00
|
|
|
|
|
2020-04-22 23:35:24 +08:00
|
|
|
|
void on_MF_RW_dumpButton_clicked();
|
|
|
|
|
|
|
|
|
|
void on_MF_RW_restoreButton_clicked();
|
|
|
|
|
|
2020-08-08 21:04:09 +08:00
|
|
|
|
void on_MF_UID_readSelectedButton_clicked();
|
2020-04-25 00:57:28 +08:00
|
|
|
|
|
|
|
|
|
void on_MF_UID_readBlockButton_clicked();
|
|
|
|
|
|
2020-08-08 21:04:09 +08:00
|
|
|
|
void on_MF_UID_writeSelectedButton_clicked();
|
2020-04-25 00:57:28 +08:00
|
|
|
|
|
|
|
|
|
void on_MF_UID_writeBlockButton_clicked();
|
|
|
|
|
|
2020-04-26 21:15:08 +08:00
|
|
|
|
void on_MF_File_loadButton_clicked();
|
|
|
|
|
|
|
|
|
|
void on_MF_File_saveButton_clicked();
|
|
|
|
|
|
2020-08-01 22:04:30 +08:00
|
|
|
|
void on_MF_data2KeyButton_clicked();
|
2020-04-26 21:50:55 +08:00
|
|
|
|
|
2020-08-01 22:04:30 +08:00
|
|
|
|
void on_MF_key2DataButton_clicked();
|
2020-04-26 21:50:55 +08:00
|
|
|
|
|
2020-04-28 19:54:05 +08:00
|
|
|
|
void on_MF_dataWidget_itemChanged(QTableWidgetItem *item);
|
|
|
|
|
|
|
|
|
|
void on_MF_File_clearButton_clicked();
|
|
|
|
|
|
|
|
|
|
void on_MF_keyWidget_itemChanged(QTableWidgetItem *item);
|
|
|
|
|
|
2020-04-29 14:47:40 +08:00
|
|
|
|
void on_MF_fontButton_clicked();
|
|
|
|
|
|
|
|
|
|
void on_MF_UID_wipeButton_clicked();
|
|
|
|
|
|
|
|
|
|
void on_MF_UID_aboutUIDButton_clicked();
|
|
|
|
|
|
|
|
|
|
void on_MF_UID_setParaButton_clicked();
|
|
|
|
|
|
|
|
|
|
void on_MF_UID_lockButton_clicked();
|
|
|
|
|
|
2020-08-08 21:04:09 +08:00
|
|
|
|
void on_MF_Sim_readSelectedButton_clicked();
|
2020-04-30 20:32:43 +08:00
|
|
|
|
|
2020-08-08 21:04:09 +08:00
|
|
|
|
void on_MF_Sim_writeSelectedButton_clicked();
|
2020-04-30 20:32:43 +08:00
|
|
|
|
|
|
|
|
|
void on_MF_Sim_clearButton_clicked();
|
|
|
|
|
|
2020-05-01 23:37:23 +08:00
|
|
|
|
void on_MF_Sim_simButton_clicked();
|
|
|
|
|
|
2020-05-03 23:40:09 +08:00
|
|
|
|
void on_MF_Sniff_loadButton_clicked();
|
|
|
|
|
|
|
|
|
|
void on_MF_Sniff_saveButton_clicked();
|
|
|
|
|
|
2020-06-13 01:27:59 +08:00
|
|
|
|
void on_GroupBox_clicked(bool checked);
|
|
|
|
|
|
2020-08-04 13:44:20 +08:00
|
|
|
|
void on_MF_selectAllBox_stateChanged(int arg1);
|
2020-06-27 14:02:58 +08:00
|
|
|
|
|
2020-08-01 22:04:30 +08:00
|
|
|
|
void on_MF_fillKeysButton_clicked();
|
|
|
|
|
|
2020-08-04 13:44:20 +08:00
|
|
|
|
void on_MF_Sniff_snoopButton_clicked();
|
|
|
|
|
|
2020-08-04 23:33:14 +08:00
|
|
|
|
void on_MF_trailerDecoderButton_clicked();
|
|
|
|
|
|
2020-08-08 21:49:43 +08:00
|
|
|
|
void on_MF_selectTrailerBox_stateChanged(int arg1);
|
|
|
|
|
|
2020-08-12 12:30:15 +08:00
|
|
|
|
void on_stopButton_clicked();
|
2020-04-06 23:48:08 +08:00
|
|
|
|
private:
|
2020-04-26 21:15:08 +08:00
|
|
|
|
Ui::MainWindow* ui;
|
2020-04-24 22:11:35 +08:00
|
|
|
|
QButtonGroup* typeBtnGroup;
|
|
|
|
|
QLabel* connectStatusBar;
|
|
|
|
|
QLabel* programStatusBar;
|
|
|
|
|
QLabel* PM3VersionBar;
|
2020-08-12 12:30:15 +08:00
|
|
|
|
QPushButton* stopButton;
|
2020-04-29 19:05:05 +08:00
|
|
|
|
QAction* myInfo;
|
2020-08-08 21:49:43 +08:00
|
|
|
|
QAction* checkUpdate;
|
2020-06-13 01:27:59 +08:00
|
|
|
|
QSettings* settings;
|
2020-04-26 21:15:08 +08:00
|
|
|
|
|
2020-04-24 22:11:35 +08:00
|
|
|
|
void uiInit();
|
|
|
|
|
|
2020-04-06 23:48:08 +08:00
|
|
|
|
PM3Process* pm3;
|
2020-04-21 19:12:44 +08:00
|
|
|
|
bool pm3state;
|
|
|
|
|
QThread* pm3Thread;
|
2020-04-24 22:11:35 +08:00
|
|
|
|
|
2020-04-07 23:57:56 +08:00
|
|
|
|
Mifare* mifare;
|
2020-04-22 16:42:58 +08:00
|
|
|
|
Util* util;
|
2020-04-24 22:11:35 +08:00
|
|
|
|
|
2020-08-04 23:33:14 +08:00
|
|
|
|
MF_trailerDecoderDialog* decDialog;
|
|
|
|
|
|
2020-04-24 22:11:35 +08:00
|
|
|
|
|
2020-04-21 19:12:44 +08:00
|
|
|
|
void signalInit();
|
2020-04-24 22:11:35 +08:00
|
|
|
|
void MF_widgetReset();
|
|
|
|
|
void setTableItem(QTableWidget *widget, int row, int column, const QString &text);
|
2020-04-29 17:50:52 +08:00
|
|
|
|
void setState(bool st);
|
2020-08-07 15:28:17 +08:00
|
|
|
|
void saveClientPath(const QString &path);
|
2020-04-21 19:12:44 +08:00
|
|
|
|
signals:
|
|
|
|
|
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
|