diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c5527897..d2f5c1dc4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,10 +3,15 @@ All notable changes to this project will be documented in this file. This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log... ## [unreleased][unreleased] - - Enable unique USB serial numbers when built with `FLASH` -- **_UPDATES BOOTROM ALSO_** + - Fixed `pm3` script to correctly identify WSL enabled distros (@henrygab) + - Changed device enumeration with "unique USB serial numbers when built with `FLASH` -- **_UPDATES BOOTROM ALSO_**" (@henrygab) - Changed the readline package to v8.2 in the CMAKE files for the client (@iceman1001) + - Fixed `pm3` script for passing arguments (@doegox) + - Fixed python paths to include current directory (@jmichelp) + - Fixed infinite loops in spindelayus (@lnv42) - Add ICECLASS standalone read/sim mode (@natesales) - - Added verbose flag to `hf iclass encode` (@natesales) + - Changed `hf iclass encode` - added verbose flag (@natesales) + - Changed `hf waveshare` - now identify 1.54 nfc epaper correct (@ah01) - Fixed `Makefile` regression that broke `make install` (@henrygab) - Fixed `lf em 4x70 brute` - now works as expected (@adite) - Fixed the lf sampling when bits_per_sample is less than 8 (@wh201906) @@ -14,9 +19,8 @@ This project uses the changelog in accordance with [keepchangelog](http://keepac - Added documentation for usage of Proxmark3 under WSL2 (@henrygab) - Fixed device permissions via updated `udev` rules (@henrygab) - Added `--back` option to `clear` command to clear the scrollback buffer (@wh201906) - - Mark credentials as decrypted in the dump generated by `hf iclass decrypt` - - Show credentials when using `hf iclass view` on a decrypted dump - - Show NTAG213TT tamper info in `hf mfu info` and add commands for configuring it's tamper feature (@mjaksn) + - Changed `hf iclass decrypt` - mark credentials as decrypted in the dump (@natesales) + - Changed `hf iclass view` - show credentials on a decrypted dump (@natesales) ## [Nitride.4.16191][2023-01-29] - Changed `build_all_firmwares.sh` to fit GENERIC 256kb firmware images (@doegox) diff --git a/client/src/graph.c b/client/src/graph.c index 5914c8585..851e49d5a 100644 --- a/client/src/graph.c +++ b/client/src/graph.c @@ -29,21 +29,39 @@ int g_GraphBuffer[MAX_GRAPH_TRACE_LEN]; size_t g_GraphTraceLen; /* write a manchester bit to the graph -TODO, verfy that this doesn't overflow buffer (iceman) */ void AppendGraph(bool redraw, uint16_t clock, int bit) { - uint8_t half = clock / 2; + uint16_t half = clock / 2; + uint16_t end = clock; uint16_t i; + + // overflow/underflow safe checks ... Assumptions: + // _Assert(g_GraphTraceLen >= 0); + // _Assert(g_GraphTraceLen <= MAX_GRAPH_TRACE_LEN); + // If this occurs, allow partial rendering, up to the last sample... + if ((MAX_GRAPH_TRACE_LEN - g_GraphTraceLen) < half) { + PrintAndLogEx(DEBUG, "WARNING: AppendGraph() - Request exceeds max graph length"); + end = MAX_GRAPH_TRACE_LEN - g_GraphTraceLen; + half = end; + } + if ((MAX_GRAPH_TRACE_LEN - g_GraphTraceLen) < end) { + PrintAndLogEx(DEBUG, "WARNING: AppendGraph() - Request exceeds max graph length"); + end = MAX_GRAPH_TRACE_LEN - g_GraphTraceLen; + } + //set first half the clock bit (all 1's or 0's for a 0 or 1 bit) - for (i = 0; i < half; ++i) + for (i = 0; i < half; ++i) { g_GraphBuffer[g_GraphTraceLen++] = bit; + } //set second half of the clock bit (all 0's or 1's for a 0 or 1 bit) - for (; i < clock; ++i) + for (; i < end; ++i) { g_GraphBuffer[g_GraphTraceLen++] = bit ^ 1; + } - if (redraw) + if (redraw) { RepaintGraphWindow(); + } } // clear out our graph window diff --git a/pm3 b/pm3 index f92ce9bd7..7c1d0e289 100755 --- a/pm3 +++ b/pm3 @@ -68,11 +68,12 @@ function get_pm3_list_Linux { fi fi # WSL2 with usbipd detection - doesn't report same things as WSL1 - if grep -q "proxmark.org" "/sys/class/tty/${DEV#/dev/}/../../../manufacturer" 2>/dev/null; then - PM3LIST+=("$DEV") - if [ ${#PM3LIST[*]} -ge "$N" ]; then - return + if echo "${PM3LIST[*]}" | grep -qv "${DEV}"; then + PM3LIST+=("$DEV") + if [ ${#PM3LIST[*]} -ge "$N" ]; then + return + fi fi fi done @@ -474,7 +475,8 @@ fi HOSTOS=$(uname | awk '{print toupper($0)}') if [ "$HOSTOS" = "LINUX" ]; then - if uname -a|grep -q Microsoft; then + # Detect when running under WSL1 (but exclude WSL2) + if uname -a | grep -qi Microsoft && uname -a | grep -qvi WSL2; then # First try finding it using the PATH environment variable PSHEXE=$(command -v powershell.exe 2>/dev/null)