CensoredUsername / unrpyc

A ren'py script decompiler
Other
852 stars 154 forks source link

AttributeError: 'RevertableList' object has no attribute 'extend' #71

Closed sdn3rd closed 6 years ago

sdn3rd commented 6 years ago

Decompiling intro.rpyc to intro.txt... Error while decompiling intro.rpyc: Traceback (most recent call last): File "/usr/bin/unrpyc", line 131, in worker no_pyexpr=args.no_pyexpr, comparable=args.comparable, translator=translator, init_offset=args.init_offset) File "/usr/bin/unrpyc", line 96, in decompile_rpyc ast = read_ast_from_file(in_file) File "/usr/bin/unrpyc", line 79, in read_ast_from_file data, stmts = magic.safe_loads(raw_contents, class_factory, {"_ast"}) File "/usr/local/lib/python2.7/dist-packages/decompiler/magic.py", line 599, in safe_loads encoding=encoding, errors=errors).load() File "/usr/lib/python2.7/pickle.py", line 864, in load dispatchkey File "/usr/lib/python2.7/pickle.py", line 1195, in load_appends list.extend(stack[mark + 1:]) AttributeError: 'RevertableList' object has no attribute 'extend'

CensoredUsername commented 6 years ago

Sounds like a duplicate of #70. Try this branch. RevertableLists should never appear in normal script outputs unless the game does terrible, terrible things.

sdn3rd commented 6 years ago

Decompiling tutorial.rpyc to scripts/mechanics/tutorial.rpy.... Decompiling items.rpyc to items.rpy... Decompiling script_version.txt to script_version.rpy... Error while decompiling script_version.txt: Traceback (most recent call last): File "/usr/bin/unrpyc", line 131, in worker no_pyexpr=args.no_pyexpr, comparable=args.comparable, translator=translator, init_offset=args.init_offset) File "/usr/bin/unrpyc", line 96, in decompile_rpyc ast = read_ast_from_file(in_file) File "/usr/bin/unrpyc", line 78, in read_ast_from_file raw_contents = raw_contents.decode('zlib') File "/usr/lib/python2.7/encodings/zlib_codec.py", line 43, in zlib_decode output = zlib.decompress(input) error: Error -3 while decompressing data: incorrect header check

CensoredUsername commented 6 years ago

Consider not trying to decompile a text file. script_version.txt is not a .rpyc file.

sdn3rd commented 6 years ago

Sorry, here:

Decompiling intro1_ch2_menus.rpyc to intro1_ch2_menus.rpy... Error while decompiling intro1_ch2_menus.rpyc: Traceback (most recent call last): File "/usr/bin/unrpyc", line 131, in worker no_pyexpr=args.no_pyexpr, comparable=args.comparable, translator=translator, init_offset=args.init_offset) File "/usr/bin/unrpyc", line 96, in decompile_rpyc ast = read_ast_from_file(in_file) File "/usr/bin/unrpyc", line 79, in read_ast_from_file data, stmts = magic.safe_loads(raw_contents, class_factory, {"_ast"}) File "/usr/local/lib/python2.7/dist-packages/decompiler/magic.py", line 599, in safe_loads encoding=encoding, errors=errors).load() File "/usr/lib/python2.7/pickle.py", line 864, in load dispatchkey File "/usr/lib/python2.7/pickle.py", line 1195, in load_appends list.extend(stack[mark + 1:]) AttributeError: 'RevertableList' object has no attribute 'extend'

Decompilation of 1 file failed

Same issue as before even with that branch

sdn3rd commented 6 years ago

Btw, it has russian characters in it.

CensoredUsername commented 6 years ago

The russian characters shouldn't be an issue. The game is doing some weird stuff cause there's RevertableLists in the serialized script format which really shouldn't be the case. That branch I suggested should be able to handle that though so now I'm confused. Could you send me a sample?

sdn3rd commented 6 years ago

Had the wrong branch still, it's working now but: pass # <<<COULD NOT DECOMPILE: Unknown AST node: <class 'store.CallLocation'>>>>

CensoredUsername commented 6 years ago

See #70 . This game does evil things by defining a new AST node type in its script files itself which the decompiler does not know how to handle. Unfortunately no general way to deal with this is possible. I would have to make changes to the decompiler itself to support just this single game and I'm not interested in doing that myself.