mirror of
https://github.com/ValveSoftware/Proton.git
synced 2025-01-16 08:38:16 +03:00
2a79f04f67
This reverts commit 74a40b17aa2003378bb48d2adb07d9bbe010d26b. To prevent people from running Destiny 2 so they won't get banned.
26 lines
679 B
Python
Executable File
26 lines
679 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
import sys
|
|
import os
|
|
import stat
|
|
import pefile
|
|
|
|
for path in sys.argv[1:]:
|
|
pe = pefile.PE(path)
|
|
|
|
for section in pe.sections:
|
|
if section.Name.decode("utf-8")[0:5] == ".text":
|
|
section.Characteristics &= ~pefile.SECTION_CHARACTERISTICS['IMAGE_SCN_CNT_INITIALIZED_DATA']
|
|
section.Characteristics &= ~pefile.SECTION_CHARACTERISTICS['IMAGE_SCN_ALIGN_MASK']
|
|
|
|
pe.OPTIONAL_HEADER.CheckSum = pe.generate_checksum()
|
|
|
|
perm = stat.S_IMODE(os.stat(path).st_mode)
|
|
if (perm & stat.S_IWUSR) == 0:
|
|
os.chmod(path, perm | stat.S_IWUSR)
|
|
|
|
pe.write(path)
|
|
|
|
if (perm & stat.S_IWUSR) == 0:
|
|
os.chmod(path, perm)
|