Soldier of Fortune on Linux with custom display resolutions

I made a small hack to allow you to play SoF in any resolution you want (The famous SoF Resolution Hack).

It works by preloading a bit of code that will plug a different resolution into the memory structure that the game engine uses to set the OpenGL display resolution.

screenshot

Download

Binary and source: SofResolutionHack.tar.gz 2.4 KiB (SHA256:d31fac04e2d75218e65df2234c8af4548ea64ece2a1af8dbbee8f3921d8da0f1)

README.txt

Using this hack is very easy. 3 steps.
 - If you don't use pulseaudio, remove the . padsp line.
 - If you want another resolution, simply replace 2560 and 1440 with the width and height you want.

* 0. Copy ResHook.so into your sof directory so it is next to the sof and sof-bin files.
* 1. Open ~/.loki/sof/config.cfg and set gl_mode "9"
* 2. Open the sof file inside the sof directory with an editor, go to the end of the file and replace:

  if [ -x "${SOF_DATA_PATH}/sof-bin" ]; then
	  ${SOF_DATA_PATH}/sof-bin $*
  fi

* With:

export SOF_WIDTH=2560
export SOF_HEIGHT=1440
source padsp
export LD_PRELOAD="$LD_PRELOAD $SOF_DATA_PATH/ResHook.so"

if [ -x "${SOF_DATA_PATH}/sof-bin" ]; then
	${SOF_DATA_PATH}/sof-bin $*
fi

<‐ Back

Last edited: 2016-06-19 - No need for a disclaimer, I've done nothing wrong!