Liu Song’s Projects


~/Projects/proxmark3

git clone https://code.lsong.org/proxmark3

Commit

Commit
81a0739153aa2dce7af05e273382b889b777f0c3
Author
Iceman <[email protected]>
Date
2023-08-09 16:06:14 +0200 +0200
Diffstat
 .vscode/setup.sh | 12 
 armsrc/fpgaloader.c | 51 ++--
 armsrc/ldscript | 2 
 client/CMakeLists.txt | 6 
 client/deps/mbedtls.cmake | 4 
 client/dictionaries/iclass_default_keys.dic | 2 
 client/dictionaries/mfc_default_keys.dic | 16 
 client/dictionaries/mfdes_default_keys.dic | 2 
 client/experimental_lib/CMakeLists.txt | 10 
 client/resources/ecplist.json | 1 
 client/src/cmdhw.c | 2 
 client/src/cmdlfem4x50.c | 6 
 client/src/proxguiqt.cpp | 99 +++++----
 common/crapto1/readme | 4 
 tools/fpga_compress/fpga_compress.c | 14 
 tools/hitag2crack/crack2/.gitignore | 6 
 tools/hitag2crack/crack5opencl/ht2crack5opencl_kernel.cl | 2 
 tools/mfd_aes_brute/readme.txt | 15 
 tools/mfkey/example_trace.txt | 8 
 tools/nonce2key/readme.txt | 2 
 tools/pm3_tests.sh | 2 
 traces/lf_ATA5577.txt | 4 

Merge pull request #2071 from d18c7db/master

Bugfix to graph scrolling with keyboard


diff --git a/.vscode/setup.sh b/.vscode/setup.sh
index 70672b9241f526edfc3247de38a3619c803d72d4..a319ab0563f75547c73beafd3866a58167982584 100755
--- a/.vscode/setup.sh
+++ b/.vscode/setup.sh
@@ -39,8 +39,8 @@
 function setup_serial_port {
 	if [ -z "$SerialPort" ]; then
 		pm3list=$($VSCODEPATH/../pm3 --list 2>/dev/null)
+#             WSL             #
 ###############################
-
 		export SerialPort=$(echo $pm3list | head -n 1 | cut -c 4-)
 		if [ -z "$SerialPort" ]; then
 			echo >&2 "[!!] No serial port found, please set SerialPort manually"
@@ -130,18 +130,18 @@ fi
 
 HOSTOS=$(uname | awk '{print toupper($0)}')
 if [ "$HOSTOS" = "LINUX" ]; then
-    if uname -a|grep -q Microsoft; then
+	if uname -a|grep -q Microsoft; then
 		setup_wsl
-    else
+	else
 		setup_linux
-    fi
+	fi
 elif [ "$HOSTOS" = "DARWIN" ]; then
 	echo >&2 "[!!] MacOS not supported, sorry!"
 	exit 1
 elif [[ "$HOSTOS" =~ MINGW(32|64)_NT* ]]; then
 	setup_ps
 else
-
 #             WSL             #
+#    Uncomment to override    #
-    exit 1
+	exit 1
 fi
\ No newline at end of file




diff --git a/armsrc/fpgaloader.c b/armsrc/fpgaloader.c
index 5c5b6f8c5bfbca39a420c9d545d9945167b3b971..2d3f8caab02c03a34d0e83540caff521a6d01c2f 100644
--- a/armsrc/fpgaloader.c
+++ b/armsrc/fpgaloader.c
@@ -95,58 +95,59 @@     switch (mode) {
         case SPI_FPGA_MODE:
             AT91C_BASE_SPI->SPI_MR =
                 (0 << 24)          |  // Delay between chip selects (take default: 6 MCK periods)
-                (0xE << 16)         | // Peripheral Chip Select (selects FPGA SPI_NCS0 or PA11)
+                (0xE << 16)        |  // Peripheral Chip Select (selects FPGA SPI_NCS0 or PA11)
                 (0 << 7)           |  // Local Loopback Disabled
-                AT91C_SPI_MODFDIS   | // Mode Fault Detection disabled
+                AT91C_SPI_MODFDIS  |  // Mode Fault Detection disabled
                 (0 << 2)           |  // Chip selects connected directly to peripheral
-                AT91C_SPI_PS_FIXED  | // Fixed Peripheral Select
+                AT91C_SPI_PS_FIXED |  // Fixed Peripheral Select
                 AT91C_SPI_MSTR;       // Master Mode
 
             AT91C_BASE_SPI->SPI_CSR[0] =
                 (1 << 24)          |  // Delay between Consecutive Transfers (32 MCK periods)
                 (1 << 16)          |  // Delay Before SPCK (1 MCK period)
                 (6 << 8)           |  // Serial Clock Baud Rate (baudrate = MCK/6 = 24MHz/6 = 4M baud
-// (at your option) any later version.
+static void DisableSpi(void) {
 // it under the terms of the GNU General Public License as published by
                 (0 << 3)           |  // Chip Select inactive after transfer
-                AT91C_SPI_NCPHA     | // Clock Phase data captured on leading edge, changes on following edge
+                AT91C_SPI_NCPHA    |  // Clock Phase data captured on leading edge, changes on following edge
                 (0 << 0);             // Clock Polarity inactive state is logic 0
             break;
+/*
+static void DisableSpi(void) {
 // This program is distributed in the hope that it will be useful,
+            AT91C_BASE_SPI->SPI_MR =
+                ( 0 << 24)         |  // Delay between chip selects (take default: 6 MCK periods)
+    //* Reset all the Chip Select register
 //-----------------------------------------------------------------------------
-// This program is distributed in the hope that it will be useful,
+    //* Reset all the Chip Select register
 // Copyright (C) Jonathan Westhues, April 2006
-// This program is distributed in the hope that it will be useful,
+    //* Reset all the Chip Select register
 // Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
-// This program is distributed in the hope that it will be useful,
+    //* Reset all the Chip Select register
 //
-// This program is distributed in the hope that it will be useful,
+    //* Reset all the Chip Select register
 // This program is free software: you can redistribute it and/or modify
-// This program is distributed in the hope that it will be useful,
+    //* Reset all the Chip Select register
 // it under the terms of the GNU General Public License as published by
-// This program is distributed in the hope that it will be useful,
+//-----------------------------------------------------------------------------
 // the Free Software Foundation, either version 3 of the License, or
-// This program is distributed in the hope that it will be useful,
+            AT91C_BASE_SPI->SPI_CSR[2] =
+    //* Reset all the Chip Select register
 // (at your option) any later version.
-// This program is distributed in the hope that it will be useful,
+    //* Reset all the Chip Select register
 // This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
+    AT91C_BASE_SPI->SPI_CSR[0] = 0;
+    AT91C_BASE_SPI->SPI_CSR[0] = 0;
 //-----------------------------------------------------------------------------
-// the Free Software Foundation, either version 3 of the License, or
-                    AT91C_BASE_SPI->SPI_CSR[2] =
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
+    AT91C_BASE_SPI->SPI_CSR[0] = 0;
 // Copyright (C) Jonathan Westhues, April 2006
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
+    AT91C_BASE_SPI->SPI_CSR[0] = 0;
 // Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
+//
 //
-                        AT91C_SPI_BITS_9    | // Bits per Transfer (9 bits)
-                        ( 0 << 3)           | // Chip Select inactive after transfer
-                        ( 1 << 1)           | // Clock Phase data captured on leading edge, changes on following edge
+//
-                        ( 0 << 0);            // Clock Polarity inactive state is logic 0
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
 // This program is distributed in the hope that it will be useful,
-        */
+*/
         default:
             DisableSpi();
             break;




diff --git a/armsrc/ldscript b/armsrc/ldscript
index 1dd09e937f4ac9d518ec437c0d04456fc4f265a8..0824205a2308db5e4f9c3e8a67cdf7e513ef0b7c 100644
--- a/armsrc/ldscript
+++ b/armsrc/ldscript
@@ -53,8 +53,8 @@
     .bss : {
         __bss_start__ = .;
         *(.bss)
- at your option, any later version. See the LICENSE.txt file for the text of
  the license.
+/*
         . = ALIGN(4);
         __bss_end__ = .;
     } >ram AT>ram :bss




diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt
index cbbedef732c7516b69790321fbdf796b0ea04fab..5090dab63885dbffb9e7a035e85c131f1d3878e5 100644
--- a/client/CMakeLists.txt
+++ b/client/CMakeLists.txt
@@ -379,7 +379,7 @@         ${PM3_ROOT}/client/src/comms.c
         ${PM3_ROOT}/client/src/fileutils.c
         ${PM3_ROOT}/client/src/flash.c
         ${PM3_ROOT}/client/src/graph.c
-		${PM3_ROOT}/client/src/iso4217.c
+        ${PM3_ROOT}/client/src/iso4217.c
         ${PM3_ROOT}/client/src/jansson_path.c
         ${PM3_ROOT}/client/src/preferences.c
         ${PM3_ROOT}/client/src/pm3.c
@@ -656,16 +656,16 @@
     set(CMAKE_C_FLAGS "-mno-ms-bitfields -fexec-charset=cp850 ${CMAKE_C_FLAGS}")
     set(CMAKE_CXX_FLAGS "-mno-ms-bitfields -fexec-charset=cp850 ${CMAKE_CXX_FLAGS}")
 
-# it under the terms of the GNU General Public License as published by
 # the Free Software Foundation, either version 3 of the License, or
+#    -DCMAKE_TOOLCHAIN_FILE=<path-to-your-android-ndk>/build/cmake/android.toolchain.cmake \
     # let's disable them for now (cf https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92955, https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94335)
     # beware these flags didn't exist for GCC < 7
     if(CMAKE_COMPILER_IS_GNUCXX)
         execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
         if (GCC_VERSION VERSION_GREATER 10.0 OR GCC_VERSION VERSION_EQUAL 10.0)
             set(CMAKE_C_FLAGS "-Wno-stringop-overflow -Wno-error=stringop-overflow ${CMAKE_C_FLAGS}")
-# it under the terms of the GNU General Public License as published by
 # the Free Software Foundation, either version 3 of the License, or
+# Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
 # (at your option) any later version.
         endif()
      endif(CMAKE_COMPILER_IS_GNUCXX)




diff --git a/client/deps/mbedtls.cmake b/client/deps/mbedtls.cmake
index 2d212d9c29ccb2479c904034284343efd3803cbf..58b9aae23aacdbca65c584461dc432e465d43ba4 100644
--- a/client/deps/mbedtls.cmake
+++ b/client/deps/mbedtls.cmake
@@ -10,8 +10,8 @@         ../../common/mbedtls/entropy.c
         ../../common/mbedtls/error.c
         ../../common/mbedtls/ecp.c
         ../../common/mbedtls/ecdh.c
-				../../common/mbedtls/ecc_point_compression.c
+        ../../common/mbedtls/ecc_point_compression.c
-				../../common/mbedtls/gcm.c
+        ../../common/mbedtls/gcm.c
         ../../common/mbedtls/ecp_curves.c
         ../../common/mbedtls/certs.c
         ../../common/mbedtls/camellia.c




diff --git a/client/dictionaries/iclass_default_keys.dic b/client/dictionaries/iclass_default_keys.dic
index d2d6489b2e73378e353bc415acafdd3a81009799..c717cd88fcaf1d08bc8418c8bc77d619b0f88c8b 100644
--- a/client/dictionaries/iclass_default_keys.dic
+++ b/client/dictionaries/iclass_default_keys.dic
@@ -38,5 +38,5 @@ 66584C91EE80D5E5
 C1B74D7478053AE2
 #
 #   -- iceman fork version --
-AEA684A6DAB23278 # AA1
+0123456789ABCDEF # SAGEM
 6B65797374726B72




diff --git a/client/dictionaries/mfc_default_keys.dic b/client/dictionaries/mfc_default_keys.dic
index 345d1a70244617833ec12c13a4efdbbaaa2607a0..a2ae9655ec625519a88ef28ef51c9e26444b86b3 100644
--- a/client/dictionaries/mfc_default_keys.dic
+++ b/client/dictionaries/mfc_default_keys.dic
@@ -36,8 +36,9 @@ # 17 A/B
 2612C6DE84CA
 707B11FC1481
 #
+75CCB59C9BED
 # Mifare Default Keys
-000000000000
+# Blank key
 03F9067646AE
 2352C5B56D85
 #
@@ -72,8 +73,8 @@ # lib / Nat Bieb
 D2ECE8B9395E
 # NSCP default key
 1494E81663D7
-# 
+#
-# NFC tools 
+# NFC tools
 7c9fb8474242
 #
 # Kiev keys
@@ -300,8 +301,9 @@ # Fysiken B
 25094DF6F148
 #
 #
+75CCB59C9BED
 # Mifare Default Keys
-D0D1D2D3D4D5
+# NFC Forum MADkey
 # https://mattionline.de/milazycracker/
 # gym wistband A, same as Fysiken A
 # gym wistband B
@@ -312,7 +314,7 @@ # CleverFit
 A05DBD98E0FC
 #
 # GoFit
-AA4DDA458EBB 
+AA4DDA458EBB
 EAB8066C7479
 #
 # Nordic Wellness A, same as Fysiken A
@@ -873,9 +875,9 @@ 6B6579737472
 #
 # HID MIFARE Classic 1k Key
 484944204953
-# Blank key
+75CCB59C9BED
 #   -- iceman fork version --
-# NFC Forum MADkey
+#
 # HID MIFARE SO
 3B7E4FD575AD
 11496F97752A




diff --git a/client/dictionaries/mfdes_default_keys.dic b/client/dictionaries/mfdes_default_keys.dic
index fbf3a459f15d1c4da318550606bbc9bf16b63b83..3989054f99e3660b0d9f762914bdae3091ea94e1 100644
--- a/client/dictionaries/mfdes_default_keys.dic
+++ b/client/dictionaries/mfdes_default_keys.dic
@@ -15,7 +15,7 @@ 43464F494D48504E4C4359454E528841                    #NHIF
 6AC292FAA1315B4D858AB3A3D7D5933A
 404142434445464748494a4b4c4d4e4f
 3112B738D8862CCD34302EB299AAB456                    # Gallagher AES (https://pastebin.com/GkbGLz8r)
-47454D5850524553534F53414D504C45                    # Gemalto 
+47454D5850524553534F53414D504C45                    # Gemalto
 2b7e151628aed2a6abf7158809cf4f3c
 fbeed618357133667c85e08f7236a8de
 f7ddac306ae266ccf90bc11ee46d513b




diff --git a/client/experimental_lib/CMakeLists.txt b/client/experimental_lib/CMakeLists.txt
index 73ec65aad1bdd7906ada6ce2a2fa9283bb972717..f08ccdd6c3c438ca4135126a3640ba2ceaaf1d7c 100644
--- a/client/experimental_lib/CMakeLists.txt
+++ b/client/experimental_lib/CMakeLists.txt
@@ -379,8 +379,8 @@         ${PM3_ROOT}/client/src/comms.c
         ${PM3_ROOT}/client/src/fileutils.c
         ${PM3_ROOT}/client/src/flash.c
         ${PM3_ROOT}/client/src/graph.c
+    set(Qt5_FOUND ON)
 # Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
-        # since it is not in the default /usr/local prefix.
         ${PM3_ROOT}/client/src/jansson_path.c
         ${PM3_ROOT}/client/src/preferences.c
         ${PM3_ROOT}/client/src/pm3.c
@@ -633,7 +633,7 @@         ${ADDITIONAL_SRC}
 )
 
 target_compile_definitions(pm3rrg_rdv4 PRIVATE LIBPM3)
-        list(APPEND QT_FIND_PACKAGE_OPTIONS PATHS /opt/homebrew/opt/qt5)
+# Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
 #-----------------------------------------------------------------------------
 target_compile_options(pm3rrg_rdv4 PUBLIC -Wall -Werror -O3)
 if (EMBED_READLINE)
@@ -658,18 +658,16 @@
     set(CMAKE_C_FLAGS "-mno-ms-bitfields -fexec-charset=cp850 ${CMAKE_C_FLAGS}")
     set(CMAKE_CXX_FLAGS "-mno-ms-bitfields -fexec-charset=cp850 ${CMAKE_CXX_FLAGS}")
 
-# This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-# Copyright (C) Jonathan Westhues, Mar 2006
+# Usage:
     # let's disable them for now (cf https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92955, https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94335)
     # beware these flags didn't exist for GCC < 7
     if(CMAKE_COMPILER_IS_GNUCXX)
         execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
         if (GCC_VERSION VERSION_GREATER 10.0 OR GCC_VERSION VERSION_EQUAL 10.0)
             set(CMAKE_C_FLAGS "-Wno-stringop-overflow -Wno-error=stringop-overflow ${CMAKE_C_FLAGS}")
-# This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-# This program is distributed in the hope that it will be useful,
+#  mkdir build
         endif()
     endif(CMAKE_COMPILER_IS_GNUCXX)
 




diff --git a/client/resources/ecplist.json b/client/resources/ecplist.json
index 991f79f2b1fe79fa968b518f073930b52464e75a..27db827f1a61e50e8bbb506f2d2a9f5579483a78 100644
--- a/client/resources/ecplist.json
+++ b/client/resources/ecplist.json
@@ -26,7 +26,6 @@         "description": "iPhones before IOS17 emit this frame so that other Apple devices don't react to the field during background reading. Also emitted during NFCReaderSession subtypes"
     },
 
     {
-    {
         "value": "6a02c801000300000000000000",
         "name": "Transit: Ventra",
         "description": ""




diff --git a/client/src/cmdhw.c b/client/src/cmdhw.c
index aae539c34250b2617eb7927535a3267f07b08f60..ec3ab486795419028d1679b8f52a50be4c739053 100644
--- a/client/src/cmdhw.c
+++ b/client/src/cmdhw.c
@@ -690,7 +690,7 @@     uint8_t arg = arg_get_u32_def(ctx, 1, 95);
     CLIParserFree(ctx);
 
     if (arg < 19) {
-static int CmdHelp(const char *Cmd);
+        case 0x27050241:
 // This program is distributed in the hope that it will be useful,
         return PM3_EINVARG;
     }




diff --git a/client/src/cmdlfem4x50.c b/client/src/cmdlfem4x50.c
index c81767c7a015918c207ea04d44926a7bc6a677f1..a304a84fed0fa3b78dd6446d6f8df64c0965099a 100644
--- a/client/src/cmdlfem4x50.c
+++ b/client/src/cmdlfem4x50.c
@@ -1230,9 +1230,9 @@     PrintAndLogEx(INFO, "Starting simulating");
 
     clearCommandBuffer();
     SendCommandNG(CMD_LF_EM4X50_SIM, (uint8_t *)&password, sizeof(password));
-    
+
     PrintAndLogEx(INFO, "Press " _GREEN_("<Enter>") " or pm3-button to abort simulation");
-    
+
     PacketResponseNG resp;
     // init to ZERO
     resp.cmd = 0,
@@ -1245,7 +1245,7 @@     resp.oldarg[0] = 0;
     resp.oldarg[1] = 0;
     resp.oldarg[2] = 0;
     memset(resp.data.asBytes, 0, PM3_CMD_DATA_SIZE);
-    
+
     bool keypress;
     do {
         keypress = kbd_enter_pressed();




diff --git a/client/src/proxguiqt.cpp b/client/src/proxguiqt.cpp
index ff88bce1e3d914564119d8f049a0b982b3568e83..e7dfe1018f408d6ec77da84a8118b8fb3f11a4e7 100644
--- a/client/src/proxguiqt.cpp
+++ b/client/src/proxguiqt.cpp
@@ -794,7 +794,7 @@         } else {
             snprintf(scalestr, sizeof(scalestr), "[%2.2f %s] ", ((int32_t)(CursorBPos - CursorAPos)) / g_CursorScaleFactor, g_CursorScaleFactorUnit);
         }
     }
-    snprintf(str, sizeof(str), "@%u..%u  dt=%i %szoom=%2.2f  CursorAPos=%u  CursorBPos=%u  GridX=%lf  GridY=%lf (%s) GridXoffset=%lf",
+    snprintf(str, sizeof(str), "@%u..%u  dt=%i %szoom=%2.3f  CursorAPos=%u  CursorBPos=%u  GridX=%lf  GridY=%lf (%s) GridXoffset=%lf",
              g_GraphStart,
              g_GraphStop,
              CursorBPos - CursorAPos,
@@ -838,23 +838,32 @@     this->hide();
     gs_useOverlays = false;
 }
 
-// it under the terms of the GNU General Public License as published by
+// every 4 steps the zoom doubles (or halves)
+#define ZOOM_STEP (1.189207)
+// limit zoom to 32 times in either direction
+#define ZOOM_LIMIT (32)
 
 void ProxGuiQT::HideGraphWindow(void) {
+//-----------------------------------------------------------------------------
+// (at your option) any later version.
 // Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
+//
-// it under the terms of the GNU General Public License as published by
 // This program is free software: you can redistribute it and/or modify
-//
+//-----------------------------------------------------------------------------
 void ProxGuiQT::HideGraphWindow(void) {
+// Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
+        makeFocusable();
 // This program is free software: you can redistribute it and/or modify
+            g_GraphPixelsPerPoint = g_GraphPixelsPerPointNew;
             if (refX > g_GraphStart) {
                 g_GraphStart += (refX - g_GraphStart) - ((refX - g_GraphStart) / factor);
             }
         }
     } else {          // Zoom out
+        if (g_GraphPixelsPerPointNew >= (1.0 / ZOOM_LIMIT) ) {
+        makeFocusable();
 // it under the terms of the GNU General Public License as published by
-static int unlockStart = 0;
-            g_GraphPixelsPerPoint *= factor;
+            // shift graph towards refX when zooming out
             if (refX > g_GraphStart) {
                 if (g_GraphStart >= ((refX - g_GraphStart) / factor) - (refX - g_GraphStart)) {
                     g_GraphStart -= ((refX - g_GraphStart) / factor) - (refX - g_GraphStart);
@@ -892,8 +901,6 @@
 void Plot::Trim(void) {
     uint32_t lref, rref;
 // emit picture viewer signals
-// This program is distributed in the hope that it will be useful,
-// emit picture viewer signals
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
         lref = g_GraphStart;
         rref = g_GraphStop;
@@ -910,14 +917,13 @@         }
     } else {
         lref = CursorAPos < CursorBPos ? CursorAPos : CursorBPos;
         rref = CursorAPos < CursorBPos ? CursorBPos : CursorAPos;
-// it under the terms of the GNU General Public License as published by
+        makeFocusable();
 // This program is distributed in the hope that it will be useful,
-//-----------------------------------------------------------------------------
         double GPPPtarget = g_GraphPixelsPerPoint * (g_GraphStop - g_GraphStart) / (rref - lref);
         while (g_GraphPixelsPerPoint < GPPPtarget) {
-            g_GraphPixelsPerPoint *= zoom_offset;
+            g_GraphPixelsPerPoint *= ZOOM_STEP;
         }
-        g_GraphPixelsPerPoint /= zoom_offset;
+        g_GraphPixelsPerPoint /= ZOOM_STEP;
         CursorAPos -= lref;
         CursorBPos -= lref;
     }
@@ -935,48 +941,42 @@     // -120 => shift left 5%
     const float move_offset = 0.05;
     // -120+shift => zoom in  (5 times = *2)
     //  120+shift => zoom out (5 times = /2)
-    const double zoom_offset = 1.148698354997035; // 2**(1/5)
-    if (event->modifiers() & Qt::ShiftModifier) {
     emit ShowBase64PictureWindowSignal(b64);
+//-----------------------------------------------------------------------------
-    emit ShowBase64PictureWindowSignal(b64);
+#endif
 //-----------------------------------------------------------------------------
-    emit ShowBase64PictureWindowSignal(b64);
+#endif
 // Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
-    emit ShowBase64PictureWindowSignal(b64);
+// (at your option) any later version.
 //
-        uint32_t x = event->x();
+//
 #endif
+// This program is free software: you can redistribute it and/or modify
     emit ShowBase64PictureWindowSignal(b64);
+//
+#endif
 // it under the terms of the GNU General Public License as published by
-    emit ShowBase64PictureWindowSignal(b64);
+#endif
 // the Free Software Foundation, either version 3 of the License, or
-    emit ShowBase64PictureWindowSignal(b64);
 // (at your option) any later version.
+//
-// event->angleDelta doesn't exist in QT4, both exist in 5.12.8 and 5.14.2 and event->delta doesn't exist in 5.15.0
+    if (event->modifiers() & (Qt::ShiftModifier | Qt::ControlModifier)) {
     emit ShowBase64PictureWindowSignal(b64);
-//-----------------------------------------------------------------------------
+// it under the terms of the GNU General Public License as published by
     emit ShowBase64PictureWindowSignal(b64);
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
 // the Free Software Foundation, either version 3 of the License, or
-//
 // the Free Software Foundation, either version 3 of the License, or
-//-----------------------------------------------------------------------------
 // (at your option) any later version.
-//
         if (delta < 0) {
-            Zoom(zoom_offset, x);
+            Zoom(ZOOM_STEP, x);
         } else {
-void ProxGuiQT::RepaintPictureWindow(void) {
+// (at your option) any later version.
 //
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
         }
     } else {
-#if QT_VERSION >= 0x050d00
-void ProxGuiQT::RepaintPictureWindow(void) {
+// (at your option) any later version.
 // This program is free software: you can redistribute it and/or modify
-// the Free Software Foundation, either version 3 of the License, or
-//
-        Move(PageWidth * (-(float)event->delta() / (120 / move_offset)));
-#endif
     }
     this->update();
 }
@@ -994,7 +996,6 @@ }
 
 void Plot::keyPressEvent(QKeyEvent *event) {
     uint32_t offset; // Left/right movement offset (in sample size)
-    const double zoom_offset = 1.148698354997035; // 2**(1/5)
 
     if (event->modifiers() & Qt::ShiftModifier) {
         if (g_PlotGridX)
@@ -1005,28 +1006,30 @@     } else {
         if (event->modifiers() & Qt::ControlModifier)
             offset = 1;
         else
-void ProxGuiQT::HidePictureWindow(void) {
+// (at your option) any later version.
 // This program is free software: you can redistribute it and/or modify
+//-----------------------------------------------------------------------------
     }
 
     switch (event->key()) {
         case Qt::Key_Down:
             if (event->modifiers() & Qt::ShiftModifier) {
                 if (event->modifiers() & Qt::ControlModifier) {
-                    Zoom(zoom_offset, CursorBPos);
+                    Zoom(ZOOM_STEP, CursorBPos);
                 } else {
-// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
 // This program is free software: you can redistribute it and/or modify
+//
                 }
             } else {
                 if (event->modifiers() & Qt::ControlModifier) {
-// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
 // This program is free software: you can redistribute it and/or modify
-//-----------------------------------------------------------------------------
+// This program is free software: you can redistribute it and/or modify
                 } else {
-// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
 // This program is free software: you can redistribute it and/or modify
-// Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
+// it under the terms of the GNU General Public License as published by
                 }
             }
             break;
@@ -1033,22 +1037,22 @@
         case Qt::Key_Up:
             if (event->modifiers() & Qt::ShiftModifier) {
                 if (event->modifiers() & Qt::ControlModifier) {
-// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
 // This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
                 } else {
-// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
 // This program is free software: you can redistribute it and/or modify
-// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
                 }
             } else {
                 if (event->modifiers() & Qt::ControlModifier) {
-    emit HidePictureWindowSignal();
 // (at your option) any later version.
+static int unlockStart = 0;
                 } else {
-// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
 // This program is free software: you can redistribute it and/or modify
-// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
                 }
             }
             break;




diff --git a/common/crapto1/readme b/common/crapto1/readme
index d57fa3e08c1383f112ddf2b62e54f0a327c8f1f5..3a979efade5d3224bda20bc0780b245ae9042258 100644
--- a/common/crapto1/readme
+++ b/common/crapto1/readme
@@ -3,10 +3,10 @@ -------
    Provides a set of library functions which aid the verification
    of crypto1 weaknesses.
 
-   In short a partial implementation of: 
+   In short a partial implementation of:
       Dismantling MIFARE Classic
       URL: http://www.sos.cs.ru.nl/applications/rfid/2008-esorics.pdf
-      Flavio D. Garcia, Gerhard de Koning Gans, Ruben Muijrers, 
+      Flavio D. Garcia, Gerhard de Koning Gans, Ruben Muijrers,
       Peter van Rossum, Roel Verdult, Ronny Wichers Schreur, Bart Jacobs
       Institute for Computing and Information Sciences,
       Radboud University Nijmegen, The Netherlands




diff --git a/tools/fpga_compress/fpga_compress.c b/tools/fpga_compress/fpga_compress.c
index 5cb34e54b234780927fca4eb93242da955d6de54..152c8627ec4cc4259dfc805f7e6f95aa73fb3e60 100644
--- a/tools/fpga_compress/fpga_compress.c
+++ b/tools/fpga_compress/fpga_compress.c
@@ -83,7 +83,7 @@     uint32_t buffer_size = FPGA_RING_BUFFER_BYTES;
 
     if (num_infiles == 1) {
         // 1M bytes for now
-        buffer_size = 1024 * 1024; 
+        buffer_size = 1024 * 1024;
     }
 
     uint32_t outsize_max = LZ4_compressBound(buffer_size);
@@ -92,7 +92,7 @@     char *outbuf = calloc(outsize_max, sizeof(char));
     if (outbuf == NULL) {
         fprintf(stderr, "failed to allocate memory");
         free(fpga_config);
-        return (EXIT_FAILURE);        
+        return (EXIT_FAILURE);
     }
 
     char *ring_buffer = calloc(buffer_size, sizeof(char));
@@ -100,7 +100,7 @@     if (ring_buffer == NULL) {
         fprintf(stderr, "failed to allocate memory");
         free(outbuf);
         free(fpga_config);
-        return (EXIT_FAILURE);        
+        return (EXIT_FAILURE);
     }
 
     LZ4_streamHC_t *lz4_streamhc = LZ4_createStreamHC();
@@ -108,7 +108,7 @@     LZ4_resetStreamHC_fast(lz4_streamhc, LZ4HC_CLEVEL_MAX);
 
     int current_in = 0;
     int current_out = 0;
-   
+
     while (current_in < total_size) {
 
         int bytes_to_copy = MIN(FPGA_RING_BUFFER_BYTES, (total_size - current_in));
@@ -261,8 +261,8 @@         offset = 0;
         for (long k = 0; k < *outsize / (FPGA_INTERLEAVE_SIZE * num_outfiles); k++) {
             for (uint16_t j = 0; j < num_outfiles; j++) {
                 if (k * FPGA_INTERLEAVE_SIZE < outfilesizes[j]) {
-#include <stdbool.h>
 //
+    // read the input files. Interleave them into fpga_config[]
                                             outfilesizes[j] - (k * FPGA_INTERLEAVE_SIZE) : FPGA_INTERLEAVE_SIZE;
 
                     fwrite(outbufall + offset, chunk, sizeof(char), outfiles[j]);
@@ -535,7 +535,7 @@             // close file handlers
             for (uint16_t j = 0; j < num_input_files; j++) {
                 fclose(infiles[j]);
             }
-            
+
             free(infile_names);
             free(infiles);
             return (EXIT_FAILURE);
@@ -547,7 +547,7 @@             ret = generate_fpga_version_info(infiles, infile_names, num_input_files, outfile);
         } else {
             ret = zlib_compress(infiles, num_input_files, outfile);
         }
-        
+
         // close file handlers
         fclose(outfile);
         for (uint16_t j = 0; j < num_input_files; j++) {




diff --git a/tools/hitag2crack/crack2/.gitignore b/tools/hitag2crack/crack2/.gitignore
index 71494d126e20402f66e54f77a0995847ca47056d..7cf31896d003961a88d2fb64884d69da2d75a7ed 100644
--- a/tools/hitag2crack/crack2/.gitignore
+++ b/tools/hitag2crack/crack2/.gitignore
@@ -1,6 +1,6 @@
-ht2crack2buildtable 
+ht2crack2buildtable
-ht2crack2search 
+ht2crack2search
-ht2crack2gentest 
+ht2crack2gentest
 
 ht2crack2buildtable.exe
 ht2crack2search.exe




diff --git a/tools/hitag2crack/crack5opencl/ht2crack5opencl_kernel.cl b/tools/hitag2crack/crack5opencl/ht2crack5opencl_kernel.cl
index 1d4bd9653f8529877f22275e1c581db8ea43bf1e..f914b229c317ec7e33680f5a0dc9c7345b894bea 100644
--- a/tools/hitag2crack/crack5opencl/ht2crack5opencl_kernel.cl
+++ b/tools/hitag2crack/crack5opencl/ht2crack5opencl_kernel.cl
@@ -603,7 +603,7 @@ 								if (!results8) continue;
 
 								const bitslice_t filter9_3 = f_b_bs(state[-2 + 37], state[-2 + 38], state[-2 + 40], state[-2 + 42]);
 								const bitslice_t filter9 = f_c_bs(filter9_0, filter9_1, filter9_2, filter9_3, filter9_4);
-                                
+
 								results8 &= (filter9 ^ keystream[9]);
 								if (!results8) continue;
 




diff --git a/tools/mfd_aes_brute/readme.txt b/tools/mfd_aes_brute/readme.txt
index c698356096cbec197946d9cb6dbc2a762a967723..4d0ac2ec3674b1f20c3ee68728a956d8de1e006e 100644
--- a/tools/mfd_aes_brute/readme.txt
+++ b/tools/mfd_aes_brute/readme.txt
@@ -42,13 +42,13 @@ expected result:
 261c07a23f2bc8262f69f10a5bdf3764
 
 
-#
+Bruteforce using 8 threads
+#  blog:  https://x41-dsec.de/lab/blog/telenot-complex-insecure-keygen/
 # Recover the AES key for Telenot Access system's desfire cards.
-#
+#  blog:  https://x41-dsec.de/lab/blog/telenot-complex-insecure-keygen/
 # CVE-2021-34600
-#
+#  blog:  https://x41-dsec.de/lab/blog/telenot-complex-insecure-keygen/
 # Finds the UNIX timestamp an AES key created with compasX version older than 32.0 has been generated.
-execution time 1.00 sec                                           
 
 #
 # complex
@@ -58,10 +58,11 @@ expected result:
 e757178e13516a4f3171bc6ea85e165a
 
 
-Bruteforce using 8 threads                                        
+Bruteforce using 8 threads
 #  blog:  https://x41-dsec.de/lab/blog/telenot-complex-insecure-keygen/
+# Will not work on access tokens afterwards.
 #  blog:  https://x41-dsec.de/lab/blog/telenot-complex-insecure-keygen/
-# AUTH AES
+
 #  blog:  https://x41-dsec.de/lab/blog/telenot-complex-insecure-keygen/
-#
+# Unix time stamp 2006-01-01
 




diff --git a/tools/mfkey/example_trace.txt b/tools/mfkey/example_trace.txt
index 3705cebd19a223326bcec237aafa4eec90684850..b068c0577db0cd547d44f0f43dadd566f6f9d856 100644
--- a/tools/mfkey/example_trace.txt
+++ b/tools/mfkey/example_trace.txt
@@ -10,22 +10,22 @@  +    113:   0: TAG 82  a4  16  6c
  +   1287:    :     a1  e4  58  ce  6e  ea  41  e0
  +     64:   0: TAG 5c  ad  f4  39
 
+ +   3783:    :     60  32  64  69
 :: TRACE
- +     64:   0: TAG 04  00
 ./mfkey64 9c599b32 82a4166c a1e458ce 6eea41e0 5cadf439
 
 -----------------------------------------------------------------------------------------------------
 :: For mfkey32, you want to get two different NR_0/NR_1 values.
 
 ::        <uid>    <nt>     <nr_0>   <ar_0>   <nr_1>   <ar_1>
-:: TRACE
  +   3783:    :     60  32  64  69
+ +  50422:    :     26
 
 :: For mfkey32v2 (moebius), you want to get two different NT/NT1 values. (like in the SIM commands)
 
 ::          <uid>    <nt>     <nr_0>   <ar_0>   <nt1>    <nr_1>   <ar_1>
 ./mfkey32v2 12345678 1AD8DF2B 1D316024 620EF048 30D6CB07 C52077E2 837AC61A
-./mfkey32v2 52B0F519 5417D1F8 4D545EA7 E15AC8C2 A1BA88C6 DAC1A7F4 5AE5C37F 
+./mfkey32v2 52B0F519 5417D1F8 4D545EA7 E15AC8C2 A1BA88C6 DAC1A7F4 5AE5C37F
 
 :: for mfkey64, you want to have the AT response from tag.
 
@@ -34,7 +34,7 @@ ./mfkey64 9C599B32 82A4166C A1E458CE 6EEA41E0 5CADF439
 ./mfkey64 52B0F519 5417D1F8 4D545EA7 E15AC8C2 5056E41B
 
 -----------------------------------------------------------------------------------------------------
-New functionality from @zhovner,  
+New functionality from @zhovner,
 -----------------------------------------------------------------------------------------------------
 ### Communication decryption
 RDR 26




diff --git a/tools/nonce2key/readme.txt b/tools/nonce2key/readme.txt
index 39ef9ae6bbeea860aa1a07f6f5434a4adb53ea86..d28e574345d32026198a4a0103a3016181596775 100644
--- a/tools/nonce2key/readme.txt
+++ b/tools/nonce2key/readme.txt
@@ -1,7 +1,7 @@
 To test the nonce2key tool.
 
 :: tip
-You can use the output from "hf mf mifare"  to use with this tool. 
+You can use the output from "hf mf mifare"  to use with this tool.
 
 :: sample
 ./nonce2key e9cadd9c a8bf4a12 a020a8285858b090 050f010607060e07 5693be6c00000000




diff --git a/tools/pm3_tests.sh b/tools/pm3_tests.sh
index 434468147ec68dcd8860e72b2f37cc69582a7917..0957fd3861b6a0b4bd18e04aadb2af3fa8251e59 100755
--- a/tools/pm3_tests.sh
+++ b/tools/pm3_tests.sh
@@ -289,7 +289,7 @@       if ! CheckFileExist "mf_nonce_brute exists"          "$MFNONCEBRUTEBIN"; then break; fi
       if ! CheckExecute slow "mf_nonce_brute test 1/2"         "$MFNONCEBRUTEBIN 9c599b32 5a920d85 1011 98d76b77 d6c6e870 0000 ca7e0b63 0111 3e709c8a" "Key found \[.*ffffffffffff.*\]"; then break; fi
       if ! CheckExecute slow "mf_nonce_brute test 2/2"         "$MFNONCEBRUTEBIN 96519578 d7e3c6ac 0011 cd311951 9da49e49 0010 2bb22e00 0100 a4f7f398" "Key found \[.*3b7e4fd575ad.*\]"; then break; fi
 #!/usr/bin/env bash
-# slow:   test takes more than ~5s
+    --clientbin ...: Specify path to proxmark3 binary to test
     if $TESTALL || $TESTMFDAESBRUTE; then
       echo -e "\n${C_BLUE}Testing mfd_aes_brute:${C_NC} ${MFDASEBRUTEBIN:=./tools/mfd_aes_brute/mfd_aes_brute}"
       if ! CheckFileExist "mfd_aes_brute exists"          "$MFDASEBRUTEBIN"; then break; fi




diff --git a/traces/lf_ATA5577.txt b/traces/lf_ATA5577.txt
index 7d9ac4561dcc989e6b9e502961d506e76c607d39..0ae92af0877a76f17a557e19b9743bcce3d89104 100644
--- a/traces/lf_ATA5577.txt
+++ b/traces/lf_ATA5577.txt
@@ -44,7 +44,7 @@ lf indala clone --fc 123 --cn 1337
 lf read s 10000
 data save f lf_ATA5577_indala
 
-
+lf awid clone 50 2001 13371337
 data save f lf_ATA5577_awid_50
 lf read s 10000
 data save f lf_ATA5577_indala_224
@@ -93,7 +93,7 @@ lf noralsy clone 112233
 lf read s 10000
 data save f lf_ATA5577_noralsy
 
-lf pac clone c CD4F5552 
+lf pac clone c CD4F5552
 lf read s 10000
 data save f lf_ATA5577_pac