Skip to content

Instantly share code, notes, and snippets.

@shmerl
Last active January 8, 2022 17:40
Show Gist options
  • Save shmerl/baa5367fce111e6999a4 to your computer and use it in GitHub Desktop.
Save shmerl/baa5367fce111e6999a4 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Make sure you have bbe (binary block editor) installed.
# Run this from inside the Outlaws install directory.
files_to_patch=(
glide2x.dll
glide3x.dll
glide.dll
lecaur3d.dll
LECDP3.DLL
LECDSND.DLL
LECMUSIC.DLL
LECSMUSH.DLL
lecwave.dll
lecwsock.dll
Oljstick.dll
Olmouse.dll
)
backup_dir="winmm-backup"
patches_dir="patches.tmp"
mkdir $backup_dir
mkdir $patches_dir
echo "** backing up and patching..."
cp -v winmm.dll ${backup_dir}/
mv -v winmm.dll __nmm.dll
for src in ${files_to_patch[@]}
do
cp -v $src ${backup_dir}/
bbe -e "s/WINMM.dll/__NMM.dll/" $src -o ${patches_dir}/${src}
echo "'${src}' -> '${patches_dir}/${src}'"
done
echo "** enabling patches"
mv -v ${patches_dir}/* .
rmdir -v ${patches_dir}
echo "** All done. Backups are found in ${backup_dir}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment