Skip to content

Commit

Permalink
filter ANSI escape codes in version string
Browse files Browse the repository at this point in the history
  • Loading branch information
g3gg0 committed Mar 22, 2024
1 parent 5cf0e57 commit ca062fe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion TeddyBench/Proxmark3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1175,9 +1175,10 @@ private bool TryOpen(string port)

string versionString = Encoding.UTF8.GetString(resVers.DataPtr, 12, (int)ver.versionstr_len - 1);
LogWindow.Log(LogWindow.eLogLevel.Debug, "[PM3] Version:");
Regex removeAnsi = new Regex(@"\x1b\[[0-9;]*m");
foreach (string line in versionString.Split('\n'))
{
LogWindow.Log(LogWindow.eLogLevel.Debug, "[PM3] " + line);
LogWindow.Log(LogWindow.eLogLevel.Debug, "[PM3] " + removeAnsi.Replace(line, ""));
}

switch (ver.id)
Expand Down

0 comments on commit ca062fe

Please sign in to comment.