#!/usr/bin/env bash set -euo pipefail exe="$1" core="advapi32 api-ms-win-core-synch-l1-2-0 api-ms-win-core-winrt-error-l1-1-0 api-ms-win-core-winrt-l1-1-0 api-ms-win-shcore-scaling-l1-1-1 bcrypt bcryptprimitives combase comctl32 coremessaging crypt32 d3d11 dcomp dwmapi dwrite dxgi gdi32 gdiplus icuuc imm32 kernel32 mmdevapi msimg32 ntdll ole32 oleaut32 pdh powrprof propsys psapi shell32 uiautomationcore user32 userenv winmm ws2_32" extra=$(objdump -p "$exe" | sed -n 's/.*DLL Name: //p' | tr A-Z a-z | sed 's/\.dll$//' | sort -u | grep -vxF -f <(tr ' ' '\n' <<<"$core" | grep .) || true) [ -z "$extra" ] && { echo "imports ok"; exit 0; } echo "not on every Windows, delay-load and guard it: $extra" exit 1