Created
October 17, 2018 18:32
-
-
Save arisada/98590e331f71c31bd3b50a17e1ff9597 to your computer and use it in GitHub Desktop.
NOCD patch for Constructor (1997)
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/env python | |
# This script will let you play constructor without the CD | |
# in the drive. My retrogaming laptop has no CD drive. | |
f = open("GAME.EXE").read() | |
patches = [ | |
(272174,"\x74","\xeb"), | |
(642050,"\x83\x3d\x88\x3b\x04\x00\x00","\x90\x90\x90\x90\x90\x90\x90"), | |
(750753,"\x75","\xeb"), | |
(750850,"\xfa\xff\xff\xff","\x00\x00\x00\x00"), | |
(750887,"\x74","\xeb"), | |
] | |
for p in patches: | |
if f[p[0]:p[0] + len(p[1])] != p[1]: | |
print "Original data invalid. Already patched ?" | |
if f[p[0]:p[0] + len(p[1])] == p[2]: | |
print "Yes." | |
else: | |
print "No." | |
else: | |
f = f[:p[0]] + p[2] + f[p[0] + len(p[2]):] | |
patched = open("GAME_NOCD.EXE","w") | |
patched.write(f) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment