From 53931c905a1e522d3c60bfbff4757aa5785c0442 Mon Sep 17 00:00:00 2001 From: Antoine van Gelder Date: Mon, 12 Aug 2024 15:57:09 +0200 Subject: [PATCH 1/2] docs: add a warning that windows is not currently supported to the facedancer/usbproxy guides --- docs/source/getting_started_facedancer.rst | 6 ++++++ docs/source/getting_started_usbproxy.rst | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/docs/source/getting_started_facedancer.rst b/docs/source/getting_started_facedancer.rst index b6bc7824..89113bb4 100644 --- a/docs/source/getting_started_facedancer.rst +++ b/docs/source/getting_started_facedancer.rst @@ -2,6 +2,12 @@ Using Cynthion with Facedancer ============================== +.. warning:: + + Facedancer is not currently supported on Windows. Attempting to use Facedancer on Windows may cause USB analysis to stop working. + + For more information please see the tracking issue: `#170 `__ + Before proceeding, please ensure you have completed all steps in the :doc:`getting_started` section. diff --git a/docs/source/getting_started_usbproxy.rst b/docs/source/getting_started_usbproxy.rst index 52bbdb96..f31f232f 100644 --- a/docs/source/getting_started_usbproxy.rst +++ b/docs/source/getting_started_usbproxy.rst @@ -2,6 +2,12 @@ Using Cynthion with USB Proxy ============================= +.. warning:: + + USBProxy is not currently supported on Windows. Attempting to use USB Proxy on Windows may cause USB analysis to stop working. + + For more information please see the tracking issue: `#170 `__ + Before proceeding, please ensure you have completed all steps in the :doc:`getting_started` and :doc:`getting_started_facedancer` sections. From 6a3001906e41ef481e237a9c678c33777ec271f0 Mon Sep 17 00:00:00 2001 From: Antoine van Gelder Date: Mon, 12 Aug 2024 15:57:39 +0200 Subject: [PATCH 2/2] cli: display a helpful message and exit when trying to run or flash facedancer on windows --- cynthion/python/src/commands/cynthion_flash.py | 10 +++++++++- cynthion/python/src/commands/cynthion_run.py | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/cynthion/python/src/commands/cynthion_flash.py b/cynthion/python/src/commands/cynthion_flash.py index f63b50f2..9621d708 100644 --- a/cynthion/python/src/commands/cynthion_flash.py +++ b/cynthion/python/src/commands/cynthion_flash.py @@ -7,7 +7,7 @@ """ Cynthion 'flash' command. """ -import logging +import logging, platform, sys from .util import find_cynthion_asset, find_cynthion_bitstream from .util import flash_bitstream, flash_mcu_firmware, flash_soc_firmware @@ -23,6 +23,14 @@ def cynthion_flash(device, args): elif args.target == "analyzer": flash_bitstream(device, find_cynthion_bitstream(device, "analyzer.bit")) elif args.target == "facedancer": + if platform.system() == "Windows": + logging.error("\nFacedancer and USBProxy are not currently supported on Windows.") + logging.error("Attempting to use Facedancer or USBProxy on Windows may cause") + logging.error("USB analysis to stop working.\n") + logging.error("For more information please see the tracking issue:\n") + logging.error(" https://github.com/greatscottgadgets/cynthion/issues/170\n") + logging.error("Command aborted.") + sys.exit(1) flash_soc_firmware(device, find_cynthion_asset("moondancer.bin")) flash_bitstream(device, find_cynthion_bitstream(device, "facedancer.bit")) elif args.target == "selftest": diff --git a/cynthion/python/src/commands/cynthion_run.py b/cynthion/python/src/commands/cynthion_run.py index 163612f5..eec88b59 100644 --- a/cynthion/python/src/commands/cynthion_run.py +++ b/cynthion/python/src/commands/cynthion_run.py @@ -7,7 +7,7 @@ """ Cynthion 'run' command. """ -import logging, os, subprocess, sys, tempfile +import logging, os, platform, subprocess, sys, tempfile from .util import find_cynthion_asset, find_cynthion_bitstream from .util import flash_soc_firmware, run_bitstream @@ -21,6 +21,14 @@ def cynthion_run(device, args): run_bitstream(device, find_cynthion_bitstream(device, f"analyzer.bit")) elif args.target == "facedancer": + if platform.system() == "Windows": + logging.error("\nFacedancer and USBProxy are not currently supported on Windows.") + logging.error("Attempting to use Facedancer or USBProxy on Windows may cause") + logging.error("USB analysis to stop working.\n") + logging.error("For more information please see the tracking issue:\n") + logging.error(" https://github.com/greatscottgadgets/cynthion/issues/170\n") + logging.error("Command aborted.") + sys.exit(1) flash_soc_firmware(device, find_cynthion_asset("moondancer.bin")) run_bitstream(device, find_cynthion_bitstream(device, f"facedancer.bit"))