mirror of
https://github.com/wh201906/Proxmark3GUI.git
synced 2025-12-19 21:03:23 +08:00
Fixed latest versions of proxmark3 not working.
This commit is contained in:
parent
e2fb18970e
commit
784e627c0f
@ -22,6 +22,7 @@ void PM3Process::connectPM3(const QString& path, const QStringList args)
|
|||||||
QString result;
|
QString result;
|
||||||
Util::ClientType clientType;
|
Util::ClientType clientType;
|
||||||
setRequiringOutput(true);
|
setRequiringOutput(true);
|
||||||
|
QRegularExpression osPattern("(os:\\s+|OS\\.+\\s+)");
|
||||||
|
|
||||||
// stash for reconnect
|
// stash for reconnect
|
||||||
currPath = path;
|
currPath = path;
|
||||||
@ -44,7 +45,8 @@ void PM3Process::connectPM3(const QString& path, const QStringList args)
|
|||||||
{
|
{
|
||||||
waitForReadyRead(200);
|
waitForReadyRead(200);
|
||||||
result += *requiredOutput;
|
result += *requiredOutput;
|
||||||
if(result.contains("os: "))
|
// if(result.contains("os: "))
|
||||||
|
if(osPattern.match(result).hasMatch())
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
setRequiringOutput(false);
|
setRequiringOutput(false);
|
||||||
@ -53,12 +55,16 @@ void PM3Process::connectPM3(const QString& path, const QStringList args)
|
|||||||
{
|
{
|
||||||
clientType = Util::CLIENTTYPE_OFFICIAL;
|
clientType = Util::CLIENTTYPE_OFFICIAL;
|
||||||
}
|
}
|
||||||
if(result.contains("os: ")) // make sure the PM3 is connected
|
// if(result.contains("os: ")) // make sure the PM3 is connected
|
||||||
|
if(osPattern.match(result).hasMatch())
|
||||||
{
|
{
|
||||||
emit changeClientType(clientType);
|
emit changeClientType(clientType);
|
||||||
result = result.mid(result.indexOf("os: "));
|
// result = result.mid(result.indexOf("os: "));
|
||||||
|
QRegularExpressionMatch osMatch = osPattern.match(result);
|
||||||
|
result = result.mid(osMatch.capturedStart());
|
||||||
result = result.left(result.indexOf("\n"));
|
result = result.left(result.indexOf("\n"));
|
||||||
result = result.mid(4, result.indexOf(" ", 4) - 4);
|
// result = result.mid(4, result.indexOf(" ", 4) - 4);
|
||||||
|
result = result.mid(osMatch.capturedLength(), result.indexOf(" ", osMatch.capturedLength()) - osMatch.capturedLength());
|
||||||
emit PM3StatedChanged(true, result);
|
emit PM3StatedChanged(true, result);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user