Last active
August 15, 2021 09:48
-
-
Save AlexP11223/73f72bbfeaeac99c945ac63ccd9dd06f to your computer and use it in GitHub Desktop.
Set the file path and launch the script using Python 3. It will update the checksum at the end of gameinputmodule.pf. https://www.pcgamingwiki.com/wiki/Mafia:_Definitive_Edition#Map_Extended_Mouse_Buttons
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
import os | |
import zlib | |
# for Linux (Steam/Proton): | |
# /home/<USER>/.steam/debian-installation/steamapps/compatdata/1030840/pfx/drive_c/users/steamuser/My Documents/My Games/Mafia Definitive Edition/Data/<USER_ID>/profiles/temporaryprofile/gameinputmodule.pf | |
file_path = 'C:/Users/<USER>/My Documents/My Games/Mafia Definitive Edition/Data/<USER_ID>/profiles/temporaryprofile/gameinputmodule.pf' | |
size = os.path.getsize(file_path) | |
with open(file_path, 'rb+') as f: | |
data = f.read(size - 4) | |
crc = zlib.crc32(data) | |
print(hex(crc & 0xffffffff)) | |
f.write(crc.to_bytes(4, byteorder='little')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment