Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Wine Blockland server guide for Linux VPS (Debian)
#2
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.

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
Reply


Messages In This Thread
RE: Wine Blockland server guide for Linux VPS (Debian) - by Queuenard - 05-25-2026, 03:31 AM