Skip to content

Instantly share code, notes, and snippets.

@shmerl
Last active May 4, 2022 00:56
Show Gist options
  • Save shmerl/4458375a3529995ed6b41b1ce1718eeb to your computer and use it in GitHub Desktop.
Save shmerl/4458375a3529995ed6b41b1ce1718eeb to your computer and use it in GitHub Desktop.
#!/bin/bash
# Fixing Saboteur to run on CPUs with more than 4 cores.
# Thanks to jackfuste from WSGF, who found the fix.
# Make sure you have xxd installed
game_dir="$1"
game_binary="${game_dir}/Saboteur.exe"
gog_ver_sha512='d53682d0a0973cd1dfef97d3a2b55204298b89f16ac400e29aebb6b2143903758bbbb15c82de28ef0586dbfac7fb7a407f1c7c547419602ae1e9e0e601262c8e'
patched_sha512='884df371f4ec7c6cc79d5d1e2b37191b01db7e3f66c3ed5621e54f6164b3188b66b82eba833377924388e94a53886290b50613635bc889ae46c4fac2191ad443'
current_sha512=$(sha512sum "$game_binary" | cut -d ' ' -f 1)
if [[ "$current_sha512" == "$patched_sha512" ]]; then
echo "Game is already patched, nothing to do."
exit 0
elif [[ "$current_sha512" != "$gog_ver_sha512" ]]; then
echo "You have incorrect version! Aborting."
exit 1
fi
echo "Patching..."
echo "9f56d0: eb" | xxd -r - "${game_dir}/Saboteur.exe"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment