Created
July 14, 2025 04:39
-
-
Save knot126/12598e0656f7e38854721c70e865d13a to your computer and use it in GitHub Desktop.
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
| #!/usr/bin/env python | |
| from pathlib import Path | |
| from sys import argv | |
| # I would rather do a symbol lookup, but this works too :P | |
| uncrackedbytes = bytes([0xF3, 0x0F, 0x1E, 0xFA, 0x41, 0x54, 0x4C, 0x8D, 0x67, 0x58]) | |
| patch = b"\xb8\x01\x00\x00\x00\xc3" | |
| binary = Path(argv[1]).read_bytes() | |
| print(hex(binary.index(uncrackedbytes))) | |
| binary = binary.replace(uncrackedbytes, patch + (len(uncrackedbytes) - len(patch)) * b"\x00") | |
| Path(argv[1] + ".patched").write_bytes(binary) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment