Last active
July 18, 2023 11:25
-
-
Save FaltoGH/b7563b425e10de41c56bf7af0dc4c864 to your computer and use it in GitHub Desktop.
CCLocalLevels.dat Decrypt
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
import base64, zlib, re | |
def decrypt(filename): | |
with open(filename, 'rb') as rbf: | |
dat = rbf.read() | |
a = [x^11 for x in dat] | |
b = bytearray(a).decode() | |
c = b.replace('-','+').replace('_','/') | |
d = c.encode() | |
e = base64.b64decode(d) | |
f = e[10:] | |
g = -zlib.MAX_WBITS | |
h = zlib.decompress(f, g) | |
i = h.decode() | |
return i | |
def decrypt2(levelcipher): | |
c = levelcipher.replace('-','+').replace('_','/') | |
d = c.encode() | |
e = base64.b64decode(d) | |
f = e[10:] | |
g = -zlib.MAX_WBITS | |
h = zlib.decompress(f, g) | |
i = h.decode() | |
return i | |
def decrypt3(filename): | |
xml = decrypt(filename) | |
levelcipher = re.findall('<k>k4</k><s>(.+)</s><k>k5</k>', xml)[0] | |
levelstring = decrypt2(levelcipher) | |
xml2 = xml.replace(levelcipher, levelstring) | |
return xml2 | |
xml = decrypt3('CCLocalLevels.dat') | |
with open('a.txt', 'wt') as wtf: | |
wtf.write(xml) |
idk but there will be a way in github or somewhere
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Wait, do you have a way to encrypt the data?