pull/1/head V0.0.1
wh201906 5 years ago
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();
} }

@ -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;

@ -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> </property>
<height>23</height> <layout class="QVBoxLayout" name="verticalLayout_2">
</rect> <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> </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>
<property name="currentIndex">
<number>1</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Tab 1</string>
</attribute>
</widget> </widget>
<widget class="QPushButton" name="pushButton_2"> <widget class="QWidget" name="rawTab">
<property name="geometry"> <attribute name="title">
<rect> <string>RawCommand</string>
<x>450</x> </attribute>
<y>350</y> <layout class="QVBoxLayout" name="verticalLayout">
<width>83</width> <item>
<height>23</height> <widget class="QPlainTextEdit" name="outputEdit">
</rect> <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>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="sizeConstraint">
<enum>QLayout::SetMaximumSize</enum>
</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);
}
QStringList PM3Process::findPort()
{
QSerialPort serial;
QStringList retList;
foreach(const QSerialPortInfo &info, QSerialPortInfo::availablePorts())
{
serial.setPort(info);
if(serial.open(QIODevice::ReadWrite))
{
retList<<info.portName();
serial.close();
}
}
return retList;
} }
bool PM3Process::init(const QString path, const QString port) bool PM3Process::start(const QString path, const QString port)
{ {
bool success=true; // using "-f" option to make the client output flushed after every print.
this->start(path, QStringList(port)); QProcess::start(path, QStringList()<<port<<"-f",QProcess::Unbuffered|QProcess::ReadWrite);
qDebug()<<waitForStarted(); return waitForStarted();
qDebug()<<waitForReadyRead(3000);
return true;
} }

@ -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…
Cancel
Save