Skip to content

Instantly share code, notes, and snippets.

@Sasszem
Created August 10, 2021 10:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sasszem/a75ee756902e6a005d5cc63b2af1d4fc to your computer and use it in GitHub Desktop.
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
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