Created
August 10, 2021 10:49
-
-
Save Sasszem/a75ee756902e6a005d5cc63b2af1d4fc to your computer and use it in GitHub Desktop.
RPGMAKER 2k(3) "protection" unfucker so you can open games in the editor
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
import os | |
EXTENSIONS = ("lmu", "ldb", "lmt") | |
GOOD_DATA = { | |
"lmu": b"\x0aLcfMapUnit", | |
"ldb": b"\x0BLcfDataBase", | |
"lmt": b"\x0aLcfMapTree", | |
} | |
files = filter(lambda x: x.split(".")[-1].lower() in EXTENSIONS, os.listdir(".")) | |
for fname in files: | |
with open(fname, "rb") as readf: | |
data = readf.read() | |
patched = GOOD_DATA[fname.split(".")[-1].lower()] | |
patched += data[len(patched):] | |
with open(fname, "wb") as writef: | |
writef.write(patched) | |
print("done") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment