mirror of
https://github.com/wh201906/Proxmark3GUI.git
synced 2025-02-16 22:21:30 +08:00
Add new features
Support change language in Settings Support customized start arguments Strech data section in MF_dataWidget and key section in MF_keyWidget
This commit is contained in:
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);
|
||||
|
162
lang/en_US.ts
162
lang/en_US.ts
@ -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 "-p <port> -f"</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.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.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="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 "-p <port> -f"</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'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 <the data you want to write>)</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'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
|
166
lang/zh_CN.ts
166
lang/zh_CN.ts
@ -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 "-p <port> -f"</source>
|
||||
部分情况下启动参数需设置为"-p /dev/<port> -f"
|
||||
或"-p <port> -f"</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 "-p <port> -f"</source>
|
||||
<translation>图形化界面</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.ui" line="1720"/>
|
||||
<source>Language</source>
|
||||
<translation>语言</translation>
|
||||
<translation type="vanished">语言</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>信息</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 "-p <port> -f"</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> 普通Mifare卡的块0无法写入,卡号也不能更改</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> UID卡(在国外叫Chinese Magic Card)的块0可写,卡号可变。</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>国外把UID卡分为Chinese Magic Card Gen1和Gen2</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> 指通常所说的UID卡,可以通过后门指令直接读写块而无需密码,在PM3和此GUI中有特殊命令处理这类卡片</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'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 <the data you want to write>)</source>
|
||||
<translation> (hf mf wrbl 0 A FFFFFFFFFFFF <待写入数据>)</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'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/CUID卡一样可以反复读写块0,用特殊命令锁卡后就和FUID卡一样了</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> 所有UID卡都似乎更容易被Nested攻击破解</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>
|
||||
|
51
main.cpp
51
main.cpp
@ -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))
|
||||
{
|
||||
settings->beginGroup("lang");
|
||||
currLang = settings->value("language", "").toString();
|
||||
settings->endGroup();
|
||||
}
|
||||
else
|
||||
currLang = "en_US";
|
||||
}
|
||||
currLang = "lang/" + currLang;
|
||||
#ifdef Q_OS_WIN
|
||||
lang = "lang/en_US.qm";
|
||||
currLang += ".qm";
|
||||
#else
|
||||
lang = "lang/en_US.ts";
|
||||
currLang += ".ts";;
|
||||
#endif
|
||||
}
|
||||
else if(seletedText == "简体中文")
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
lang = "lang/zh_CN.qm";
|
||||
#else
|
||||
lang = "lang/zh_CN.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 "-p <port> -f"</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…
x
Reference in New Issue
Block a user