Skip to content

Instantly share code, notes, and snippets.

@Istar-Eldritch
Created July 6, 2018 18:01
Show Gist options
  • Save Istar-Eldritch/3d4847b26e006c8a5a349d95a6a7ac4f to your computer and use it in GitHub Desktop.
Save Istar-Eldritch/3d4847b26e006c8a5a349d95a6a7ac4f to your computer and use it in GitHub Desktop.
Patch Black Mesa
#! /bin/bash -e
# Requires bspatch ('bsdiff') and base64, mktemp ('coreutils').
cd "$(dirname "$0")"
PATCHFILE="$(mktemp)"
cleanup() {
rm -f "$PATCHFILE"
}
trap cleanup EXIT
test -f bin/libtogl.so.orig && mv -f bin/libtogl.so.orig bin/libtogl.so
base64 -d <<'EOF' >"$PATCHFILE"
QlNESUZGNDA2AAAAAAAAAEgAAAAAAAAAQ0ELAAAAAABCWmg5MUFZJlNZwK5BaQAABsVCSCgoAAAB
QAAEACAAIjIZNCDJiDlgMp9Nni7kinChIYFcgtJCWmg5MUFZJlNZE3UXkgAFpsYFwAQQABAAABBA
IAAJIABQgyYgKUoyZOA3iopfZKkN6VRKdwolOY5kolO/i7kinChICbqLyQBCWmg5F3JFOFCQAAAA
AA==
EOF
bspatch bin/libtogl.so bin/libtogl.so.hax "$PATCHFILE"
mv bin/libtogl.so bin/libtogl.so.orig
mv bin/libtogl.so.hax bin/libtogl.so
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment