Last active
November 14, 2025 02:09
-
-
Save nyanpasu64/5e39504547328b8c2109687b00bc0522 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/python3 | |
| """Based on https://board.eclipse.cx/viewtopic.php?t=652 .""" | |
| import sys | |
| version = (5, 0) | |
| path = sys.argv[1] | |
| with open(path, "rb+") as f: | |
| # offset varies! AltBacktick vs 010keygen | |
| """ | |
| PIMAGE_DOS_HEADER pDosHeader = (PIMAGE_DOS_HEADER)pBuffer; | |
| PIMAGE_NT_HEADERS32 pNTHeaders = (PIMAGE_NT_HEADERS)((DWORD)pBuffer + pDosHeader->e_lfanew); | |
| """ | |
| f.seek(0x3c) | |
| AddressOfNewExeHeader = int.from_bytes(f.read(4), "little") | |
| addrMajorOperatingSystemVersion = AddressOfNewExeHeader + 0x40 | |
| f.seek(addrMajorOperatingSystemVersion) | |
| oldver_b = f.read(4) | |
| oldver = (int.from_bytes(oldver_b[0:2], "little"), int.from_bytes(oldver_b[2:4], "little")) | |
| print("Current version:", oldver) | |
| print("New version:", version) | |
| version_b = b"".join(i.to_bytes(2, "little") for i in version) | |
| f.seek(addrMajorOperatingSystemVersion) | |
| f.write(version_b) | |
| f.flush() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment