patch.sh 620 B

1234567891011121314151617181920212223
  1. #!/bin/bash
  2. FILE="UnityPlayer.dll"
  3. sum=($(md5sum $FILE))
  4. if [ "${sum}" != "a85caddc4d1e5838f404956e99995d27" ]; then
  5. echo "Wrong file version or patch is already applied"
  6. echo "md5sum: ${sum}"
  7. exit 1
  8. fi
  9. # Include timestamps et all
  10. cp --preserve=all UnityPlayer.dll UnityPlayer.dll.bak
  11. # Skip "mhyprot2.sys" init function. No need for "mhyprotect.sys".
  12. dd if=<(echo -ne "\xc3") of=UnityPlayer.dll bs=1 seek=$((0x014CDDB0)) conv=notrunc
  13. # Prevent access to uninitialized data (~ segfault)
  14. dd if=<(echo -ne "\x31\xd2") of=UnityPlayer.dll bs=1 seek=$((0x01CA75C3)) conv=notrunc
  15. echo "==> Patch applied!"
  16. exit 0