From 6b253da1add394ec7ae177ee74b36f1ed73d0a51 Mon Sep 17 00:00:00 2001 From: Robin Koumis Date: Thu, 7 Mar 2024 15:31:55 -0500 Subject: [PATCH] Restore python x86 architecture requirement. --- .github/workflows/python-package-windows.yml | 1 + agent/agent.py | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/python-package-windows.yml b/.github/workflows/python-package-windows.yml index 8bf2437b4677..061dd2476ae4 100644 --- a/.github/workflows/python-package-windows.yml +++ b/.github/workflows/python-package-windows.yml @@ -27,6 +27,7 @@ jobs: with: python-version: ${{ matrix.python-version }} cache: 'pip' + architecture: 'x86' - name: Install dependencies run: pip install --upgrade pytest requests diff --git a/agent/agent.py b/agent/agent.py index 9dd036924fd4..158a138005a2 100644 --- a/agent/agent.py +++ b/agent/agent.py @@ -31,6 +31,13 @@ if sys.version_info[:2] < (3, 6): sys.exit("You are running an incompatible version of Python, please use >= 3.6") +# You must run x86 version not x64 +# The analysis process interacts with low-level Windows libraries that need a +# x86 Python to be running. +# (see https://github.com/kevoreilly/CAPEv2/issues/1680) +if sys.maxsize > 2**32 and sys.platform == "win32": + sys.exit("You should install python3 x86! not x64") + AGENT_VERSION = "0.14" AGENT_FEATURES = [ "execpy",