Yes, it’s another one of “those” posts. Reason for this is, that Humble Bundle is currently [giving away] the crowdfunded title “The Red Solstice” for free, so I picked up a copy to see whether I could get it to work on Windows XP x64 (and also 32-bit XP). Why not, right? Ah, you need Steam for this by the way.
This game is the first one I’ve seen on the Desktop which is actually using OpenGL ES instead of OpenGL or just Direct3D. Typically, that API is more widespread on mobile devices running Android or something, as it’s slimmer and brings a reduced feature set of the “real” OpenGL to the table. The bundled version is OpenGL ES 2.0, and instead of some modern GPGPU language like HLSL it uses nVidias’ old Cg library, which is luckily compatible with XP. The game developer [Ironward] seems to claim that this game, which is based on something called the “TRSEngine” needs Windows 7 or newer to run however.
2.) Required tools
To be able to reproduce the hack described in this post you will need the following tools:
- NTCore [CFF Explorer]
- Oleg Ovcharenkos’ [Stellaris Hack]
- Steve P. Millers’ [Dependency Walker] in its 32-bit / x86 version. This is completely optional, though.
3.) Fixing the platform target
The game has been compiled for a NT 6.0 or Windows Vista platform target, so launching it as-is will result in the dreaded “not a Win32 application” error:
The fact that the program was built with an NT 6.0 platform target doesn’t necessarily mean that it actually needs any modern functions of Vista/7/8/10, so the first step is usually to fix the binary headers and change that platform level to something lower, usually 5.1 (XP) for 32-bit code or 5.2 (XP x64 / Server 2003) for 64-bit code. The Red Solstice is a 32-bit game, so it’s going to be 5.1. Sometimes, this can be enough.
As an example, launch CFF Explorer and open the Game.exe from the games’ installation folder, then click on Nt Headers -> Optional Header. I’ve marked the important parts in red for you:
To fix this, change the values from
0001, this corresponds to changing the required platform from NT 6.0 to 5.1.
After the change, save and overwrite the existing file, but create a backup first, if you wish to be able to revert from the change quickly.
Fixing that one file won’t be enough though. In total, you’ll need to apply the hack seen above to the following files:
- icudt51.dll (Unicode library)
- icuin51.dll (Unicode library)
- icuuc51.dll (Unicode library)
- libEGL.dll (Platform-specific glue layer for OpenGL ES on Windows)
- libGLESv2.dll (OpenGL ES 2.0)
- libogg.dll (OGG vorbis audio decoder)
- libtheoraplayer.dll (Theora audio decoder)
- OpenAL32.dll (OpenAL audio API)
- Qt5Core.dll (Qt5 2D GUI library)
- Qt5Gui.dll (Qt5 2D GUI library)
- Qt5Widgets.dll (Qt5 2D GUI library)
- platforms\qwindows.dll (Platform-specific glue layer for Qt5 on Windows)
It’ll take about 1-2 minutes to fix all of them I guess. However, if you attempt to run the game after that, it’ll still fall on its face with a different error:
Inspecting the Game.exe with Steve Millers’ Dependency Walker shows, that the problem is actually limited to
GetTickCount64(), so it’s the one and only missing kernel API function call we’ll have to deal with:
Alright, let’s get to it!
4.) Fixing the
This is a bit trickier, as we need to present a
GetTickCount64() function to the game, that will do something useful. For this we’ll use Oleg Ovcharenkos’ Stellaris hack, which allows us to redirect that missing call to the legacy
GetTickCount() that Windows XP does have.
Unpack the software into some directory of your choice and copy the Game.exe of “The Red Solstice” into that directory as well. Olegs’ hack isn’t prepared for this game yet, so copy one of the existing scripts such as xp_Stellaris_1.6.cmd to a new script file, e.g. xp_TheRedSolstice_1.6.cmd. Open the file in your favorite text editor, and make sure it contains exactly and only the following lines:
@ECHO OFF rundll32 zernel32.dll,PatchFile Game.exe
Save the file, and run it by double-clicking on it or by launching it directly from a command line terminal. It’ll patch the game so it calls the stub DLL zernel32.dll and some other z* libraries, which fixes some missing calls and redirect the rest to the platforms kernel API as-is. It’ll also create a backup copy of Game.exe for you. Now you have to copy the following files from the folder containing Olegs’ hack back to the actual game folder:
5.) Finally: Running the game on XP
With the platform target hack done with CFF Explorer and the
GetTickCount() redirection done by Olegs’ Stellaris hack we can finally launch the game:
I have to say that I haven’t tested this extensively so far, but a few brief gameplay tests have been conducted:
There you go, another modern game hacked to run on ancient Windows XP & XP x64!