mirror of
https://github.com/wh201906/Proxmark3GUI.git
synced 2025-04-20 19:46:19 +08:00
V0.0.1
This commit is contained in:
parent
af7db3ac85
commit
164656a7bc
@ -1,4 +1,4 @@
|
|||||||
QT += core gui
|
QT += core gui serialport
|
||||||
|
|
||||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||||
|
|
||||||
@ -31,3 +31,8 @@ FORMS += \
|
|||||||
qnx: target.path = /tmp/$${TARGET}/bin
|
qnx: target.path = /tmp/$${TARGET}/bin
|
||||||
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
||||||
!isEmpty(target.path): INSTALLS += target
|
!isEmpty(target.path): INSTALLS += target
|
||||||
|
|
||||||
|
VERSION = 0.0.1
|
||||||
|
QMAKE_TARGET_PRODUCT = "Proxmark3GUI"
|
||||||
|
QMAKE_TARGET_DESCRIPTION = "Proxmark3GUI"
|
||||||
|
QMAKE_TARGET_COMPANY = "wh201906"
|
||||||
|
@ -1,2 +1,9 @@
|
|||||||
# Proxmark3GUI
|
# Proxmark3GUI
|
||||||
Developing...
|
A GUI for Proxmark3 client
|
||||||
|
|
||||||
|
***
|
||||||
|
|
||||||
|
Update Log:
|
||||||
|
|
||||||
|
## V0.0.1
|
||||||
|
+ a dumb version with a useless GUI and a serial choose box.
|
@ -7,7 +7,13 @@ MainWindow::MainWindow(QWidget *parent)
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
pm3=new PM3Process;
|
pm3=new PM3Process;
|
||||||
connect(pm3,PM3Process::readyReadStandardError,this,MainWindow::on_pushButton_3_clicked);
|
connect(pm3,&PM3Process::readyRead,this,&MainWindow::refresh);
|
||||||
|
connect(ui->commandEdit,&QLineEdit::editingFinished,this,&MainWindow::sendMSG);
|
||||||
|
ui->portBox->addItem("");
|
||||||
|
foreach(QString port,pm3->findPort())
|
||||||
|
{
|
||||||
|
ui->portBox->addItem(port);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MainWindow::~MainWindow()
|
MainWindow::~MainWindow()
|
||||||
@ -16,21 +22,46 @@ MainWindow::~MainWindow()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MainWindow::on_pushButton_clicked()
|
void MainWindow::on_connectButton_clicked()
|
||||||
{
|
{
|
||||||
qDebug()<<pm3->init("E:/Documents/source/qt/pm3/win64/proxmark3.exe","COM4");
|
QString port=ui->portBox->currentText();
|
||||||
|
if(port=="")
|
||||||
|
QMessageBox::information(NULL, "Info", "Plz choose a port first", QMessageBox::Ok);
|
||||||
|
else
|
||||||
|
qDebug()<<pm3->start(ui->PM3PathEdit->text(),port);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_pushButton_2_clicked()
|
void MainWindow::on_sendButton_clicked()
|
||||||
{
|
{
|
||||||
qDebug()<<ui->plainTextEdit_2->toPlainText().toLocal8Bit();
|
qDebug()<<(ui->commandEdit->text().toLocal8Bit());
|
||||||
pm3->write(ui->plainTextEdit_2->toPlainText().toLocal8Bit());
|
pm3->write((ui->commandEdit->text()+"\r\n").toLocal8Bit());
|
||||||
pm3->waitForBytesWritten(3000);
|
pm3->waitForBytesWritten(3000);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_pushButton_3_clicked()
|
void MainWindow::refresh()
|
||||||
|
{
|
||||||
|
QByteArray btay=pm3->readLine();
|
||||||
|
while(btay!="")
|
||||||
{
|
{
|
||||||
QByteArray btay=pm3->readAllStandardOutput();
|
|
||||||
qDebug()<<btay;
|
qDebug()<<btay;
|
||||||
ui->plainTextEdit->appendPlainText(btay);
|
ui->outputEdit->insertPlainText(btay);
|
||||||
|
btay=pm3->readLine();
|
||||||
|
}
|
||||||
|
ui->outputEdit->moveCursor(QTextCursor::End);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::sendMSG()
|
||||||
|
{
|
||||||
|
if(ui->commandEdit->hasFocus())
|
||||||
|
on_sendButton_clicked();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::on_disconnectButton_clicked()
|
||||||
|
{
|
||||||
|
pm3->kill();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::on_clearButton_clicked()
|
||||||
|
{
|
||||||
|
ui->outputEdit->clear();
|
||||||
}
|
}
|
||||||
|
12
mainwindow.h
12
mainwindow.h
@ -4,6 +4,7 @@
|
|||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QMessageBox>
|
||||||
#include "pm3process.h"
|
#include "pm3process.h"
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
@ -18,13 +19,18 @@ public:
|
|||||||
MainWindow(QWidget *parent = nullptr);
|
MainWindow(QWidget *parent = nullptr);
|
||||||
~MainWindow();
|
~MainWindow();
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void refresh();
|
||||||
private slots:
|
private slots:
|
||||||
void on_pushButton_clicked();
|
void on_connectButton_clicked();
|
||||||
|
|
||||||
void on_pushButton_2_clicked();
|
void on_sendButton_clicked();
|
||||||
|
|
||||||
void on_pushButton_3_clicked();
|
void on_disconnectButton_clicked();
|
||||||
|
|
||||||
|
void on_clearButton_clicked();
|
||||||
|
|
||||||
|
void sendMSG();
|
||||||
private:
|
private:
|
||||||
Ui::MainWindow *ui;
|
Ui::MainWindow *ui;
|
||||||
PM3Process* pm3;
|
PM3Process* pm3;
|
||||||
|
147
mainwindow.ui
147
mainwindow.ui
@ -6,80 +6,135 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>800</width>
|
<width>450</width>
|
||||||
<height>600</height>
|
<height>310</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>450</width>
|
||||||
|
<height>300</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>MainWindow</string>
|
<string>Proxmark3GUI</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="centralwidget">
|
<widget class="QWidget" name="centralwidget">
|
||||||
<widget class="QPushButton" name="pushButton">
|
<property name="sizePolicy">
|
||||||
<property name="geometry">
|
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||||
<rect>
|
<horstretch>0</horstretch>
|
||||||
<x>440</x>
|
<verstretch>0</verstretch>
|
||||||
<y>120</y>
|
</sizepolicy>
|
||||||
<width>83</width>
|
|
||||||
<height>23</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
</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="PM3PathEdit">
|
||||||
|
<property name="text">
|
||||||
|
<string>proxmark3</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="portBox"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="connectButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Connect</string>
|
<string>Connect</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QPlainTextEdit" name="plainTextEdit">
|
</item>
|
||||||
<property name="geometry">
|
<item>
|
||||||
<rect>
|
<widget class="QPushButton" name="disconnectButton">
|
||||||
<x>110</x>
|
<property name="text">
|
||||||
<y>120</y>
|
<string>Disconnect</string>
|
||||||
<width>281</width>
|
|
||||||
<height>181</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QPlainTextEdit" name="plainTextEdit_2">
|
</item>
|
||||||
<property name="geometry">
|
</layout>
|
||||||
<rect>
|
</item>
|
||||||
<x>100</x>
|
<item>
|
||||||
<y>340</y>
|
<widget class="QTabWidget" name="funcTab">
|
||||||
<width>291</width>
|
<property name="sizePolicy">
|
||||||
<height>31</height>
|
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||||
</rect>
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="currentIndex">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="tab">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>Tab 1</string>
|
||||||
|
</attribute>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="rawTab">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>RawCommand</string>
|
||||||
|
</attribute>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QPlainTextEdit" name="outputEdit">
|
||||||
|
<property name="verticalScrollBarPolicy">
|
||||||
|
<enum>Qt::ScrollBarAlwaysOn</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeAdjustPolicy">
|
||||||
|
<enum>QAbstractScrollArea::AdjustIgnored</enum>
|
||||||
|
</property>
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QPushButton" name="pushButton_2">
|
</item>
|
||||||
<property name="geometry">
|
<item>
|
||||||
<rect>
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
<x>450</x>
|
<property name="sizeConstraint">
|
||||||
<y>350</y>
|
<enum>QLayout::SetMaximumSize</enum>
|
||||||
<width>83</width>
|
|
||||||
<height>23</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="commandEdit"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="sendButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Send</string>
|
<string>Send</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QPushButton" name="pushButton_3">
|
</item>
|
||||||
<property name="geometry">
|
<item>
|
||||||
<rect>
|
<widget class="QPushButton" name="clearButton">
|
||||||
<x>560</x>
|
|
||||||
<y>350</y>
|
|
||||||
<width>83</width>
|
|
||||||
<height>23</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Read</string>
|
<string>ClearOutput</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenuBar" name="menubar">
|
<widget class="QMenuBar" name="menubar">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>800</width>
|
<width>450</width>
|
||||||
<height>22</height>
|
<height>22</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
@ -2,14 +2,28 @@
|
|||||||
|
|
||||||
PM3Process::PM3Process(QObject* parent): QProcess(parent)
|
PM3Process::PM3Process(QObject* parent): QProcess(parent)
|
||||||
{
|
{
|
||||||
|
setProcessChannelMode(PM3Process::MergedChannels);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PM3Process::init(const QString path, const QString port)
|
QStringList PM3Process::findPort()
|
||||||
{
|
{
|
||||||
bool success=true;
|
QSerialPort serial;
|
||||||
this->start(path, QStringList(port));
|
QStringList retList;
|
||||||
qDebug()<<waitForStarted();
|
foreach(const QSerialPortInfo &info, QSerialPortInfo::availablePorts())
|
||||||
qDebug()<<waitForReadyRead(3000);
|
{
|
||||||
return true;
|
serial.setPort(info);
|
||||||
|
if(serial.open(QIODevice::ReadWrite))
|
||||||
|
{
|
||||||
|
retList<<info.portName();
|
||||||
|
serial.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return retList;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool PM3Process::start(const QString path, const QString port)
|
||||||
|
{
|
||||||
|
// using "-f" option to make the client output flushed after every print.
|
||||||
|
QProcess::start(path, QStringList()<<port<<"-f",QProcess::Unbuffered|QProcess::ReadWrite);
|
||||||
|
return waitForStarted();
|
||||||
}
|
}
|
||||||
|
@ -4,13 +4,16 @@
|
|||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QtSerialPort/QSerialPortInfo>
|
||||||
|
#include <QtSerialPort/QSerialPort>
|
||||||
|
|
||||||
class PM3Process : public QProcess
|
class PM3Process : public QProcess
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit PM3Process(QObject* parent=nullptr);
|
explicit PM3Process(QObject* parent=nullptr);
|
||||||
bool init(const QString path, const QString port);
|
bool start(const QString path, const QString port);
|
||||||
|
QStringList findPort();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // PM3PROCESS_H
|
#endif // PM3PROCESS_H
|
||||||
|
Loading…
x
Reference in New Issue
Block a user