First post, by ripa
edit2: just enable Catalyst A.I. instead of the following hack 😉
Posting this in case it helps someone else in the future.
I couldn't get Soldier of Fortune II working on my computer (Windows XP, Radeon HD4650). Both single-player and multi-player executables would crash to desktop without any error pop-up immediately after the startup console window. According to web search results, the culprit is an AMD video driver update related to OpenGL (keyword: OpenGL extension limit), but that it is supposed to have been fixed in a newer version. All solutions I could find for this problem were unhelpful (upgrade/downgrade drivers or use some outdated OpenGL DLL).
Fortunately, I found a really easy fix that has worked for me:
- open SoF2.exe in a hex editor
- find the string beginning with "GL_EXTENSIONS:" (without the quotes)
- REPLACE (do not ADD or REMOVE) the five ASCII characters following the colon with five null bytes (= bytes with value 0, actually replacing just the first byte should be enough)
- repeat this for the "WGL_EXTENSIONS:" string
- save and repeat the same procedure for SoF2MP.exe
- enjoy(?) the game
Explanation:
- the game queries the OpenGL driver for a list of OpenGL extension names, of which there are more in newer drivers
- there seems to be a buffer overflow error related to printing the list (or a long string), which causes the crash
- terminating the print format string early with null bytes prevents the print function from parsing the %s specifier and triggering the error
edit: This might work for other Quake 3 / Id Tech 3 engine based games as long as the executable is unpacked.