import ctypes import ctypes.wintypes import os import sys from pathlib import Path import struct # Windows API constants LOAD_LIBRARY_AS_DATAFILE = 0x00000002 DONT_RESOLVE_DLL_REFERENCES = 0x00000001 def check_dll_architecture(dll_path): """Check if DLL is 32-bit or 64-bit""" try: with open(dll_path, 'rb') as f: # Read DOS header dos_header = f.read(64) if dos_header[:2] != b'MZ': return "Not a valid PE file" # Get PE header offset pe_offset = struct.unpack(' 1: dll_path = sys.argv[1] print(f"Python Architecture: {check_python_architecture()}") print() check_dll_dependencies_windows(dll_path) test_cffi_loading(dll_path)