Major breakthrough.
By changing the Blockland executable's subsystem from 2 to 3 (IMAGE_SUBSYSTEM_WINDOWS_GUI -> IMAGE_SUBSYSTEM_WINDOWS_CUI) Wine can then correctly handle console input and output as a normal console application. The requirements of having xvfb and WineFix.dll would be dropped.
The Torque executable is compiled with the WINDOWS_GUI subsystem flag (which is meant for applications that spawn windows on the desktop) but spawns its own console window. It's probably a miracle the console even worked in some older versions of Wine.
Converting an executable can be done in 10 lines of Python with python3-pefile installed. I also assigned MajorSubsystemVersion to 4 because that's what console applications appear to use.
A full solution needs some time to finish.
Credit to Trigun for mentioning subsystem designations which proved to be the key to fixing the problem.
Resources used
https://learn.microsoft.com/en-us/window...-subsystem
https://www.devever.net/~hl/win32con
https://stackoverflow.com/questions/4935...000#494000
https://devblogs.microsoft.com/oldnewthi...0/?p=19643
By changing the Blockland executable's subsystem from 2 to 3 (IMAGE_SUBSYSTEM_WINDOWS_GUI -> IMAGE_SUBSYSTEM_WINDOWS_CUI) Wine can then correctly handle console input and output as a normal console application. The requirements of having xvfb and WineFix.dll would be dropped.
The Torque executable is compiled with the WINDOWS_GUI subsystem flag (which is meant for applications that spawn windows on the desktop) but spawns its own console window. It's probably a miracle the console even worked in some older versions of Wine.
Converting an executable can be done in 10 lines of Python with python3-pefile installed. I also assigned MajorSubsystemVersion to 4 because that's what console applications appear to use.
Code:
import pefile
exe_path = "Blockland.exe"
new_exe_path = "Blockland.patched.exe"
print(' - Input file: '+ exe_path)
pe = pefile.PE(exe_path)
pe.OPTIONAL_HEADER.Subsystem = 3
pe.OPTIONAL_HEADER.MajorSubsystemVersion = 4
pe.OPTIONAL_HEADER.MinorSubsystemVersion = 0
print(' - Writing new EXE with modified headers...')
pe.write(new_exe_path)A full solution needs some time to finish.
Credit to Trigun for mentioning subsystem designations which proved to be the key to fixing the problem.
Resources used
https://learn.microsoft.com/en-us/window...-subsystem
https://www.devever.net/~hl/win32con
https://stackoverflow.com/questions/4935...000#494000
https://devblogs.microsoft.com/oldnewthi...0/?p=19643

