CensoredUsername / unrpyc

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

Incorectly decompile *.rpyc files from Ren'py v6.99.14.1 game #70

Closed hubslave closed 6 years ago

hubslave commented 6 years ago

Hear is a sample: http://www107.zippyshare.com/v/lQeTHGEP/file.html Only some of the files have the problem, take a look at the files in \game\characters\

CensoredUsername commented 6 years ago

Based on some preliminary analysis, this game mods the ren'py engine quite heavily by introducing a new AST node in it's early script files, without using the normal API for those (renpy.register_statement). This makes it impossible to decompile this game without making changes to the decompiler so it knows how to deal with this statement. Furthermore the implementation is rather dirty causing RevertableList instances to show up in the script AST which I've never seen before and which were causing the fatal errors rather than a "could not decompile node" comment.

I can push the necessary patches to at least parse the files correctly to a separate branch, but reversing how their custom ASTs work is a lot of work that will be only applicable to this specific game so I'm not too interested in it.

CensoredUsername commented 6 years ago

I've pushed the necessary changes to not make decompilation fail completely to the innocent_witches branch. However a significant amount of work is still necessary to fully decompile the scripts due to the ast modding.

Andykl commented 6 years ago

Thank you for pointing out this mistake. I moved the CallLocation class to the python file. Unfortunately UserStatement makes it impossible to use ast.next_node and predict renpy code block. It would be nice to make the function of decompiling third-party ast classes, I think I'll add a couple more.