
What I know so far is that there are 2 types of persistent file formats (new cPickle and old pickle) and they are both zlib compressed.
I've attached an example of both file types if anyone is wiling to take a look.
Code: Select all
# RenPy persistent unpickler 0.1
init python:
try:
import cPickle as pickle
except:
import pickle
import sys
import zlib
f = open("game/saves/persistent", "rb")
data = f.read().decode("zlib")
f.close()
index = pickle.loads(data)
f = open("game/saves/persistent.txt", "wb")
f.write(str(len(index.keys()))+"\\n")
for key in index.keys():
for offset, dlen, start in index[key]:
f.write(key+"\\n")
f.write(str(offset)+"\\n")
f.write(str(dlen)+"\\n")
f.write(str(start)+"\\n")
f.write("\\n")
f.close()
Code: Select all
Full traceback:
File "renpy/bootstrap.py", line 295, in bootstrap
renpy.main.main()
File "renpy/main.py", line 419, in main
game.context().run(node)
File "game/unpickle_persistent.rpy", line 3, in script
init python:
File "renpy/ast.py", line 814, in execute
renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
File "renpy/python.py", line 1719, in py_exec_bytecode
exec bytecode in globals, locals
File "game/unpickle_persistent.rpy", line 22, in <module>
f.write(str(len(index.keys()))+"\\n")
TypeError: 'NoneType' object is not callable
Code: Select all
python -O 1.py 1.dat 1.txt
Traceback (most recent call last):
File "1.py", line 18, in <module>
index = pickle.loads(data)
File "renpy/persistent.py", line 30, in <module>
from renpy.loadsave import dump, dumps, loads
File "renpy/loadsave.py", line 653, in <module>
unknown = renpy.object.Sentinel("unknown")
AttributeError: 'module' object has no attribute 'object'
Code: Select all
try:
import cPickle as pickle
except:
import pickle
#import io
#import os
import sys
import zlib
#import renpy
#import types
#import pickle
#from cStringIO import StringIO
f = open(sys.argv[1], "rb")
data = f.read().decode("zlib")
f.close()
index = pickle.loads(data)
f = open(sys.argv[2], "wb")
f.write(str(len(index.keys()))+"\\n")
for key in index.keys():
for offset, dlen, start in index[key]:
f.write(key+"\\n")
f.write(str(offset)+"\\n")
f.write(str(dlen)+"\\n")
f.write(str(start)+"\\n")
f.write("\\n")
f.close()