#!/usr/bin/env python3 """Check architecture and absence of shared-library imports in Linux payloads.""" from pathlib import Path import os import shutil import struct import subprocess root=Path(__file__).resolve().parent.parent for folder in sorted((root/'dist').glob('wswg-*')): if not folder.is_dir(): continue platform,arch=folder.name.removeprefix('wswg-').split('-',1) expected={'amd64':'Advanced Micro Devices X86-64','386':'Intel 80386','arm':'ARM','armv7':'ARM','arm64':'AArch64'}[arch] if platform=='windows': for p in [folder/'wswg.exe',folder/'bin/wg.exe',folder/'bin/wireguard.exe',folder/'bin/wstunnel.exe']: b=p.read_bytes();offset=struct.unpack_from('