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

5.00 star(s) 3 Votes

Sancho1969

Message Maven
Modder
Donor
Jan 19, 2020
12,382
48,810
And how should I solve the problem and test without files and preferably a reference for reconciliation?
Really? Use any base testing RenPy code you have (heck, use one of the demos that come in each SDK such as "The Question"), make a new rpy file with a simple function that includes the operator(s) in it such as (any use of the wildcard operator will do):
Python:
def testUltraHack(*args):
  return sum(args)
then run the demo to create new compiled rpyc's (no need for building rpa's since archiving/de-archiving is not the issue). I suggest trying in both R8 and pre-R8 to be complete as I've found the issue to be in both although it's certainly more rampant in R8+. Then decompile the rpyc's with UltraHack. Done. You'll get the same result I originally described where the operator is completely removed during the rpyc decompile conversion back to rpy. There's nothing more to reconcile, the operator(s) that originally existed are removed consequent the decompilation. Honestly, I'm not trying to be difficult here, creating a simple function in a two-line testing file with a wildcard operator is one of the easiest things possible.
 

estrada777

Engaged Member
Modder
Donor
Mar 22, 2020
3,960
9,738
I am working on an android port for this game: https://f95zone.to/threads/life-of-desmond-v0-8-9-1-badvador.63842/ and apparently the decompile of the attached file was incomplete. The dev says that there is code AFTER the last line that this tool decompiled.

The last line that I get is 38277 and in this post the dev is showing code after that line. Am i hitting some depth limit in the decompile? I used v11 of the ultrahack.

Edit: retried with v12, same result.
 
Last edited:

Madeddy

Active Member
Dec 17, 2017
838
487
...
The last line that I get is 38277 and in this post the dev is showing code after that line. Am i hitting some depth limit in the decompile?...
No there is no limitation this small AFAIK. I get also a few more lines(last is 336) with Try with branch py3_v1.1.8 or py3_v1.2.0_dev. The code after your last line:
Python:
...
label evening_multi_choice:
    scene night_choice
    with dissolve
    ndpt "{i}It's the night... What am I going to do?{/i}"
    if day == 7:
        jump day_7party
    elif True:
        scene night_choice
        with dissolve
        menu:
            "Go to sleep" if True:
                ndpt "{i}I'm out, I need to sleep!{/i}"
                jump day_select
            "Go to the Private Club" if True:
                ndpt "{i}I want to hang out a little at the Private Club...{/i}"
                jump intro_private_club


label day_select:
    if day == 3:
        jump day_4
    elif day == 4:
        jump day_5
    elif day == 5:
        jump day_6
    elif day == 6:
        jump day_7
    elif day == 7:
        jump day_7party
    elif day == 8:
        jump day_9
    elif day == 9:
        jump day_10
    elif day == 11:
        jump day_12
    elif day == 12:
        jump end_update








label end_game:


return
  # Decompiled by unrpyc_1.2.0-alpha: https://github.com/CensoredUsername/unrpyc
The file end... is this correct? Btw: Which Renpy version is this game?
 
Last edited:

estrada777

Engaged Member
Modder
Donor
Mar 22, 2020
3,960
9,738
No there is no limitation this small AFAIK. I get also a few more lines(last is 336) with Try with branch py3_v1.1.8 or py3_v1.2.0_dev. The code after your last line:
Python:
...
label evening_multi_choice:
    scene night_choice
    with dissolve
    ndpt "{i}It's the night... What am I going to do?{/i}"
    if day == 7:
        jump day_7party
    elif True:
        scene night_choice
        with dissolve
        menu:
            "Go to sleep" if True:
                ndpt "{i}I'm out, I need to sleep!{/i}"
                jump day_select
            "Go to the Private Club" if True:
                ndpt "{i}I want to hang out a little at the Private Club...{/i}"
                jump intro_private_club


label day_select:
label day_select:
    if day == 3:
        jump day_4
    elif day == 4:
        jump day_5
    elif day == 5:
        jump day_6
    elif day == 6:
        jump day_7
    elif day == 7:
        jump day_7party
    elif day == 8:
        jump day_9
    elif day == 9:
        jump day_10
    elif day == 11:
        jump day_12
    elif day == 12:
        jump end_update








label end_game:


return
  # Decompiled by unrpyc_1.2.0-alpha: https://github.com/CensoredUsername/unrpyc
The file end... is this correct? Btw: Which Renpy version is this game?
Game was 8.0.1.

What unrpyc is built into the ultimate version in this thread?
 

Madeddy

Active Member
Dec 17, 2017
838
487
What unrpyc is built into the ultimate version in this thread?
Yes. Its based on the last official version 1.1.8, but with the changes in Renpys this years new py3 versions it doesn't work anymore. Its not officially updated since 1. April by the dev.
We did try to remove/repair the errors and have our own versions. We share some findings and code, however his and my unrpyc are slightly different. There are still some problems popping up, like now again.
 

VepsrP

Well-Known Member
Modder
Dec 13, 2017
1,387
1,384
No there is no limitation this small AFAIK. I get also a few more lines(last is 336) with Try with branch py3_v1.1.8 or py3_v1.2.0_dev. The code after your last line:
Python:
...
label evening_multi_choice:
    scene night_choice
    with dissolve
    ndpt "{i}It's the night... What am I going to do?{/i}"
    if day == 7:
        jump day_7party
    elif True:
        scene night_choice
        with dissolve
        menu:
            "Go to sleep" if True:
                ndpt "{i}I'm out, I need to sleep!{/i}"
                jump day_select
            "Go to the Private Club" if True:
                ndpt "{i}I want to hang out a little at the Private Club...{/i}"
                jump intro_private_club


label day_select:
label day_select:
    if day == 3:
        jump day_4
    elif day == 4:
        jump day_5
    elif day == 5:
        jump day_6
    elif day == 6:
        jump day_7
    elif day == 7:
        jump day_7party
    elif day == 8:
        jump day_9
    elif day == 9:
        jump day_10
    elif day == 11:
        jump day_12
    elif day == 12:
        jump end_update








label end_game:


return
  # Decompiled by unrpyc_1.2.0-alpha: https://github.com/CensoredUsername/unrpyc
The file end... is this correct? Btw: Which Renpy version is this game?
Why "label day_select:" appears twice? :unsure:

By the way, if you make a dump, there really is code further, but for some reason it is not recorded in the normal output. I'm figuring it out.
 
Last edited:

VepsrP

Well-Known Member
Modder
Dec 13, 2017
1,387
1,384
I am working on an android port for this game: https://f95zone.to/threads/life-of-desmond-v0-8-9-1-badvador.63842/ and apparently the decompile of the attached file was incomplete. The dev says that there is code AFTER the last line that this tool decompiled.

The last line that I get is 38277 and in this post the dev is showing code after that line. Am i hitting some depth limit in the decompile? I used v11 of the ultrahack.

Edit: retried with v12, same result.
I solved the problem (at least this time). For some reason, it is on Windows that the writing of a large file can stop before it ends. It has something to do with the buffer. On linux, everything works fine without changes. :unsure:
 

VepsrP

Well-Known Member
Modder
Dec 13, 2017
1,387
1,384
Really? Use any base testing RenPy code you have (heck, use one of the demos that come in each SDK such as "The Question"), make a new rpy file with a simple function that includes the operator(s) in it such as (any use of the wildcard operator will do):
Python:
def testUltraHack(*args):
  return sum(args)
then run the demo to create new compiled rpyc's (no need for building rpa's since archiving/de-archiving is not the issue). I suggest trying in both R8 and pre-R8 to be complete as I've found the issue to be in both although it's certainly more rampant in R8+. Then decompile the rpyc's with UltraHack. Done. You'll get the same result I originally described where the operator is completely removed during the rpyc decompile conversion back to rpy. There's nothing more to reconcile, the operator(s) that originally existed are removed consequent the decompilation. Honestly, I'm not trying to be difficult here, creating a simple function in a two-line testing file with a wildcard operator is one of the easiest things possible.
Well, I checked this piece of code. Nothing is deleted. the operator both was and remained after decompilation. At the expense of "has" - I'm still deciding.
Edit: Found where to remove "has". I removed it, after that the options screen in the game stopped functioning (the game is on 8 RenPy). So I don't see any point in removing this, especially considering that there are no checks on the need for this command, it is simply printed with all the pieces of code belonging to the class "sl2.slast.SLDisplayable" having exactly the same ancestor.
 
Last edited:

Madeddy

Active Member
Dec 17, 2017
838
487
Why "label day_select:" appears twice?
My fault. :oops: A copy and paste mistake. Original its just one time there.
I solved the problem (at least this time). For some reason, it is on Windows that the writing of a large file can stop before it ends. It has something to do with the buffer. On linux, everything works fine without changes. :unsure:g
So i was wrong, as there is a limit of sorts. At least on Win. But why? And can we increase the buffersize with python somehow...
Well, I checked this piece of code. Nothing is deleted. the operator both was and remained after decompilation. ...
Strange. I did also check multiple files if there the asterisk sometimes missing is, but no. :unsure:
At the expense of "has" - I'm still deciding.
Edit: Found where to remove "has". I removed it, after that the options screen in the game stopped functioning (the game is on 8 RenPy)....
I did try to understand the unrpyc code for this, but was too dumb so far.

I read somewhat up on the "has" statement and it looks like with certain other keywords like vbox, hbox etc. the statement "has" is in place before them and in other case the same statements are without "has". So, two variants. To what effect? Whats the diff?
Also, i don't remember where i read it, but "has" is not in the AST stored i think. So if that's correct, the question is how does RenPy know if it reads/interpretes these files which variant it is? With "has" or without? Its there some rule, where decided is that RenPy pretends there is/should be a "has" statement or whatever?
 
Last edited:

VepsrP

Well-Known Member
Modder
Dec 13, 2017
1,387
1,384
So i was wrong, as there is a limit of sorts. At least on Win. But why? And can we increase the buffersize with python somehow...
Well, I just set the value to 0. if set any other value, then the number of rows will either be the same or even less. Another question is why the dump comes out all if the file is opened for it the same... Illogical... :unsure:
I read somewhat up on the "has" statement and it looks like with certain other keywords like vbox, hbox etc. the statement "has" is in place before them and in other case the same statements are without "has". So, two variants. To what effect? Whats the diff?
Also, i don't remember where i read it, but "has" is not in the AST stored i think. So if that's correct, the question is how does RenPy know if it reads/interpretes these files which variant it is? With "has" or without? Its there some rule, where decided is that RenPy pretends there is/should be a "has" statement or whatever?
It is written in the unrpyc itself and the author decided to use it wherever possible.
 
  • Like
Reactions: giqui

Madeddy

Active Member
Dec 17, 2017
838
487
Well, I just set the value to 0. if set any other value, then the number of rows will either be the same or even less. ...
The buffering arg shouldn't do anything against this error. Its just the chunksize for reading and not for the filesize AFAIK:
Taken from: https://docs.python.org/3.10/library/functions.html#open said:
buffering is an optional integer used to set the buffering policy. Pass 0 to switch buffering off (only allowed in binary mode), 1 to select line buffering (only usable in text mode), and an integer > 1 to indicate the size in bytes of a fixed-size chunk buffer. Note that specifying a buffer size this way applies for binary buffered I/O, but TextIOWrapper (i.e., files opened with mode='r+') would have another buffering. To disable buffering in TextIOWrapper, consider using the write_through flag for . When no buffering argument is given, the default buffering policy works as follows:
  • Binary files are buffered in fixed-size chunks; the size of the buffer is chosen using a heuristic trying to determine the underlying device’s “block size” and falling back on . On many systems, the buffer will typically be 4096 or 8192 bytes long.
  • “Interactive” text files (files for which returns True) use line buffering. Other text files use the policy described above for binary files.
By the way: in this is the codecs module not needed i think. Another import less we need.("codecs" is fairly large) Using
with open(out_filename, 'w', encoding='utf-8') as out_file: should be enough. In my newest expermental version i use now evn the pathlib variant: with out_filename.open('w', encoding='utf-8') as out_file:
I encounter this file-end cut-off not you experienced. I think its from a different code change you have in your version and i'm not.
... Another question is why the dump comes out all if the file is opened for it the same... Illogical...
Why illogical? Its different functionality which outputs the content. For dump its astdump.pprint() which goes in astdump.py and the other is decompiler.pprint() which goes in the init.py. In there should be your difference to find.
 
Last edited:

VepsrP

Well-Known Member
Modder
Dec 13, 2017
1,387
1,384
The buffering arg shouldn't do anything against this error. Its just the chunksize for reading and not for the filesize AFAIK:
But it does. Why? It's a difficult question that I don't have an answer to.

Why illogical? Its different functionality which outputs the content. For dump its astdump.pprint() whci goes in astdump.py and the other is decompiler.pprint() which goes in the init.py. There should be you diff to find.
Because I was expecting a cropped file in both modes. It is quite strange to see when a smaller file cannot be fully printed, but a larger one can.:HideThePain:
 

PhadarSolo

Newbie
Sep 12, 2017
34
30
Just used UnRen-ultrahackv13 and got a several failed rpyc decompilations of a game running on Ren'Py 7.5.1, and all the failed decompilations were to do with an attribute error. Reverted to UnRen-ultrahackv11, and it decompiled the very same game's rpycs without issue.

Examples of the error encountered when using v13:-

Traceback (most recent call last):
File "../decompiler/util.py", line 131, in convert_ast
for key in ast.__dict__.keys():
AttributeError: 'tuple' object has no attribute '__dict__'

Traceback (most recent call last):
File "../decompiler/util.py", line 131, in convert_ast
for key in ast.__dict__.keys():
AttributeError: 'NoneType' object has no attribute '__dict__'
 

VepsrP

Well-Known Member
Modder
Dec 13, 2017
1,387
1,384
Just used UnRen-ultrahackv13 and got a several failed rpyc decompilations of a game running on Ren'Py 7.5.1, and all the failed decompilations were to do with an attribute error. Reverted to UnRen-ultrahackv11, and it decompiled the very same game's rpycs without issue.

Examples of the error encountered when using v13:-

Traceback (most recent call last):
File "../decompiler/util.py", line 131, in convert_ast
for key in ast.__dict__.keys():
AttributeError: 'tuple' object has no attribute '__dict__'

Traceback (most recent call last):
File "../decompiler/util.py", line 131, in convert_ast
for key in ast.__dict__.keys():
AttributeError: 'NoneType' object has no attribute '__dict__'
Yes, I already know about this problem, but I haven't posted a fix yet, it will be later, along with others.
 

Madeddy

Active Member
Dec 17, 2017
838
487
But it does. Why? It's a difficult question that I don't have an answer to.
Something strange is going on with this bug. I feel the problem comes from something else, but is somehow accidentally affected if you switch the buffer of.
Yes, I already know about this problem, but I haven't posted a fix yet, it will be later, along with others.
Maybe the AST needs to be cast to dict state, before you access it as dict...? Just thinking.
 

VepsrP

Well-Known Member
Modder
Dec 13, 2017
1,387
1,384
Maybe the AST needs to be cast to dict state, before you access it as dict...? Just thinking.
I just put an attribute check. This piece of code is needed only if not recompiled files in 8 engine with py3.
Something strange is going on with this bug. I feel the problem comes from something else, but is somehow accidentally affected if you switch the buffer of.
But just why is it not there when running on linux? This moment is even more embarrassing. :unsure:
 

VepsrP

Well-Known Member
Modder
Dec 13, 2017
1,387
1,384
Something strange is going on with this bug. I feel the problem comes from something else, but is somehow accidentally affected if you switch the buffer of.
Maybe the AST needs to be cast to dict state, before you access it as dict...? Just thinking.
I found a more accurate place that puts a stick in the wheels. I even found a place where I need to fix it (I hope I did it right. I haven't tested it on earlier engines yet). If you're interested, everything is already in the dev branch.
 

estrada777

Engaged Member
Modder
Donor
Mar 22, 2020
3,960
9,738
Found another problematic game, it says it was made with 7.5.1, using ultimate v13:

SyntaxError: invalid syntax
+ Unpacking "base_images.rpa" - 76881404 bytes
File "S:\working\WorldsOfWonders-0.2.10-pc\rpatool.py", line 42
(offset, length, *var) = self.indexes[filename][0]
^
SyntaxError: invalid syntax
+ Unpacking "base_renders.rpa" - 2880957053 bytes
File "S:\working\WorldsOfWonders-0.2.10-pc\rpatool.py", line 42
(offset, length, *var) = self.indexes[filename][0]
^
SyntaxError: invalid syntax
+ Unpacking "base_scripts.rpa" - 6363452 bytes
File "S:\working\WorldsOfWonders-0.2.10-pc\rpatool.py", line 42
(offset, length, *var) = self.indexes[filename][0]
^
SyntaxError: invalid syntax
+ Unpacking "fonts.rpa" - 218616 bytes
File "S:\working\WorldsOfWonders-0.2.10-pc\rpatool.py", line 42
(offset, length, *var) = self.indexes[filename][0]
^
SyntaxError: invalid syntax
+ Unpacking "gui_images.rpa" - 9041644 bytes
File "S:\working\WorldsOfWonders-0.2.10-pc\rpatool.py", line 42
(offset, length, *var) = self.indexes[filename][0]

https://f95zone.to/threads/worlds-of-wonders-v0-2-10-its-danny.85358/

Edit: Powershell v8 just deletes the files.
 
Last edited:
5.00 star(s) 3 Votes