Fixing Keepsake Game display
Quick write-up on a challenge from Nathan Baggs
TLDR; If you don't care about the write up, just go to https://raw.githubusercontent.com/crystalspace/CS/refs/heads/master/vfs.cfg and replace your Keepsake/bin/vfs.cfg with that one. You can also dl patch 1.6 or unofficial 1.7
I often watch Nathan's youtube channel; lots of cool content around REing and fixing old games. Recently, Nathan published a challenge on his discord; the hack-it fix-it challenge.

I liked the idea; picking up an old game and fixing it for modern operating system. Looks like the steam version of the game was crashing. The version I picked up however, was the non steam version. I found mine on the internet archive [1] but you can also find it on websites and other initiatives that aim to archive and preserve old games like old-games.com ; I thought I'd focus on that version.
The version I downloaded was an iso; we can quickly install it and when we try to launch it using KeepSake.exe, we get:

So that's our first error and clue. Just moving past that by clicking Yes, we'll quickly see that the game fails to render most stuff making it basically unplayable. I thought this could be interesting to try and fix as well instead of fixing the steam crash. Mostly because I did a quick google search for Keepsake render issues and didn't find any fix suggestions so I thought I could look into it and help anyone hitting the same issue. The Keepsake version I had was 1.3
First I took a look at Keepsake.exe ; this is a 48kb x86 file; pretty simple and is just a launcher for the game. We quickly see in WinMain references to the larger keepsake.dll and sub_401000 calling LoadLibraryA with the //bin/keepsake.dll path

The larger keepsake.dll contains most of the core logic. In order to fix our display issues, I had a couple of theories in mind; I'd have to either update some rendering dll like directx or opengl which might lead to more issues or patch one or more function erroring during display. I thought I'd start with our error popup; I opened the strings window in keepsake.dll , found our error message and xrefd that.
That string is passed to MessageBoxA; pretty standard:

I called this sub "Showdriverwarning" and xrefd it again. That leads us to the game initialization subroutine.

We see the cs_OpenApplication string a bit above our MessageBoxA call and multiple string references to crystalspace like: crystalspace.utilities.reporter crystalspace.level.loader etc.
A quick Google search helps us find a github for the crystalspace SDK: https://github.com/crystalspace/CS/tree/master which is the 3d engine used here. We can look for our cs_OpenApplication and find that it's part of a VFT and see it's implementation:

Ida shows the string reference (likely because of RTTI?) and further down has call dword ptr [eax+offset] which are pretty common for object method calls.
One thing I noticed in the crystalspace repo was the vfs.cfg (config file for Virtual File System); the one we had in KeepSake 1.3 was 0kb and empty. This one had a number of things which seemed important to ensure the CrystalSpace engine was working correctly. Copying it's content over to our file fixed the rendering issues we were seeing but we still got the annoying messageboxA popup.
Ok last thing I wanted to do was remove the annoying "update your drivers" messagebox warning since it was pretty useless. That was pretty simple. Just had to patch our jnz short loc_1002F3E2 for jmp short loc_1002F3E2 and we can now just run the game
I tried to reproduce the crashes using the save files that webfischi dropped in there but I couldn't reproduce them. Maybe because I wasn't using the steam version?
References:
Last updated