Tool Ren'Py UnRenGUI, UnRen-forall(v9.4), UnRen-Powershell-forall(v9.4), UnRen-old

5.00 star(s) 3 Votes

joelurmel

Engaged Member
Nov 3, 2022
2,644
4,701
397
Good morning, good afternoon, or good evening. I don't know if it works that way for him, but when I try to use this new version in Renpy 7.4 to 8.0 games, it shows the rpyc files but closes the program. In the forall version (v9.4) (240216), they extract normally without closing, but it doesn't work in Renpy 8.4
The temporary fix for 8.4 have a side effect for older Ren'Py.
So, use the previous version for Ren'Py 7 and the new with Ren'Py 8.4.*.
 

Madeddy

Well-Known Member
Dec 17, 2017
1,016
735
244
The temporary fix for 8.4 have a side effect for older Ren'Py.
A favor...
Could you please upload your version of the decompiler somewhere or at least cite the changed code areas? I'm curious what you tried and i don't want to go and dismantle first you unren variant just to see it.
I know, but no solution for now, sorry
What Ren'Py version has Summertimesaga? Keep also im mind they heavily modify the engine, so decompiling could be never possible... Better users ask the devs for the sources if a good enough reason.

Greets
 

joelurmel

Engaged Member
Nov 3, 2022
2,644
4,701
397
A favor...
Could you please upload your version of the decompiler somewhere or at least cite the changed code areas? I'm curious what you tried and i don't want to go and dismantle first you unren variant just to see it.

What Ren'Py version has Summertimesaga? Keep also im mind they heavily modify the engine, so decompiling could be never possible... Better users ask the devs for the sources if a good enough reason.

Greets
Joined the modified version and Summertime Saga use now 8.4.1.
And the log for some rpyc files, seems to have new objects that are not taken right.
-------------------------------------------------------
Unrpyc v2.0.2 results summary:
-------------------------------------------------------
Processed 1 file.
> 1 file were successfully decompiled.
+ Processing 'src\fx.rpyc'
"E:\Torrents\_Jeux\summertimesaga-21.0.0-wip.6155-pc\lib\py3-windows-x86_64\python.exe" "E:\Torrents\_Jeux\summertimesaga-21.0.0-wip.6155-pc\unrpyc.py" --clobber --no-init-offset --try-harder "E:\Torrents\_Jeux\summertimesaga-21.0.0-wip.6155-pc\game\src\fx.rpyc"
Found 1 file to process. Performing decompilation using 1 worker.
Decompiling E:\Torrents\_Jeux\summertimesaga-21.0.0-wip.6155-pc\game\src\fx.rpyc to fx.rpy ...
Attempting to deobfuscate file:
strategy extract_slot_rpyc success
strategy extract_slot_legacy failed: Legacy format did not contain a zlib blob
strategy extract_slot_headerscan success
strategy extract_slot_zlibscan success
Strategies produced different results. Trying all options
performed a round of decrypt_zlib
Error while decompiling E:\Torrents\_Jeux\summertimesaga-21.0.0-wip.6155-pc\game\src\fx.rpyc:
Traceback (most recent call last):
File "E:\Torrents\_Jeux\summertimesaga-21.0.0-wip.6155-pc\unrpyc.py", line 246, in worker_common
decompile_rpyc(
File "E:\Torrents\_Jeux\summertimesaga-21.0.0-wip.6155-pc\unrpyc.py", line 199, in decompile_rpyc
decompiler.pprint(out_file, ast, options)
File "E:\Torrents\_Jeux\summertimesaga-21.0.0-wip.6155-pc\decompiler\__init__.py", line 52, in pprint
Decompiler(out_file, options).dump(ast)
File "E:\Torrents\_Jeux\summertimesaga-21.0.0-wip.6155-pc\decompiler\__init__.py", line 109, in dump
super(Decompiler, self).dump(ast, skip_indent_until_write=True)
File "E:\Torrents\_Jeux\summertimesaga-21.0.0-wip.6155-pc\decompiler\util.py", line 70, in dump
self.print_nodes(ast)
File "E:\Torrents\_Jeux\summertimesaga-21.0.0-wip.6155-pc\decompiler\util.py", line 171, in print_nodes
self.print_node(node)
File "E:\Torrents\_Jeux\summertimesaga-21.0.0-wip.6155-pc\decompiler\__init__.py", line 125, in print_node
self.dispatch.get(type(ast), type(self).print_unknown)(self, ast)
File "E:\Torrents\_Jeux\summertimesaga-21.0.0-wip.6155-pc\decompiler\__init__.py", line 347, in print_label
self.print_nodes(ast.block, 1)
File "E:\Torrents\_Jeux\summertimesaga-21.0.0-wip.6155-pc\decompiler\util.py", line 171, in print_nodes
self.print_node(node)
File "E:\Torrents\_Jeux\summertimesaga-21.0.0-wip.6155-pc\decompiler\__init__.py", line 125, in print_node
self.dispatch.get(type(ast), type(self).print_unknown)(self, ast)
File "E:\Torrents\_Jeux\summertimesaga-21.0.0-wip.6155-pc\decompiler\__init__.py", line 234, in print_scene
if ast.imspec is None:
^^^^^^^^^^
AttributeError: 'Scene' object has no attribute 'imspec'
 

Madeddy

Well-Known Member
Dec 17, 2017
1,016
735
244
Thanks.

AttributeError: 'Scene' object has no attribute 'imspec'
I fixed this one with a short hack to see what happens and in the next run 27 other files acted up instead...

So, i think there is possible more modified on this game as just a new Ren'Py. You could compare with another v8.4.1 game to see from "what" exactly the errors come.

# FYI short fix:
# __init__.py Line 234:
Code:
if hasattr(ast, "imspec") and ast.imspec is None:
There is more wrong if ast.imspec is accessed but as said we need another game with this engine version. If this problem persists, we can add it on GH too the error issue.
 
Last edited:

joelurmel

Engaged Member
Nov 3, 2022
2,644
4,701
397
We need your help to try to properly support Ren'Py games in version 8.4.1.
Can you give me a game using Ren'Py 8.4.1 for testing.
For now, we know One Week Away 0.4 and Summertime Saga 21.0.0
 
  • Like
Reactions: yoyomistro

joelurmel

Engaged Member
Nov 3, 2022
2,644
4,701
397
Thanks.


I fixed this one with a short hack to see what happens and in the next run 27 other files acted up instead...

So, i think there is possible more modified on this game as just a new Ren'Py. You could compare with another v8.4.1 game to see from "what" exactly the errors come.

# FYI short fix:
# __init__.py Line 234:
Code:
if hasattr(ast, "imspec") and ast.imspec is None:
There is more wrong if ast.imspec is accessed but as said we need another game with this engine version. If this problem persists, we can add it on GH too the error issue.
Tried the short fix with OurBrightDays-0.2.0 which use Ren'Py 8.4 and still have error with imspec

-------------------------------------------------------
Unrpyc v2.0.2 results summary:
-------------------------------------------------------
Processed 1 file.
> 1 file were successfully decompiled.
+ Processing 'script.rpyc'
"E:\Torrents\_Jeux\OurBrightDays-0.2.0-pc\lib\py3-windows-x86_64\python.exe" "E:\Torrents\_Jeux\OurBrightDays-0.2.0-pc\unrpyc.py" --no-init-offset "E:\Torrents\_Jeux\OurBrightDays-0.2.0-pc\game\script.rpyc"
Found 1 file to process. Performing decompilation using 1 worker.
Decompiling E:\Torrents\_Jeux\OurBrightDays-0.2.0-pc\game\script.rpyc to script.rpy ...
Error while decompiling E:\Torrents\_Jeux\OurBrightDays-0.2.0-pc\game\script.rpyc:
Traceback (most recent call last):
File "E:\Torrents\_Jeux\OurBrightDays-0.2.0-pc\unrpyc.py", line 246, in worker_common
decompile_rpyc(
File "E:\Torrents\_Jeux\OurBrightDays-0.2.0-pc\unrpyc.py", line 199, in decompile_rpyc
decompiler.pprint(out_file, ast, options)
File "E:\Torrents\_Jeux\OurBrightDays-0.2.0-pc\decompiler\__init__.py", line 52, in pprint
Decompiler(out_file, options).dump(ast)
File "E:\Torrents\_Jeux\OurBrightDays-0.2.0-pc\decompiler\__init__.py", line 109, in dump
super(Decompiler, self).dump(ast, skip_indent_until_write=True)
File "E:\Torrents\_Jeux\OurBrightDays-0.2.0-pc\decompiler\util.py", line 70, in dump
self.print_nodes(ast)
File "E:\Torrents\_Jeux\OurBrightDays-0.2.0-pc\decompiler\util.py", line 171, in print_nodes
self.print_node(node)
File "E:\Torrents\_Jeux\OurBrightDays-0.2.0-pc\decompiler\__init__.py", line 125, in print_node
self.dispatch.get(type(ast), type(self).print_unknown)(self, ast)
File "E:\Torrents\_Jeux\OurBrightDays-0.2.0-pc\decompiler\__init__.py", line 347, in print_label
self.print_nodes(ast.block, 1)
File "E:\Torrents\_Jeux\OurBrightDays-0.2.0-pc\decompiler\util.py", line 171, in print_nodes
self.print_node(node)
File "E:\Torrents\_Jeux\OurBrightDays-0.2.0-pc\decompiler\__init__.py", line 125, in print_node
self.dispatch.get(type(ast), type(self).print_unknown)(self, ast)
File "E:\Torrents\_Jeux\OurBrightDays-0.2.0-pc\decompiler\__init__.py", line 240, in print_scene
needs_space = self.print_imspec(ast.imspec)
^^^^^^^^^^
AttributeError: 'Scene' object has no attribute 'imspec'

And the game does not start with this errors
 

Madeddy

Well-Known Member
Dec 17, 2017
1,016
735
244
Tried the short fix ... and still have error with imspec
Already known. You missed perhaps i mentioned this already in my post above.

I overlooked how ast.imspec is multiple times used, so the hasattr check i used isn't enough. Try to write the line instead with
if not getattr(ast, "imspec", None):
Edit: Warning, this is just a hack to see where things lead, even if this works. There is a better solution.

But as said i get also multiple errors with
Code:
AttributeError: 'ArgumentInfo' object has no attribute 'extrapos'
and thats old friends from a few years back. Apparently they changed them again, unrpyc mistakes these code parts as older Ren'Py versions and forks in the false handling mechanic. ATM i have no ideas how to circumvent this as it got again more complicated.
 
Last edited:

joelurmel

Engaged Member
Nov 3, 2022
2,644
4,701
397
Already known. You missed perhaps i mentioned this already in my post above.

I overlooked how ast.imspec is multiple times used, so the hasattr check i used isn't enough. Try it instead with
if not getattr(ast, "imspec", None):

But as said i get also multiple errors with
Code:
AttributeError: 'ArgumentInfo' object has no attribute 'extrapos'
and thats old friends from a few years back. Apparently they changed them again, unrpyc mistakes these code parts as older Ren'Py versions and forks in the false handling mechanic. ATM i have no ideas how to circumvent this as it got again more complicated.
After inspecting the new rpyc v2, there is no more imspec in the scene struct. You have only
linenumber, col_offset, filename, name_version, name_serial, layer.
 

Madeddy

Well-Known Member
Dec 17, 2017
1,016
735
244
After inspecting the new rpyc v2, there is no more imspec in the scene struct. You have only
linenumber, col_offset, filename, name_version, name_serial, layer.
OK. The state of things, as i see it, is:
  • "<class 'renpy.astsupport.PyExpr'> was instantiated with unexpected arguments": was already in Jan'25 reported and solved:
  • if block missing: PyExpr lives from v8.4 on in the module "astsupport" so in unrpyc it just needed to be added as seen here: https://f95zone.to/threads/unrengui...ell-forall-v9-4-unren-old.92717/post-17655202 This works AFAIK.
  • imspec attr in class Scene can now be missing instead just empty: The nasty hacks i did with hasattr/getattr showed its the same root cause as already in January: solved this the same way
  • language attr in class TranslateString now missing: solved, see above
  • Class ArgumentInfo attributes changed: (maybe i solved it and someone else used already the same code)
    • arguments can now be a empty tuple instead None
    • starred_indexes can be completely missing
    • doublestarred_indexes can be completely missing
  • So far unknown AST changes(?) which lead to these errors on game exec:
    You don't have permission to view the spoiler content. Log in or register now.

If you folks have more...
You don't have permission to view the spoiler content. Log in or register now.
 
Last edited:

Madeddy

Well-Known Member
Dec 17, 2017
1,016
735
244
Ok. I figured out whats wrong with the bugs in my last bulled point:
The error roots in sl2decompiler.py in the class SLUse and is related to the move of PyExpr from module ast to astsupport. We import there just the old style PyExpr, but the new one appears there now also and it uses (logically) the wrong code for such appearances, because unrpyc supports it so far not.

So, just a bit more work needed to figure out how to deal with both variants. Yeah, soooooooo fun! </sarcasm-node=off> :oops:

Ok, i think/hope i got it. Three of the games above, including STS, decompiling with this clean and run also fine! All new fixes are in here: Take a look, test, report if you like. Have fun folks! :coffee:
 
Last edited:

kwazimoda

Newbie
Aug 5, 2018
61
47
28
Three of the games above, including STS, decompiling with this clean and run also fine! All new fixes are in here: Take a look, test, report if you like. Have fun folks! :coffee:
Thanks for the great work, BUT... it unpacks without errors, but there is one nuance: for some reason, it doesn't work correctly with the menus. Here's an example of what it should be and what it is. The selection conditions are lost. STS (game\src\plot\judith.rpyc) 1754335212124.png
 
Last edited:

Madeddy

Well-Known Member
Dec 17, 2017
1,016
735
244
Right. I have this errors here also in my files. Thanks for bringing it to attention kwazimoda.
Something, somewhere is still skipped for some reason. Well shit. smiley_angry_sign.gif You all know the saying about "finding the needle in a haystack", right? The problem with this error is: I don't even know what our needle is or how it looks.

Edit: Found the needle, fixed. Was way easier then thought. Updated the PR on Github. (see post 1521)
 
Last edited:

mazinogamer

Member
Dec 2, 2022
140
576
217
Right. I have this here also in my files. Thanks for bringing it to attention kwazimoda.
Something, somewhere is still skipped for some reason. Well shit. View attachment 5111854 You all know the saying about "finding the needle in a haystack", right? The problem with this error is: I don't even know what our needle is or how it looks.

Edit: Found the needle, fixed. Updated the PR on GH. (see post 1521)
Thanks, it worked well for me. (y)
 

kwazimoda

Newbie
Aug 5, 2018
61
47
28
Right. I have this here also in my files. Thanks for bringing it to attention kwazimoda.
Something, somewhere is still skipped for some reason. Well shit. View attachment 5111854 You all know the saying about "finding the needle in a haystack", right? The problem with this error is: I don't even know what our needle is or how it looks.

Edit: Found the needle, fixed. Updated the PR on GH. (see post 1521)
Download from GH - all work! Thanks.
 
  • Like
Reactions: Madeddy

kwazimoda

Newbie
Aug 5, 2018
61
47
28
Right. I have this errors here also in my files. Thanks for bringing it to attention kwazimoda.
Something, somewhere is still skipped for some reason. Well shit. View attachment 5111854 You all know the saying about "finding the needle in a haystack", right? The problem with this error is: I don't even know what our needle is or how it looks.

Edit: Found the needle, fixed. Was way easier then thought. Updated the PR on Github. (see post 1521)
After decompiling the game High Scool Days, this error appears when launch the game. The decompiler report shows that it was decompiled correctly.
1754435992591.png
1754436333845.png
 
5.00 star(s) 3 Votes