Skip to content

Instantly share code, notes, and snippets.

@oldnapalm
Created January 9, 2024 17:57
Show Gist options
  • Select an option

  • Save oldnapalm/fe5fa185d9f3ef227a76c0f1e2bf3073 to your computer and use it in GitHub Desktop.

Select an option

Save oldnapalm/fe5fa185d9f3ef227a76c0f1e2bf3073 to your computer and use it in GitHub Desktop.
Zwift camera shake patcher
import os
name = 'ZwiftApp.exe'
find = b'\x48\x8b\xc4\x53\x55\x56\x57\x41\x54\x41\x55\x41\x56\x41\x57\x48\x81\xec\xd8\x00\x00\x00'
repl = b'\x0f\x57\xc0\xc3\x35\x56\x57\x41\x54\x41\x55\x41\x56\x41\x57\x48\x81\xec\xd8\x00\x00\x00'
if os.path.isfile(name):
with open(name, 'rb') as f:
orig = f.read()
patched = orig.replace(find, repl)
if patched != orig:
bak = name + '.bak'
if os.path.isfile(bak):
os.remove(bak)
os.rename(name, bak)
with open(name, 'wb') as f:
f.write(patched)
print(name, 'patched')
elif orig.find(repl):
print(name, 'is already patched')
else:
print('Pattern not found')
else:
print(name, 'not found')
input()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment