diff --git a/proton b/proton index d3e0b1e1..672a2fff 100755 --- a/proton +++ b/proton @@ -6,6 +6,7 @@ import filecmp import json import os import shutil +import struct import subprocess import sys import tarfile @@ -206,6 +207,34 @@ else: make_dxvk_links(basedir + "/dist/lib/wine/", prefix + "drive_c/windows/syswow64") +ARCH_UNKNOWN=0 +ARCH_I386=1 +ARCH_X86_64=2 +def determine_architecture(path): + #algorithm from file's msdos magic file + with open(path, "rb") as f: + magic = f.read(2) + if magic != "MZ": + return ARCH_UNKNOWN + f.seek(0x18) + reloc = struct.unpack('