From f5f9d9f0c0f9981f94cc9eeedc8d2e69f5acd0d3 Mon Sep 17 00:00:00 2001 From: Slurdge Date: Wed, 3 Jul 2019 14:16:16 +0200 Subject: [PATCH] Add support for automatic COM detection on Windows --- CHANGELOG.md | 1 + proxmark3.sh | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4726645c7..611ab4f1c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ 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] + - Add support for automatic COM detection on Windows (@slurdge) - Add support for compilation on RaspberryPiZero (armv6) (@doegox) - Change: updates to README (@iceman) - Change: hf mf/mfu dbg => hw dbg (@doegox) diff --git a/proxmark3.sh b/proxmark3.sh index b4cbd49fd..ef056752b 100755 --- a/proxmark3.sh +++ b/proxmark3.sh @@ -28,6 +28,19 @@ function wait4proxmark_macOS { echo $PM3 } +function wait4proxmark_Windows { + echo >&2 "Waiting for Proxmark to appear..." + while true; do + device=$(wmic path Win32_SerialPort get DeviceID,PNPDeviceID 2>/dev/null | awk 'NR==2') + if [[ $device =~ VID_9AC4\&PID_4B8F ]]; then + PM3=${device/ */} + break + fi + sleep .1 + done + echo $PM3 +} + SCRIPT=$(basename -- "$0") if [ "$SCRIPT" = "proxmark3.sh" ]; then @@ -51,6 +64,8 @@ if [ "$HOSTOS" = "LINUX" ]; then PORT=$(wait4proxmark_Linux) elif [ "$HOSTOS" = "DARWIN" ]; then PORT=$(wait4proxmark_macOS) +elif [[ "$HOSTOS" =~ MINGW(32|64)_NT* ]]; then + PORT=$(wait4proxmark_Windows) else echo "Host OS not recognized, abort: $HOSTOS" exit 1