Add new features

Support change language in Settings
Support customized start arguments
Strech data section in MF_dataWidget and key section in MF_keyWidget
pull/14/head
wh201906 4 years ago
parent 5330ed8d14
commit 83445c7eef

@ -14,14 +14,14 @@ PM3Process::PM3Process(QThread* thread, QObject* parent): QProcess(parent)
connect(this, &PM3Process::readyRead, this, &PM3Process::onReadyRead);
}
void PM3Process::connectPM3(const QString& path, const QString& port)
void PM3Process::connectPM3(const QString& path, const QString& port, const QStringList args)
{
QString result;
Util::ClientType clientType = Util::CLIENTTYPE_OFFICIAL;
setRequiringOutput(true);
// using "-f" option to make the client output flushed after every print.
start(path, QStringList() << port << "-f", QProcess::Unbuffered | QProcess::ReadWrite);
start(path, args, QProcess::Unbuffered | QProcess::ReadWrite);
if(waitForStarted(10000))
{
waitForReadyRead(1000);

@ -21,7 +21,7 @@ public:
void testThread();
public slots:
void connectPM3(const QString& path, const QString& port);
void connectPM3(const QString& path, const QString& port, const QStringList args);
void setSerialListener(const QString& name, bool state);
qint64 write(QString data);
private slots:

@ -93,3 +93,27 @@ void Util::setRunningState(bool st)
{
this->isRunning = st;
}
bool Util::chooseLanguage(QSettings* guiSettings, QMainWindow* window)
{
// make sure the GUISettings is not in any group
QSettings* langSettings = new QSettings("lang/languages.ini", QSettings::IniFormat);
QMap<QString, QString> langMap;
langSettings->setIniCodec("UTF-8");
langSettings->beginGroup("Languages");
QStringList langList = langSettings->allKeys();
for(int i = 0; i < langList.size(); i++)
langMap.insert(langSettings->value(langList[i]).toString(), langList[i]);
langSettings->endGroup();
delete langSettings;
bool isOk = false;
QString selectedText = QInputDialog::getItem(window, "", "Choose a language:", langMap.keys(), 0, false, &isOk);
if(isOk)
{
guiSettings->beginGroup("lang");
guiSettings->setValue("language", langMap[selectedText]);
guiSettings->endGroup();
guiSettings->sync();
}
return isOk;
}

@ -10,6 +10,9 @@
#include <QTimer>
#include <QMetaType>
#include <QRegularExpression>
#include <QSettings>
#include <QMainWindow>
#include <QInputDialog>
class Util : public QObject
{
@ -51,6 +54,7 @@ public:
void delay(unsigned int msec);
ClientType getClientType();
static const int rawTabIndex = 1;
static bool chooseLanguage(QSettings *guiSettings, QMainWindow *window);
public slots:
void processOutput(const QString& output);
void setClientType(Util::ClientType clientType);

@ -363,13 +363,12 @@ It could make the whole sector blocked irreversibly!</source>
</message>
<message>
<location filename="../ui/mainwindow.ui" line="483"/>
<location filename="../ui/mainwindow.cpp" line="880"/>
<location filename="../ui/mainwindow.cpp" line="882"/>
<source>Data</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.ui" line="493"/>
<location filename="../ui/mainwindow.ui" line="1562"/>
<source>Key</source>
<translation type="unfinished"></translation>
</message>
@ -465,7 +464,7 @@ It could make the whole sector blocked irreversibly!</source>
</message>
<message>
<location filename="../ui/mainwindow.ui" line="868"/>
<location filename="../ui/mainwindow.cpp" line="713"/>
<location filename="../ui/mainwindow.cpp" line="715"/>
<source>About UID Card</source>
<translation type="unfinished"></translation>
</message>
@ -626,7 +625,7 @@ It could make the whole sector blocked irreversibly!</source>
</message>
<message>
<location filename="../ui/mainwindow.ui" line="1461"/>
<location filename="../ui/mainwindow.cpp" line="171"/>
<location filename="../ui/mainwindow.cpp" line="173"/>
<source>History:</source>
<translation type="unfinished"></translation>
</message>
@ -660,6 +659,11 @@ It could make the whole sector blocked irreversibly!</source>
<source>Preload environment variables</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.ui" line="1562"/>
<source>Variable</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.ui" line="1567"/>
<source>Value</source>
@ -711,55 +715,65 @@ or &quot;-p &lt;port&gt; -f&quot;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.ui" line="1720"/>
<source>Language</source>
<location filename="../ui/mainwindow.ui" line="1722"/>
<source>Language: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.ui" line="1729"/>
<source>Choose Language</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.ui" line="1736"/>
<source>(Restart this app to use new language)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="89"/>
<location filename="../ui/mainwindow.cpp" line="252"/>
<location filename="../ui/mainwindow.cpp" line="478"/>
<location filename="../ui/mainwindow.cpp" line="498"/>
<location filename="../ui/mainwindow.cpp" line="511"/>
<location filename="../ui/mainwindow.cpp" line="530"/>
<location filename="../ui/mainwindow.cpp" line="543"/>
<location filename="../ui/mainwindow.cpp" line="566"/>
<location filename="../ui/mainwindow.cpp" line="579"/>
<location filename="../ui/mainwindow.cpp" line="770"/>
<location filename="../ui/mainwindow.cpp" line="789"/>
<location filename="../ui/mainwindow.cpp" line="90"/>
<location filename="../ui/mainwindow.cpp" line="254"/>
<location filename="../ui/mainwindow.cpp" line="480"/>
<location filename="../ui/mainwindow.cpp" line="500"/>
<location filename="../ui/mainwindow.cpp" line="513"/>
<location filename="../ui/mainwindow.cpp" line="532"/>
<location filename="../ui/mainwindow.cpp" line="545"/>
<location filename="../ui/mainwindow.cpp" line="568"/>
<location filename="../ui/mainwindow.cpp" line="581"/>
<location filename="../ui/mainwindow.cpp" line="772"/>
<location filename="../ui/mainwindow.cpp" line="791"/>
<source>Info</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="89"/>
<location filename="../ui/mainwindow.cpp" line="90"/>
<source>Plz choose a port first</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="107"/>
<location filename="../ui/mainwindow.cpp" line="109"/>
<source>Connected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="112"/>
<location filename="../ui/mainwindow.cpp" line="868"/>
<location filename="../ui/mainwindow.cpp" line="114"/>
<location filename="../ui/mainwindow.cpp" line="870"/>
<source>Not Connected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="524"/>
<location filename="../ui/mainwindow.cpp" line="526"/>
<source>Binary Data Files(*.bin *.dump);;Text Data Files(*.txt *.eml);;All Files(*.*)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="530"/>
<location filename="../ui/mainwindow.cpp" line="543"/>
<location filename="../ui/mainwindow.cpp" line="770"/>
<location filename="../ui/mainwindow.cpp" line="532"/>
<location filename="../ui/mainwindow.cpp" line="545"/>
<location filename="../ui/mainwindow.cpp" line="772"/>
<source>Failed to open</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="252"/>
<location filename="../ui/mainwindow.cpp" line="254"/>
<source>Continue?</source>
<translation type="unfinished"></translation>
</message>
@ -769,222 +783,222 @@ or &quot;-p &lt;port&gt; -f&quot;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="252"/>
<location filename="../ui/mainwindow.cpp" line="254"/>
<source>Some of the data and key will be cleared.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="365"/>
<location filename="../ui/mainwindow.cpp" line="367"/>
<source>Plz select the font of data widget and key widget</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="478"/>
<location filename="../ui/mainwindow.cpp" line="480"/>
<source>Data must consists of 32 Hex symbols(Whitespace is allowed)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="498"/>
<location filename="../ui/mainwindow.cpp" line="511"/>
<location filename="../ui/mainwindow.cpp" line="500"/>
<location filename="../ui/mainwindow.cpp" line="513"/>
<source>Key must consists of 12 Hex symbols(Whitespace is allowed)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="523"/>
<location filename="../ui/mainwindow.cpp" line="525"/>
<source>Plz select the data file:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="536"/>
<location filename="../ui/mainwindow.cpp" line="538"/>
<source>Plz select the key file:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="537"/>
<location filename="../ui/mainwindow.cpp" line="539"/>
<source>Binary Key Files(*.bin *.dump);;Binary Data Files(*.bin *.dump);;All Files(*.*)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="559"/>
<location filename="../ui/mainwindow.cpp" line="561"/>
<source>Plz select the location to save data file:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="560"/>
<location filename="../ui/mainwindow.cpp" line="562"/>
<source>Binary Data Files(*.bin *.dump);;Text Data Files(*.txt *.eml)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="566"/>
<location filename="../ui/mainwindow.cpp" line="579"/>
<location filename="../ui/mainwindow.cpp" line="789"/>
<location filename="../ui/mainwindow.cpp" line="568"/>
<location filename="../ui/mainwindow.cpp" line="581"/>
<location filename="../ui/mainwindow.cpp" line="791"/>
<source>Failed to save to</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="572"/>
<location filename="../ui/mainwindow.cpp" line="574"/>
<source>Plz select the location to save key file:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="573"/>
<location filename="../ui/mainwindow.cpp" line="575"/>
<source>Binary Key Files(*.bin *.dump)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="698"/>
<location filename="../ui/mainwindow.cpp" line="700"/>
<source> Normally, the Block 0 of a typical Mifare card, which contains the UID, is locked during the manufacture. Users cannot write anything to Block 0 or set a new UID to a normal Mifare card.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="699"/>
<location filename="../ui/mainwindow.cpp" line="701"/>
<source> Chinese Magic Cards(aka UID Cards) are some special cards whose Block 0 are writeable. And you can change UID by writing to it.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="701"/>
<location filename="../ui/mainwindow.cpp" line="703"/>
<source>There are two versions of Chinese Magic Cards, the Gen1 and the Gen2.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="702"/>
<location filename="../ui/mainwindow.cpp" line="704"/>
<source> Gen1:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="702"/>
<location filename="../ui/mainwindow.cpp" line="704"/>
<source> also called UID card in China. It responses to some backdoor commands so you can access any blocks without password. The Proxmark3 has a bunch of related commands(csetblk, cgetblk, ...) to deal with this type of card, and my GUI also support these commands.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="703"/>
<location filename="../ui/mainwindow.cpp" line="705"/>
<source> Gen2:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="703"/>
<location filename="../ui/mainwindow.cpp" line="705"/>
<source> doesn&apos;t response to the backdoor commands, which means that a reader cannot detect whether it is a Chinese Magic Card or not by sending backdoor commands.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="705"/>
<location filename="../ui/mainwindow.cpp" line="707"/>
<source>There are some types of Chinese Magic Card Gen2.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="706"/>
<location filename="../ui/mainwindow.cpp" line="708"/>
<source> CUID Card:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="706"/>
<location filename="../ui/mainwindow.cpp" line="708"/>
<source> the Block 0 is writeable, you can write to this block repeatedly by normal wrbl command.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="707"/>
<location filename="../ui/mainwindow.cpp" line="709"/>
<source> (hf mf wrbl 0 A FFFFFFFFFFFF &lt;the data you want to write&gt;)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="708"/>
<location filename="../ui/mainwindow.cpp" line="710"/>
<source> FUID Card:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="708"/>
<location filename="../ui/mainwindow.cpp" line="710"/>
<source> you can only write to Block 0 once. After that, it seems like a typical Mifare card(Block 0 cannot be written to).</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="709"/>
<location filename="../ui/mainwindow.cpp" line="711"/>
<source> (some readers might try changing the Block 0, which could detect the CUID Card. In that case, you should use FUID card.)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="710"/>
<location filename="../ui/mainwindow.cpp" line="712"/>
<source> UFUID Card:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="710"/>
<location filename="../ui/mainwindow.cpp" line="712"/>
<source> It behaves like a CUID card(or UID card? I&apos;m not sure) before you send some special command to lock it. Once it is locked, you cannot change its Block 0(just like a typical Mifare card).</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="712"/>
<location filename="../ui/mainwindow.cpp" line="714"/>
<source> Seemingly, these Chinese Magic Cards are more easily to be compromised by Nested Attack(it takes little time to get an unknown key).</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="757"/>
<location filename="../ui/mainwindow.cpp" line="759"/>
<source>Plz select the trace file:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="758"/>
<location filename="../ui/mainwindow.cpp" line="760"/>
<source>Trace Files(*.trc);;All Files(*.*)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="780"/>
<location filename="../ui/mainwindow.cpp" line="782"/>
<source>Plz select the location to save trace file:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="781"/>
<location filename="../ui/mainwindow.cpp" line="783"/>
<source>Trace Files(*.trc)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="869"/>
<location filename="../ui/mainwindow.cpp" line="1037"/>
<location filename="../ui/mainwindow.cpp" line="871"/>
<location filename="../ui/mainwindow.cpp" line="1040"/>
<source>Idle</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="871"/>
<location filename="../ui/mainwindow.cpp" line="873"/>
<source>Stop</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="878"/>
<location filename="../ui/mainwindow.cpp" line="886"/>
<location filename="../ui/mainwindow.cpp" line="880"/>
<location filename="../ui/mainwindow.cpp" line="888"/>
<source>Sec</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="879"/>
<location filename="../ui/mainwindow.cpp" line="881"/>
<source>Blk</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="887"/>
<location filename="../ui/mainwindow.cpp" line="889"/>
<source>KeyA</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="888"/>
<location filename="../ui/mainwindow.cpp" line="890"/>
<source>KeyB</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="974"/>
<location filename="../ui/mainwindow.cpp" line="977"/>
<source>HW Version:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="976"/>
<location filename="../ui/mainwindow.cpp" line="979"/>
<source>PM3:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="978"/>
<location filename="../ui/mainwindow.cpp" line="981"/>
<source>State:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="1033"/>
<location filename="../ui/mainwindow.cpp" line="1036"/>
<source>Running</source>
<translation type="unfinished"></translation>
</message>

@ -0,0 +1,3 @@
[Language]
English=en_US
简体中文=zh_CN

@ -367,13 +367,12 @@ It could make the whole sector blocked irreversibly!</source>
</message>
<message>
<location filename="../ui/mainwindow.ui" line="483"/>
<location filename="../ui/mainwindow.cpp" line="880"/>
<location filename="../ui/mainwindow.cpp" line="882"/>
<source>Data</source>
<translation></translation>
</message>
<message>
<location filename="../ui/mainwindow.ui" line="493"/>
<location filename="../ui/mainwindow.ui" line="1562"/>
<source>Key</source>
<translation></translation>
</message>
@ -469,7 +468,7 @@ It could make the whole sector blocked irreversibly!</source>
</message>
<message>
<location filename="../ui/mainwindow.ui" line="868"/>
<location filename="../ui/mainwindow.cpp" line="713"/>
<location filename="../ui/mainwindow.cpp" line="715"/>
<source>About UID Card</source>
<translation>UID</translation>
</message>
@ -630,7 +629,7 @@ It could make the whole sector blocked irreversibly!</source>
</message>
<message>
<location filename="../ui/mainwindow.ui" line="1461"/>
<location filename="../ui/mainwindow.cpp" line="171"/>
<location filename="../ui/mainwindow.cpp" line="173"/>
<source>History:</source>
<translation></translation>
</message>
@ -664,6 +663,11 @@ It could make the whole sector blocked irreversibly!</source>
<source>Preload environment variables</source>
<translation></translation>
</message>
<message>
<location filename="../ui/mainwindow.ui" line="1562"/>
<source>Variable</source>
<translation></translation>
</message>
<message>
<location filename="../ui/mainwindow.ui" line="1567"/>
<source>Value</source>
@ -709,6 +713,21 @@ or &quot;-p &lt;port&gt; -f&quot;</source>
&quot;-p /dev/&lt;port&gt; -f&quot;
&quot;-p &lt;port&gt; -f&quot;</translation>
</message>
<message>
<location filename="../ui/mainwindow.ui" line="1722"/>
<source>Language: </source>
<translation> </translation>
</message>
<message>
<location filename="../ui/mainwindow.ui" line="1729"/>
<source>Choose Language</source>
<translation></translation>
</message>
<message>
<location filename="../ui/mainwindow.ui" line="1736"/>
<source>(Restart this app to use new language)</source>
<translation>使</translation>
</message>
<message>
<source>Note: -f is necessary because the GUI need to handle the output in time</source>
<translation type="vanished">-f使</translation>
@ -724,55 +743,54 @@ or &quot;-p &lt;port&gt; -f&quot;</source>
<translation></translation>
</message>
<message>
<location filename="../ui/mainwindow.ui" line="1720"/>
<source>Language</source>
<translation></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="89"/>
<location filename="../ui/mainwindow.cpp" line="252"/>
<location filename="../ui/mainwindow.cpp" line="478"/>
<location filename="../ui/mainwindow.cpp" line="498"/>
<location filename="../ui/mainwindow.cpp" line="511"/>
<location filename="../ui/mainwindow.cpp" line="530"/>
<location filename="../ui/mainwindow.cpp" line="543"/>
<location filename="../ui/mainwindow.cpp" line="566"/>
<location filename="../ui/mainwindow.cpp" line="579"/>
<location filename="../ui/mainwindow.cpp" line="770"/>
<location filename="../ui/mainwindow.cpp" line="789"/>
<translation type="vanished"></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="90"/>
<location filename="../ui/mainwindow.cpp" line="254"/>
<location filename="../ui/mainwindow.cpp" line="480"/>
<location filename="../ui/mainwindow.cpp" line="500"/>
<location filename="../ui/mainwindow.cpp" line="513"/>
<location filename="../ui/mainwindow.cpp" line="532"/>
<location filename="../ui/mainwindow.cpp" line="545"/>
<location filename="../ui/mainwindow.cpp" line="568"/>
<location filename="../ui/mainwindow.cpp" line="581"/>
<location filename="../ui/mainwindow.cpp" line="772"/>
<location filename="../ui/mainwindow.cpp" line="791"/>
<source>Info</source>
<translation></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="89"/>
<location filename="../ui/mainwindow.cpp" line="90"/>
<source>Plz choose a port first</source>
<translation></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="107"/>
<location filename="../ui/mainwindow.cpp" line="109"/>
<source>Connected</source>
<translation></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="112"/>
<location filename="../ui/mainwindow.cpp" line="868"/>
<location filename="../ui/mainwindow.cpp" line="114"/>
<location filename="../ui/mainwindow.cpp" line="870"/>
<source>Not Connected</source>
<translation></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="524"/>
<location filename="../ui/mainwindow.cpp" line="526"/>
<source>Binary Data Files(*.bin *.dump);;Text Data Files(*.txt *.eml);;All Files(*.*)</source>
<translation>(*.bin *.dump);;(*.txt *.eml);;(*.*)</translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="530"/>
<location filename="../ui/mainwindow.cpp" line="543"/>
<location filename="../ui/mainwindow.cpp" line="770"/>
<location filename="../ui/mainwindow.cpp" line="532"/>
<location filename="../ui/mainwindow.cpp" line="545"/>
<location filename="../ui/mainwindow.cpp" line="772"/>
<source>Failed to open</source>
<translation></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="252"/>
<location filename="../ui/mainwindow.cpp" line="254"/>
<source>Continue?</source>
<translation></translation>
</message>
@ -782,222 +800,222 @@ or &quot;-p &lt;port&gt; -f&quot;</source>
<translation></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="252"/>
<location filename="../ui/mainwindow.cpp" line="254"/>
<source>Some of the data and key will be cleared.</source>
<translation></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="365"/>
<location filename="../ui/mainwindow.cpp" line="367"/>
<source>Plz select the font of data widget and key widget</source>
<translation></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="478"/>
<location filename="../ui/mainwindow.cpp" line="480"/>
<source>Data must consists of 32 Hex symbols(Whitespace is allowed)</source>
<translation>32</translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="498"/>
<location filename="../ui/mainwindow.cpp" line="511"/>
<location filename="../ui/mainwindow.cpp" line="500"/>
<location filename="../ui/mainwindow.cpp" line="513"/>
<source>Key must consists of 12 Hex symbols(Whitespace is allowed)</source>
<translation>12</translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="523"/>
<location filename="../ui/mainwindow.cpp" line="525"/>
<source>Plz select the data file:</source>
<translation></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="536"/>
<location filename="../ui/mainwindow.cpp" line="538"/>
<source>Plz select the key file:</source>
<translation></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="537"/>
<location filename="../ui/mainwindow.cpp" line="539"/>
<source>Binary Key Files(*.bin *.dump);;Binary Data Files(*.bin *.dump);;All Files(*.*)</source>
<translation>(*.bin *.dump)(*.bin *.dump);(*.*)</translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="559"/>
<location filename="../ui/mainwindow.cpp" line="561"/>
<source>Plz select the location to save data file:</source>
<translation></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="560"/>
<location filename="../ui/mainwindow.cpp" line="562"/>
<source>Binary Data Files(*.bin *.dump);;Text Data Files(*.txt *.eml)</source>
<translation>(*.bin *.dump);(*.txt *.eml)</translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="566"/>
<location filename="../ui/mainwindow.cpp" line="579"/>
<location filename="../ui/mainwindow.cpp" line="789"/>
<location filename="../ui/mainwindow.cpp" line="568"/>
<location filename="../ui/mainwindow.cpp" line="581"/>
<location filename="../ui/mainwindow.cpp" line="791"/>
<source>Failed to save to</source>
<translation></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="572"/>
<location filename="../ui/mainwindow.cpp" line="574"/>
<source>Plz select the location to save key file:</source>
<translation></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="573"/>
<location filename="../ui/mainwindow.cpp" line="575"/>
<source>Binary Key Files(*.bin *.dump)</source>
<translation>(*.bin *.dump)</translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="698"/>
<location filename="../ui/mainwindow.cpp" line="700"/>
<source> Normally, the Block 0 of a typical Mifare card, which contains the UID, is locked during the manufacture. Users cannot write anything to Block 0 or set a new UID to a normal Mifare card.</source>
<translation> Mifare0</translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="699"/>
<location filename="../ui/mainwindow.cpp" line="701"/>
<source> Chinese Magic Cards(aka UID Cards) are some special cards whose Block 0 are writeable. And you can change UID by writing to it.</source>
<translation> UIDChinese Magic Card0</translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="701"/>
<location filename="../ui/mainwindow.cpp" line="703"/>
<source>There are two versions of Chinese Magic Cards, the Gen1 and the Gen2.</source>
<translation>UIDChinese Magic Card Gen1Gen2</translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="702"/>
<location filename="../ui/mainwindow.cpp" line="704"/>
<source> Gen1:</source>
<translation></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="702"/>
<location filename="../ui/mainwindow.cpp" line="704"/>
<source> also called UID card in China. It responses to some backdoor commands so you can access any blocks without password. The Proxmark3 has a bunch of related commands(csetblk, cgetblk, ...) to deal with this type of card, and my GUI also support these commands.</source>
<translation> UIDPM3GUI</translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="703"/>
<location filename="../ui/mainwindow.cpp" line="705"/>
<source> Gen2:</source>
<translation></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="703"/>
<location filename="../ui/mainwindow.cpp" line="705"/>
<source> doesn&apos;t response to the backdoor commands, which means that a reader cannot detect whether it is a Chinese Magic Card or not by sending backdoor commands.</source>
<translation> CUID/FUID/UFUID</translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="705"/>
<location filename="../ui/mainwindow.cpp" line="707"/>
<source>There are some types of Chinese Magic Card Gen2.</source>
<translation>Gen2</translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="706"/>
<location filename="../ui/mainwindow.cpp" line="708"/>
<source> CUID Card:</source>
<translation> CUID</translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="706"/>
<location filename="../ui/mainwindow.cpp" line="708"/>
<source> the Block 0 is writeable, you can write to this block repeatedly by normal wrbl command.</source>
<translation> 0</translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="707"/>
<location filename="../ui/mainwindow.cpp" line="709"/>
<source> (hf mf wrbl 0 A FFFFFFFFFFFF &lt;the data you want to write&gt;)</source>
<translation> (hf mf wrbl 0 A FFFFFFFFFFFF &lt;&gt;)</translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="708"/>
<location filename="../ui/mainwindow.cpp" line="710"/>
<source> FUID Card:</source>
<translation> FUID</translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="708"/>
<location filename="../ui/mainwindow.cpp" line="710"/>
<source> you can only write to Block 0 once. After that, it seems like a typical Mifare card(Block 0 cannot be written to).</source>
<translation> 0</translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="709"/>
<location filename="../ui/mainwindow.cpp" line="711"/>
<source> (some readers might try changing the Block 0, which could detect the CUID Card. In that case, you should use FUID card.)</source>
<translation> (穿CUID)</translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="710"/>
<location filename="../ui/mainwindow.cpp" line="712"/>
<source> UFUID Card:</source>
<translation> UFUID</translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="710"/>
<location filename="../ui/mainwindow.cpp" line="712"/>
<source> It behaves like a CUID card(or UID card? I&apos;m not sure) before you send some special command to lock it. Once it is locked, you cannot change its Block 0(just like a typical Mifare card).</source>
<translation> UID/CUID0FUID</translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="712"/>
<location filename="../ui/mainwindow.cpp" line="714"/>
<source> Seemingly, these Chinese Magic Cards are more easily to be compromised by Nested Attack(it takes little time to get an unknown key).</source>
<translation> UIDNested</translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="757"/>
<location filename="../ui/mainwindow.cpp" line="759"/>
<source>Plz select the trace file:</source>
<translation>trace</translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="758"/>
<location filename="../ui/mainwindow.cpp" line="760"/>
<source>Trace Files(*.trc);;All Files(*.*)</source>
<translation>Trace(*.trc);;(*.*)</translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="780"/>
<location filename="../ui/mainwindow.cpp" line="782"/>
<source>Plz select the location to save trace file:</source>
<translation>trace</translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="781"/>
<location filename="../ui/mainwindow.cpp" line="783"/>
<source>Trace Files(*.trc)</source>
<translation>Trace(*.trc)</translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="869"/>
<location filename="../ui/mainwindow.cpp" line="1037"/>
<location filename="../ui/mainwindow.cpp" line="871"/>
<location filename="../ui/mainwindow.cpp" line="1040"/>
<source>Idle</source>
<translation></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="871"/>
<location filename="../ui/mainwindow.cpp" line="873"/>
<source>Stop</source>
<translation></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="878"/>
<location filename="../ui/mainwindow.cpp" line="886"/>
<location filename="../ui/mainwindow.cpp" line="880"/>
<location filename="../ui/mainwindow.cpp" line="888"/>
<source>Sec</source>
<translation></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="879"/>
<location filename="../ui/mainwindow.cpp" line="881"/>
<source>Blk</source>
<translation></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="887"/>
<location filename="../ui/mainwindow.cpp" line="889"/>
<source>KeyA</source>
<translation>A</translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="888"/>
<location filename="../ui/mainwindow.cpp" line="890"/>
<source>KeyB</source>
<translation>B</translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="974"/>
<location filename="../ui/mainwindow.cpp" line="977"/>
<source>HW Version:</source>
<translation></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="976"/>
<location filename="../ui/mainwindow.cpp" line="979"/>
<source>PM3:</source>
<translation></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="978"/>
<location filename="../ui/mainwindow.cpp" line="981"/>
<source>State:</source>
<translation></translation>
</message>
<message>
<location filename="../ui/mainwindow.cpp" line="1033"/>
<location filename="../ui/mainwindow.cpp" line="1036"/>
<source>Running</source>
<translation></translation>
</message>

@ -4,57 +4,50 @@
#include <QSettings>
#include <QTranslator>
#include <QMessageBox>
#include <QInputDialog>
#include <QTextCodec>
int main(int argc, char *argv[])
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));
QApplication a(argc, argv);
MainWindow w;
QSettings* settings = new QSettings("GUIsettings.ini", QSettings::IniFormat);
settings->setIniCodec("UTF-8");
settings->beginGroup("lang");
QVariant lang = settings->value("language", "null");
if(lang == "null")
QString currLang = settings->value("language", "").toString();
settings->endGroup();
if(currLang == "")
{
#ifdef Q_OS_WIN
lang = "lang/en_US.qm";
#else
lang = "lang/en_US.ts";
#endif
QStringList langList;
langList.append("English");
langList.append("简体中文");
QString seletedText = QInputDialog::getItem(&w, "", "Choose a language:", langList, 0, false);
if(seletedText == "English")
if(Util::chooseLanguage(settings, &w))
{
#ifdef Q_OS_WIN
lang = "lang/en_US.qm";
#else
lang = "lang/en_US.ts";
#endif
settings->beginGroup("lang");
currLang = settings->value("language", "").toString();
settings->endGroup();
}
else if(seletedText == "简体中文")
{
else
currLang = "en_US";
}
currLang = "lang/" + currLang;
#ifdef Q_OS_WIN
lang = "lang/zh_CN.qm";
currLang += ".qm";
#else
lang = "lang/zh_CN.ts";
currLang += ".ts";;
#endif
}
}
QTranslator* translator = new QTranslator(&w);
if(translator->load(lang.toString()))
if(translator->load(currLang))
{
a.installTranslator(translator);
settings->setValue("language", lang);
}
else
{
QMessageBox::information(&w, "Error", "Can't load " + lang.toString() + " as translation file.");
QMessageBox::information(&w, "Error", "Can't load " + currLang + " as translation file.");
}
settings->endGroup();
delete settings;
w.initUI();
w.show();
return a.exec();
}

@ -22,6 +22,7 @@ MainWindow::MainWindow(QWidget *parent):
this->addAction(checkUpdate);
settings = new QSettings("GUIsettings.ini", QSettings::IniFormat);
settings->setIniCodec("UTF-8");
pm3Thread = new QThread(this);
pm3 = new PM3Process(pm3Thread);
@ -32,7 +33,7 @@ MainWindow::MainWindow(QWidget *parent):
mifare = new Mifare(ui, util, this);
keyEventFilter = new MyEventFilter(QEvent::KeyRelease);
resizeEventFilter = new MyEventFilter(QEvent::Resize);
// hide unused tabs
ui->funcTab->removeTab(1);
@ -66,7 +67,7 @@ void MainWindow::on_PM3_refreshPortButton_clicked()
QStringList serialList;
foreach(const QSerialPortInfo &info, QSerialPortInfo::availablePorts())
{
qDebug() << info.isBusy() << info.isNull() << info.portName();
qDebug() << info.isBusy() << info.isNull() << info.portName() << info.description();
serial.setPort(info);
if(serial.open(QIODevice::ReadWrite))
@ -89,8 +90,9 @@ void MainWindow::on_PM3_connectButton_clicked()
QMessageBox::information(NULL, tr("Info"), tr("Plz choose a port first"), QMessageBox::Ok);
else
{
QStringList args = ui->Set_Client_startArgsEdit->text().replace("<port>", port).split(' ');
saveClientPath(ui->PM3_pathEdit->text());
emit connectPM3(ui->PM3_pathEdit->text(), port);
emit connectPM3(ui->PM3_pathEdit->text(), port, args);
}
QProcess proc;
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
@ -240,6 +242,20 @@ void MainWindow::on_Raw_CMDEdit_keyPressed(QObject* obj_addr, QEvent& event)
// *****************************************************
// ******************** mifare ********************
void MainWindow::on_MF_keyWidget_resized(QObject* obj_addr, QEvent& event)
{
if(obj_addr == ui->MF_keyWidget && event.type() == QEvent::Resize)
{
QTableWidget* widget = (QTableWidget*)obj_addr;
int keyItemWidth = widget->width();
keyItemWidth -= widget->verticalScrollBar()->width();
keyItemWidth -= 2 * widget->frameWidth();
keyItemWidth -= widget->horizontalHeader()->sectionSize(0);
widget->horizontalHeader()->resizeSection(1, keyItemWidth / 2);
widget->horizontalHeader()->resizeSection(2, keyItemWidth / 2);
}
}
void MainWindow::MF_onTypeChanged(int id, bool st)
{
typeBtnGroup->blockSignals(true);
@ -860,6 +876,8 @@ void MainWindow::uiInit()
connect(ui->Raw_CMDEdit, &QLineEdit::editingFinished, this, &MainWindow::sendMSG);
ui->Raw_CMDEdit->installEventFilter(keyEventFilter);
connect(keyEventFilter, &MyEventFilter::eventHappened, this, &MainWindow::on_Raw_CMDEdit_keyPressed);
ui->MF_keyWidget->installEventFilter(resizeEventFilter);
connect(resizeEventFilter, &MyEventFilter::eventHappened, this, &MainWindow::on_MF_keyWidget_resized);
connectStatusBar = new QLabel(this);
programStatusBar = new QLabel(this);
@ -932,7 +950,8 @@ void MainWindow::uiInit()
settings->endGroup();
settings->beginGroup("Client_forceButtonsEnabled");
ui->Set_Client_forceEnabledBox->setChecked(settings->value("state", false).toBool());
keepButtonsEnabled = settings->value("state", false).toBool();
ui->Set_Client_forceEnabledBox->setChecked(keepButtonsEnabled);
settings->endGroup();
ui->MF_RW_keyTypeBox->addItem("A", Mifare::KEY_A);
@ -1036,13 +1055,13 @@ void MainWindow::setState(bool st)
{
setStatusBar(programStatusBar, tr("Idle"));
}
ui->MF_attackGroupBox->setEnabled(st);
ui->MF_normalGroupBox->setEnabled(st);
ui->MF_UIDGroupBox->setEnabled(st);
ui->MF_simGroupBox->setEnabled(st);
ui->MF_sniffGroupBox->setEnabled(st);
ui->Raw_CMDEdit->setEnabled(st);
ui->Raw_sendCMDButton->setEnabled(st);
ui->MF_attackGroupBox->setEnabled(st || keepButtonsEnabled);
ui->MF_normalGroupBox->setEnabled(st || keepButtonsEnabled);
ui->MF_UIDGroupBox->setEnabled(st || keepButtonsEnabled);
ui->MF_simGroupBox->setEnabled(st || keepButtonsEnabled);
ui->MF_sniffGroupBox->setEnabled(st || keepButtonsEnabled);
ui->Raw_CMDEdit->setEnabled(st || keepButtonsEnabled);
ui->Raw_sendCMDButton->setEnabled(st || keepButtonsEnabled);
}
void MainWindow::on_GroupBox_clicked(bool checked)
@ -1136,8 +1155,14 @@ void MainWindow::on_Set_Client_startArgsEdit_editingFinished()
void MainWindow::on_Set_Client_forceEnabledBox_stateChanged(int arg1)
{
settings->beginGroup("Client_forceButtonsEnabled");
settings->setValue("state", arg1 == Qt::Checked);
keepButtonsEnabled = (arg1 == Qt::Checked);
settings->setValue("state", keepButtonsEnabled);
settings->endGroup();
}
void MainWindow::on_Set_GUI_setLanguageButton_clicked()
{
Util::chooseLanguage(settings, this);
}

@ -21,6 +21,7 @@
#include <QSettings>
#include <QPushButton>
#include <QProcessEnvironment>
#include <QScrollBar>
#include "common/myeventfilter.h"
#include "common/pm3process.h"
@ -52,6 +53,7 @@ public slots:
void onPM3StateChanged(bool st, const QString& info);
void MF_onTypeChanged(int id, bool st);
void on_Raw_CMDEdit_keyPressed(QObject *obj_addr, QEvent &event);
void on_MF_keyWidget_resized(QObject *obj_addr, QEvent &event);
private slots:
void on_PM3_connectButton_clicked();
@ -170,6 +172,8 @@ private slots:
void on_Set_Client_envClearButton_clicked();
void on_Set_GUI_setLanguageButton_clicked();
private:
Ui::MainWindow* ui;
QButtonGroup* typeBtnGroup;
@ -182,6 +186,7 @@ private:
QAction* checkUpdate;
QSettings* settings;
MyEventFilter* keyEventFilter;
MyEventFilter* resizeEventFilter;
QString stashedCMDEditText;
int stashedIndex = -1;
@ -190,6 +195,7 @@ private:
PM3Process* pm3;
bool pm3state;
bool keepButtonsEnabled;
QThread* pm3Thread;
Mifare* mifare;
@ -204,7 +210,7 @@ private:
void setState(bool st);
void saveClientPath(const QString& path);
signals:
void connectPM3(const QString& path, const QString& port);
void connectPM3(const QString& path, const QString& port, const QStringList args);
void killPM3();
void setSerialListener(const QString& name, bool state);
};

@ -120,7 +120,7 @@
</sizepolicy>
</property>
<property name="currentIndex">
<number>4</number>
<number>0</number>
</property>
<widget class="QWidget" name="mifareTab">
<attribute name="title">
@ -1559,7 +1559,7 @@
</attribute>
<column>
<property name="text">
<string>Key</string>
<string>Variable</string>
</property>
</column>
<column>
@ -1714,17 +1714,28 @@ or &quot;-p &lt;port&gt; -f&quot;</string>
<string>GUI</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_11">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_17">
<item>
<widget class="QLabel" name="label_16">
<property name="text">
<string>Language</string>
<string>Language: </string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_17">
<widget class="QPushButton" name="Set_GUI_setLanguageButton">
<property name="text">
<string>Choose Language</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="Set_GUI_languageBox"/>
<widget class="QLabel" name="label_17">
<property name="text">
<string>(Restart this app to use new language)</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_9">

Loading…
Cancel
Save