From d53286e0767f64e029f334ad9482c5013e446491 Mon Sep 17 00:00:00 2001 From: wh201906 <62299611+wh201906@users.noreply.github.com> Date: Mon, 6 Apr 2020 23:48:08 +0800 Subject: [PATCH] An useless, uncompleted version --- .gitignore | 73 ++++++++++++++++++++++++++++++++++++++ Proxmark3GUI.pro | 33 ++++++++++++++++++ main.cpp | 11 ++++++ mainwindow.cpp | 36 +++++++++++++++++++ mainwindow.h | 32 +++++++++++++++++ mainwindow.ui | 91 ++++++++++++++++++++++++++++++++++++++++++++++++ pm3process.cpp | 15 ++++++++ pm3process.h | 16 +++++++++ 8 files changed, 307 insertions(+) create mode 100644 .gitignore create mode 100644 Proxmark3GUI.pro create mode 100644 main.cpp create mode 100644 mainwindow.cpp create mode 100644 mainwindow.h create mode 100644 mainwindow.ui create mode 100644 pm3process.cpp create mode 100644 pm3process.h diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fab7372 --- /dev/null +++ b/.gitignore @@ -0,0 +1,73 @@ +# This file is used to ignore files which are generated +# ---------------------------------------------------------------------------- + +*~ +*.autosave +*.a +*.core +*.moc +*.o +*.obj +*.orig +*.rej +*.so +*.so.* +*_pch.h.cpp +*_resource.rc +*.qm +.#* +*.*# +core +!core/ +tags +.DS_Store +.directory +*.debug +Makefile* +*.prl +*.app +moc_*.cpp +ui_*.h +qrc_*.cpp +Thumbs.db +*.res +*.rc +/.qmake.cache +/.qmake.stash + +# qtcreator generated files +*.pro.user* + +# xemacs temporary files +*.flc + +# Vim temporary files +.*.swp + +# Visual Studio generated files +*.ib_pdb_index +*.idb +*.ilk +*.pdb +*.sln +*.suo +*.vcproj +*vcproj.*.*.user +*.ncb +*.sdf +*.opensdf +*.vcxproj +*vcxproj.* + +# MinGW generated files +*.Debug +*.Release + +# Python byte code +*.pyc + +# Binaries +# -------- +*.dll +*.exe + diff --git a/Proxmark3GUI.pro b/Proxmark3GUI.pro new file mode 100644 index 0000000..fdbaca3 --- /dev/null +++ b/Proxmark3GUI.pro @@ -0,0 +1,33 @@ +QT += core gui + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +CONFIG += c++11 + +# The following define makes your compiler emit warnings if you use +# any Qt feature that has been marked deprecated (the exact warnings +# depend on your compiler). Please consult the documentation of the +# deprecated API in order to know how to port your code away from it. +DEFINES += QT_DEPRECATED_WARNINGS + +# You can also make your code fail to compile if it uses deprecated APIs. +# In order to do so, uncomment the following line. +# You can also select to disable deprecated APIs only up to a certain version of Qt. +#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 + +SOURCES += \ + main.cpp \ + mainwindow.cpp \ + pm3process.cpp + +HEADERS += \ + mainwindow.h \ + pm3process.h + +FORMS += \ + mainwindow.ui + +# Default rules for deployment. +qnx: target.path = /tmp/$${TARGET}/bin +else: unix:!android: target.path = /opt/$${TARGET}/bin +!isEmpty(target.path): INSTALLS += target diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..fd3e533 --- /dev/null +++ b/main.cpp @@ -0,0 +1,11 @@ +#include "mainwindow.h" + +#include + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + MainWindow w; + w.show(); + return a.exec(); +} diff --git a/mainwindow.cpp b/mainwindow.cpp new file mode 100644 index 0000000..b2a2107 --- /dev/null +++ b/mainwindow.cpp @@ -0,0 +1,36 @@ +#include "mainwindow.h" +#include "ui_mainwindow.h" + +MainWindow::MainWindow(QWidget *parent) + : QMainWindow(parent) + , ui(new Ui::MainWindow) +{ + ui->setupUi(this); + pm3=new PM3Process; + connect(pm3,PM3Process::readyReadStandardError,this,MainWindow::on_pushButton_3_clicked); +} + +MainWindow::~MainWindow() +{ + delete ui; +} + + +void MainWindow::on_pushButton_clicked() +{ + qDebug()<init("E:/Documents/source/qt/pm3/win64/proxmark3.exe","COM4"); +} + +void MainWindow::on_pushButton_2_clicked() +{ + qDebug()<plainTextEdit_2->toPlainText().toLocal8Bit(); + pm3->write(ui->plainTextEdit_2->toPlainText().toLocal8Bit()); + pm3->waitForBytesWritten(3000); +} + +void MainWindow::on_pushButton_3_clicked() +{ + QByteArray btay=pm3->readAllStandardOutput(); + qDebug()<plainTextEdit->appendPlainText(btay); +} diff --git a/mainwindow.h b/mainwindow.h new file mode 100644 index 0000000..d5ee2cd --- /dev/null +++ b/mainwindow.h @@ -0,0 +1,32 @@ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include +#include +#include +#include "pm3process.h" + +QT_BEGIN_NAMESPACE +namespace Ui { class MainWindow; } +QT_END_NAMESPACE + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + MainWindow(QWidget *parent = nullptr); + ~MainWindow(); + +private slots: + void on_pushButton_clicked(); + + void on_pushButton_2_clicked(); + + void on_pushButton_3_clicked(); + +private: + Ui::MainWindow *ui; + PM3Process* pm3; +}; +#endif // MAINWINDOW_H diff --git a/mainwindow.ui b/mainwindow.ui new file mode 100644 index 0000000..8a3b849 --- /dev/null +++ b/mainwindow.ui @@ -0,0 +1,91 @@ + + + MainWindow + + + + 0 + 0 + 800 + 600 + + + + MainWindow + + + + + + 440 + 120 + 83 + 23 + + + + Connect + + + + + + 110 + 120 + 281 + 181 + + + + + + + 100 + 340 + 291 + 31 + + + + + + + 450 + 350 + 83 + 23 + + + + Send + + + + + + 560 + 350 + 83 + 23 + + + + Read + + + + + + + 0 + 0 + 800 + 22 + + + + + + + + diff --git a/pm3process.cpp b/pm3process.cpp new file mode 100644 index 0000000..16bb480 --- /dev/null +++ b/pm3process.cpp @@ -0,0 +1,15 @@ +#include "pm3process.h" + +PM3Process::PM3Process(QObject* parent): QProcess(parent) +{ + +} + +bool PM3Process::init(const QString path, const QString port) +{ + bool success=true; + this->start(path, QStringList(port)); + qDebug()< +#include +#include + +class PM3Process : public QProcess +{ + Q_OBJECT +public: + explicit PM3Process(QObject* parent=nullptr); + bool init(const QString path, const QString port); +}; + +#endif // PM3PROCESS_H