From 217817fa8302b4ff6cc9f47eff1d0e26554e80fd Mon Sep 17 00:00:00 2001 From: The412Banner Date: Sun, 29 Nov 2026 23:04:09 -0500 Subject: [PATCH] fix(upscale): read every export row whatever objdump prints above them The check skipped two lines after the export table header, but older binutils (CI's) print no column titles there, so the first export (ffxConfigure) was never read. --- tools/upscale/bridges/pe.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tools/upscale/bridges/pe.py b/tools/upscale/bridges/pe.py index 2a874c9f90..c98f131393 100644 --- a/tools/upscale/bridges/pe.py +++ b/tools/upscale/bridges/pe.py @@ -51,11 +51,16 @@ def exports(dll, objdump): table = report.split('[Ordinal/Name Pointer] Table', 1) if len(table) != 2: sys.exit(f'{dll}: no export table') + # One row per export, "[ 0] +base[ 1] 0000 name" (binutils 2.45) or "[ 0] name" (older): the rows + # start with an index in brackets; the column titles some versions print do not. names = [] - for line in table[1].splitlines()[2:]: + for line in table[1].splitlines()[1:]: if not line.strip(): - break - names.append(line.split()[-1]) + if names: + break + continue + if re.match(r'\s*\[\s*\d+\]', line): + names.append(line.split()[-1]) if len(names) != len(set(names)): sys.exit(f'{dll}: duplicate exports') return set(names)