Created
May 25, 2018 23:22
-
-
Save PeterHindes/f441f27423e46b36a818f9f7243b0105 to your computer and use it in GitHub Desktop.
Fix Battle Block Theater Error That The Devs Refuse To
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
FILE=BattleBlockTheater | |
MD5_PRE=436e91811d8a38de1918991969347b3d | |
MD5_POST=71eb6519233b21d85c858b39f2b4871f | |
OFFSET=0x24f2b9 | |
PAYLOAD='\x90\x90' | |
function getMD5() | |
{ | |
echo $(md5sum "${1}" | cut -d ' ' -f 1) | |
} | |
if [[ ${MD5_PRE} != $(getMD5 ${FILE}) ]] | |
then | |
echo Input has wrong checksum. Already patched? | |
exit 11 | |
fi | |
echo -ne ${PAYLOAD} | dd if=/dev/stdin of="${FILE}" bs=1 conv=notrunc seek=$((${OFFSET})) status=none | |
if [[ $? != 0 ]] | |
then | |
echo Patching binary failed. | |
exit 77 | |
fi | |
if [[ ${MD5_POST} != $(getMD5 ${FILE}) ]] | |
then | |
echo Output has wrong checksum. Expect trouble! | |
exit 22 | |
fi | |
echo Yay... everything went well. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to use this
-Steam User: de.nagical[linux]