Created
January 31, 2023 22:28
-
-
Save ReplayCoding/2e139a764aa13abfbc6e9099bf21f9a5 to your computer and use it in GitHub Desktop.
discord krisp patcher
This file contains hidden or 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 sys | |
import lief | |
replacement_code = [ | |
0x48, 0xC7, 0xC0, 0x01, 0x00, 0x00, 0x00, # mov rax, 0x1 | |
0xC3 # ret | |
] | |
with open(sys.argv[1], "rb") as input_file, open(sys.argv[2], "wb") as output_file: | |
input_bytes = list(input_file.read()) | |
input_file.seek(0) | |
krisp_module = lief.parse(input_file) | |
for symbol in krisp_module.symbols: | |
if "IsSignedByDiscord" in symbol.name: | |
signing_func_address = krisp_module.virtual_address_to_offset(symbol.value) | |
for i, b in enumerate(replacement_code): | |
input_bytes[i + signing_func_address] = b | |
output_file.write(bytes(input_bytes)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment