Last active
October 24, 2020 04:35
-
-
Save nosoop/5dedc578288619e22d57e61b7ce83c21 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/python3 | |
""" | |
Finds the location of the given string and patches the first character to the null terminator, | |
preventing the message from being displayed in the server console. | |
This can be executed while the server is running. | |
""" | |
import mmap | |
with open('steamclient.so', 'rb+') as bin: | |
mbin = mmap.mmap(bin.fileno(), length = 0, access = mmap.ACCESS_WRITE) | |
offset = mbin.find("RecordSteamInterfaceCreation (PID %d): %s / %s".encode('ascii')) | |
if offset == -1: | |
print('Failed to patch string.') | |
else: | |
mbin.seek(offset) | |
mbin.write_byte(0) | |
mbin.flush() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment