From 0979ab9ed03da8ac5fff479f13f567226a9be6d9 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Thu, 15 Feb 2018 08:49:56 -0600 Subject: [PATCH] proton: Match winedbg to the architecture type --- proton | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) 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('