From e95186e5c796f16fa67530694fd166b32f4bf3a4 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Tue, 24 Sep 2019 11:45:38 +0200 Subject: [PATCH] WSL: detect auth problems to run wmic --- .../Windows-Installation-Instructions.md | 2 ++ pm3 | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/doc/md/Installation_Instructions/Windows-Installation-Instructions.md b/doc/md/Installation_Instructions/Windows-Installation-Instructions.md index 9cd150a22..2f5618c40 100644 --- a/doc/md/Installation_Instructions/Windows-Installation-Instructions.md +++ b/doc/md/Installation_Instructions/Windows-Installation-Instructions.md @@ -68,6 +68,8 @@ Install WSL with e.g. the standard Ubuntu. For WSL configuration, see [Manage and configure Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/wsl-config). +Make sure your WSL can launch Windows processes to get the `pm3` scripts working (cf `interop` in the WSL settings). + ## X Server Installation If you want to run the graphical components of the Proxmark3 client, you need to install a X Server such as [VcXsrv](https://sourceforge.net/projects/vcxsrv/) or [Xming](https://sourceforge.net/projects/xming/) and launch it, e.g. by executing XLaunch. diff --git a/pm3 b/pm3 index a740beb12..347e8bb3e 100755 --- a/pm3 +++ b/pm3 @@ -54,6 +54,13 @@ function wait4proxmark_Windows { } function wait4proxmark_WSL { + # Test presence of wmic + wmic.exe computersystem get name >/dev/null 2>&1 + if [ $? -ne 0 ]; then + echo "[!] Cannot run wmic.exe, are you sure your WSL is authorized to run Windows processes? (cf WSL interop flag)" + exit 1 + fi + echo >&2 "[=] Waiting for Proxmark3 to appear..." while true; do device=$(wmic.exe path Win32_SerialPort where "PNPDeviceID like '%VID_9AC4&PID_4B8F%'" get DeviceID,PNPDeviceID 2>/dev/null | awk 'NR==2')