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->readAllStandardOutput(); QByteArray btay=pm3->readLine();
qDebug()<<btay; while(btay!="")
ui->plainTextEdit->appendPlainText(btay); {
qDebug()<<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>
</property> <layout class="QHBoxLayout" name="horizontalLayout">
<property name="text"> <property name="sizeConstraint">
<string>Connect</string> <enum>QLayout::SetMaximumSize</enum>
</property> </property>
</widget> <item>
<widget class="QPlainTextEdit" name="plainTextEdit"> <widget class="QLabel" name="label">
<property name="geometry"> <property name="text">
<rect> <string>Path:</string>
<x>110</x> </property>
<y>120</y> </widget>
<width>281</width> </item>
<height>181</height> <item>
</rect> <widget class="QLineEdit" name="PM3PathEdit">
</property> <property name="text">
</widget> <string>proxmark3</string>
<widget class="QPlainTextEdit" name="plainTextEdit_2"> </property>
<property name="geometry"> </widget>
<rect> </item>
<x>100</x> <item>
<y>340</y> <widget class="QComboBox" name="portBox"/>
<width>291</width> </item>
<height>31</height> <item>
</rect> <widget class="QPushButton" name="connectButton">
</property> <property name="text">
</widget> <string>Connect</string>
<widget class="QPushButton" name="pushButton_2"> </property>
<property name="geometry"> </widget>
<rect> </item>
<x>450</x> <item>
<y>350</y> <widget class="QPushButton" name="disconnectButton">
<width>83</width> <property name="text">
<height>23</height> <string>Disconnect</string>
</rect> </property>
</property> </widget>
<property name="text"> </item>
<string>Send</string> </layout>
</property> </item>
</widget> <item>
<widget class="QPushButton" name="pushButton_3"> <widget class="QTabWidget" name="funcTab">
<property name="geometry"> <property name="sizePolicy">
<rect> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<x>560</x> <horstretch>0</horstretch>
<y>350</y> <verstretch>0</verstretch>
<width>83</width> </sizepolicy>
<height>23</height> </property>
</rect> <property name="currentIndex">
</property> <number>1</number>
<property name="text"> </property>
<string>Read</string> <widget class="QWidget" name="tab">
</property> <attribute name="title">
</widget> <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>
</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">
<string>Send</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="clearButton">
<property name="text">
<string>ClearOutput</string>
</property>
</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