patch.sh 705 B

123456789101112131415161718192021222324
  1. #!/bin/bash
  2. FILE="UnityPlayer.dll"
  3. sum=($(md5sum $FILE))
  4. if [ "${sum}" != "76c77812286e04474b3644b5e1cc26ed" ]; 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 both service init functions (mhyprotect.sys is redundant)
  12. dd if=<(echo -ne "\xc3") of=UnityPlayer.dll bs=1 seek=$((0x0148BDD0)) conv=notrunc
  13. dd if=<(echo -ne "\xc3") of=UnityPlayer.dll bs=1 seek=$((0x0148C420)) conv=notrunc
  14. # Prevent access to uninitialized data (~ segfault)
  15. dd if=<(echo -ne "\x31\xed") of=UnityPlayer.dll bs=1 seek=$((0x01B30933)) conv=notrunc
  16. echo "==> Patch applied!"
  17. exit 0