From a56a503b23fb4f7fac8d022d242d91098fd12372 Mon Sep 17 00:00:00 2001 From: wh201906 Date: Fri, 12 Feb 2021 23:45:25 +0800 Subject: [PATCH] Some slight changes Add HighDPI support(not tested) Support Mifare darkside attack Hide unfinished function tabs --- main.cpp | 1 + module/mifare.cpp | 15 +++++++++++++++ module/mifare.h | 1 + testlog.md | 25 +++++++++++++++++++++++++ ui/mainwindow.cpp | 20 ++++++++++++++++++-- ui/mainwindow.h | 3 +++ ui/mainwindow.ui | 18 +++++++++++++++++- 7 files changed, 80 insertions(+), 3 deletions(-) create mode 100644 testlog.md diff --git a/main.cpp b/main.cpp index 999eb0b..94d2ec7 100644 --- a/main.cpp +++ b/main.cpp @@ -8,6 +8,7 @@ int main(int argc, char *argv[]) { + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QApplication a(argc, argv); MainWindow w; QSettings* settings = new QSettings("GUIsettings.ini", QSettings::IniFormat); diff --git a/module/mifare.cpp b/module/mifare.cpp index b07593e..4ac028b 100644 --- a/module/mifare.cpp +++ b/module/mifare.cpp @@ -252,6 +252,21 @@ void Mifare::hardnested() ui->funcTab->setCurrentIndex(1); } +void Mifare::darkside() +{ + if(util->getClientType() == Util::CLIENTTYPE_OFFICIAL) + { + util->execCMD("hf mf mifare"); + ui->funcTab->setCurrentIndex(1); + } + else if(util->getClientType() == Util::CLIENTTYPE_ICEMAN) + { + util->execCMD("hf mf darkside"); + ui->funcTab->setCurrentIndex(1); + } + +} + void Mifare::sniff() { util->execCMD("hf mf sniff"); diff --git a/module/mifare.h b/module/mifare.h index dfde298..b825d56 100644 --- a/module/mifare.h +++ b/module/mifare.h @@ -66,6 +66,7 @@ public: QString info(bool isRequiringOutput = false); void chk(); void nested(); + void darkside(); void hardnested(); void sniff(); void snoop(); diff --git a/testlog.md b/testlog.md new file mode 100644 index 0000000..1e11118 --- /dev/null +++ b/testlog.md @@ -0,0 +1,25 @@ +# Some Test Log + +*** + +# Version:0.1.3 +## Mifare +### Card Info ++ Official, Mifare card: Passed ++ Iceman, Mifare card: Passed ++ Official, no card: Passed ++ Iceman, no card: Passed + +### Check default Password ++ Official, all FFFFFFFFFFFF: Passed ++ Iceman, all FFFFFFFFFFFF: Passed ++ Official, no card: Passed ++ Iceman, no card: Stuck to searching card, then failed to communicate with PM3 ++ Official, all unknown: Passed ++ Iceman, all unknown: Passed ++ Official, partially unknown: Passed ++ Iceman, partially unknown: Passed + +### Darkside Attack ++ Official: Passed ++ Iceman: Passed \ No newline at end of file diff --git a/ui/mainwindow.cpp b/ui/mainwindow.cpp index 6ad89ba..ed0f0ca 100644 --- a/ui/mainwindow.cpp +++ b/ui/mainwindow.cpp @@ -7,6 +7,7 @@ MainWindow::MainWindow(QWidget *parent): { ui->setupUi(this); myInfo = new QAction("wh201906", this); + currVersion = new QAction("Ver: " + QApplication::applicationVersion().section('.', 0, -2), this); // ignore the 4th version number checkUpdate = new QAction(tr("Check Update"), this); connect(myInfo, &QAction::triggered, [ = ]() { @@ -17,6 +18,7 @@ MainWindow::MainWindow(QWidget *parent): QDesktopServices::openUrl(QUrl("https://github.com/wh201906/Proxmark3GUI/releases")); }); this->addAction(myInfo); + this->addAction(currVersion); this->addAction(checkUpdate); settings = new QSettings("GUIsettings.ini", QSettings::IniFormat); @@ -30,6 +32,11 @@ MainWindow::MainWindow(QWidget *parent): mifare = new Mifare(ui, util, this); keyEventFilter = new MyEventFilter(QEvent::KeyRelease); + + + // hide unused tabs + ui->funcTab->removeTab(1); + ui->funcTab->removeTab(1); } MainWindow::~MainWindow() @@ -127,6 +134,11 @@ void MainWindow::on_stopButton_clicked() // ******************** raw command ******************** +void MainWindow::on_Raw_CMDEdit_textChanged(const QString &arg1) +{ + stashedCMDEditText = arg1; +} + void MainWindow::on_Raw_sendCMDButton_clicked() { util->execCMD(ui->Raw_CMDEdit->text()); @@ -1039,7 +1051,11 @@ void MainWindow::saveClientPath(const QString& path) } // *********************************************** -void MainWindow::on_Raw_CMDEdit_textChanged(const QString &arg1) + + +void MainWindow::on_MF_Attack_darksideButton_clicked() { - stashedCMDEditText = arg1; + setState(false); + mifare->darkside(); + setState(true); } diff --git a/ui/mainwindow.h b/ui/mainwindow.h index 91daafa..948e991 100644 --- a/ui/mainwindow.h +++ b/ui/mainwindow.h @@ -154,6 +154,8 @@ private slots: void on_stopButton_clicked(); void on_Raw_CMDEdit_textChanged(const QString &arg1); + void on_MF_Attack_darksideButton_clicked(); + private: Ui::MainWindow* ui; QButtonGroup* typeBtnGroup; @@ -162,6 +164,7 @@ private: QLabel* PM3VersionBar; QPushButton* stopButton; QAction* myInfo; + QAction* currVersion; QAction* checkUpdate; QSettings* settings; MyEventFilter* keyEventFilter; diff --git a/ui/mainwindow.ui b/ui/mainwindow.ui index 2e7cc0b..6801816 100644 --- a/ui/mainwindow.ui +++ b/ui/mainwindow.ui @@ -120,7 +120,7 @@ - 1 + 0 @@ -568,6 +568,19 @@ + + + + + 40 + 0 + + + + Darkside + + + @@ -1169,6 +1182,9 @@ + + true + LF/Data