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

5.00 star(s) 3 Votes

Madeddy

Well-Known Member
Dec 17, 2017
1,016
735
244
After decompiling the game High Scool Days, this error appears when launch the game.
That's the one game v8.4+ i did not test with, as the DL is a bit big just for testing and i had others.

This game makes use of a code variant(init python) which the others don't have in this form, so it errors only (so far) in this one. Another error from the PyExpr/PyCode rework.

Another user fixed it already nicely in his on GH. I will did add this fix later to my PR, so interested people have all necessary fixes there in one go. This will surely not the last hiccup from some undiscovered Ren'Py code change.
 
Last edited:

"CJ"LongDong

Conversation Conqueror
Mar 6, 2021
6,752
71,794
699
Madeddy, thanks for all the work and effort you put into this. I really appreciate it!

Since I don't know anything about Python, could you please create the un.rpy, un.rpyc, and bytecode-39.rpyb files with the version from your PR and post them here?
 

Madeddy

Well-Known Member
Dec 17, 2017
1,016
735
244
could you please create the un.rpy, un.rpyc, and bytecode-39.rpyb
No problemo. Test it and have fun. I don't use them myself so no idea if its correct.

INFO: Attached is a possible unstable dev version of the injector, a bit ahead of unrpyc v2.0.2 to support Ren'Py v8.4+ games. superseded, scroll down
 
Last edited:

Madeddy

Well-Known Member
Dec 17, 2017
1,016
735
244
Here’s another one
This is the log
Thanks. Confirmed. Its a new class in the Lexer i noticed already 6 months back as they added it and i remember wanted to ask on GH about it. Now we know, i forgot about it till now. :giggle:

OK, just so people don't double report it i show the related errors in short:

>> First its this error:
Code:
Failed at decompiling G:\project\TWR_V0.1.5_un\game\scripts\layered_images1.rpyc
Traceback (most recent call last):
  File "<string>", line 15, in decompile_game
  File "<string>", line 7, in decompile_rpyc
  File "<string>", line 2, in read_ast_from_file
  File "<string>", line 129, in pickle_safe_loads
  File "<string>", line 152, in safe_loads
  File "lib/python3.12/pickle.py", line 1256, in load
  File "lib/python3.12/pickle.py", line 1557, in load_newobj
  File "<string>", line 26, in __new__
decompiler.magic.FakeUnpicklingError: <class 'renpy.lexer.GroupedLine'> was instantiated with unexpected arguments ('game/scripts/layered_images1.rpy', 12, 8, '"base_body_gwen_1"', []), {}
>> And after you add the code for it we get another bug because we forgot some code:
Code:
Decompiling /home/olli/.xlib/_test/TwistedWorld-0.1.5-pc/game/scripts/layered_images2.rpyc to layered_images2.rpy ...
Error while decompiling /home/olli/.xlib/_test/TwistedWorld-0.1.5-pc/game/scripts/layered_images2.rpyc:
Traceback (most recent call last):
File "/home/olli/Code/Git/unrpyc/unrpyc.py", line 246, in worker_common
decompile_rpyc(
File "/home/olli/Code/Git/unrpyc/unrpyc.py", line 199, in decompile_rpyc
decompiler.pprint(out_file, ast, options)
File "/home/olli/Code/Git/unrpyc/decompiler/__init__.py", line 52, in pprint
Decompiler(out_file, options).dump(ast)
File "/home/olli/Code/Git/unrpyc/decompiler/__init__.py", line 109, in dump
super(Decompiler, self).dump(ast, skip_indent_until_write=True)
File "/home/olli/Code/Git/unrpyc/decompiler/util.py", line 70, in dump
self.print_nodes(ast)
File "/home/olli/Code/Git/unrpyc/decompiler/util.py", line 171, in print_nodes
self.print_node(node)
File "/home/olli/Code/Git/unrpyc/decompiler/__init__.py", line 125, in print_node
self.dispatch.get(type(ast), type(self).print_unknown)(self, ast)
File "/home/olli/Code/Git/unrpyc/decompiler/__init__.py", line 509, in print_init
self.print_nodes(ast.block)
File "/home/olli/Code/Git/unrpyc/decompiler/util.py", line 171, in print_nodes
self.print_node(node)
File "/home/olli/Code/Git/unrpyc/decompiler/__init__.py", line 125, in print_node
self.dispatch.get(type(ast), type(self).print_unknown)(self, ast)
File "/home/olli/Code/Git/unrpyc/decompiler/__init__.py", line 751, in print_userstatement
self.print_lex(ast.block)
File "/home/olli/Code/Git/unrpyc/decompiler/__init__.py", line 759, in print_lex
for file, linenumber, content, block in lex:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: too many values to unpack (expected 4)
valery-iwanofu (Github) solved this already as the previous error with the "init bug" and i will add it to my fork/PR for completeness. Thanks to him!

----
Just so you folks understand why i not simply point you to the other PR on GH:
  • There are other code improvements and additions in there where i solong not know for what they are.
  • Some error fixes i made are missing in his.
So you see, i complete my step by step as the errors from you rolling in. Or the unrpyc dev finds some time to catch up on the project. What ever happens first...

Greets
 

Tacito

Forum Fanatic
Jul 15, 2017
5,956
53,912
912
Thanks. Confirmed. Its a new class in the Lexer i noticed already 6 months back as they added it and i remember wanted to ask on GH about it. Now we know, i forgot about it till now. :giggle:

OK, just so people don't double report it i show the related errors in short:

>> First its this error:
Code:
Failed at decompiling G:\project\TWR_V0.1.5_un\game\scripts\layered_images1.rpyc
Traceback (most recent call last):
  File "<string>", line 15, in decompile_game
  File "<string>", line 7, in decompile_rpyc
  File "<string>", line 2, in read_ast_from_file
  File "<string>", line 129, in pickle_safe_loads
  File "<string>", line 152, in safe_loads
  File "lib/python3.12/pickle.py", line 1256, in load
  File "lib/python3.12/pickle.py", line 1557, in load_newobj
  File "<string>", line 26, in __new__
decompiler.magic.FakeUnpicklingError: <class 'renpy.lexer.GroupedLine'> was instantiated with unexpected arguments ('game/scripts/layered_images1.rpy', 12, 8, '"base_body_gwen_1"', []), {}
It's Ok , Thanks :)
 
  • Heart
Reactions: Madeddy

Nighthawk604

New Member
Game Developer
Oct 14, 2020
11
7
96
I had re-install windoze 11 but since then the oiwershell version of unren won't work

rpatool.py:128: SyntaxWarning: invalid escape sequence '\{'
os.remove("{0}\{1}".format(directory, archive))
Traceback (most recent call last):
File "rpatool.py", line 11, in <module>
import renpy.config
File "renpy/config.py", line 1056, in <module>
AttributeError: module 'renpy' has no attribute 'error'

Creating unrpyc...
Traceback (most recent call last):
File "unrpyc.py", line 66, in <module>
import decompiler
File "decompiler\__init__.py", line 35, in <module>
store = magic.fake_package("store")
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "decompiler\magic.py", line 637, in fake_package
return __import__(name)
^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'store'

Has anyone seen this problem?

Its never done this before.. (I'm wracking my brain thinking what am I forgetting)
 

joelurmel

Engaged Member
Nov 3, 2022
2,650
4,704
397
I had re-install windoze 11 but since then the oiwershell version of unren won't work

rpatool.py:128: SyntaxWarning: invalid escape sequence '\{'
os.remove("{0}\{1}".format(directory, archive))
Traceback (most recent call last):
File "rpatool.py", line 11, in <module>
import renpy.config
File "renpy/config.py", line 1056, in <module>
AttributeError: module 'renpy' has no attribute 'error'

Creating unrpyc...
Traceback (most recent call last):
File "unrpyc.py", line 66, in <module>
import decompiler
File "decompiler\__init__.py", line 35, in <module>
store = magic.fake_package("store")
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "decompiler\magic.py", line 637, in fake_package
return __import__(name)
^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'store'

Has anyone seen this problem?

Its never done this before.. (I'm wracking my brain thinking what am I forgetting)
The PowerShell version of this script is no more up to date with Ren'Py 8.4.*
 

joelurmel

Engaged Member
Nov 3, 2022
2,650
4,704
397
It's time for me to share my modified UnRen-forall.bat with you :)

What's changed:
Added latest rpatool version 0.8 which supports RPA v3 deobsfuscation (not implemented for now).
(used only if Python >= 3.8, otherwise use the old one).

Replaced the old unrpyc with the latest versions of , version 1.3.2 for Ren'Py <= 7 and version 2.0.2 for Ren'Py V8.
Fixed the bug that prevented UnRen-forall from being used if there was a space in the tree structure (as in MyBimbo Beta).
Improved control of the Python version that accompanies the game, to avoid choosing the wrong one as in Milfania.
All commands are now checked for correct execution.
RPA files moved to the game/rpa directory, if you choose not to delete them. This is to avoid the duplicate labels problem when the archive has been poorly constructed.
Introduction of the option not to rewrite RPY files if already present.
Added a timer of 5 sec on Y/N questions with default at N for RPA and RPY. After choosing option from the menu, the script takes care of itself.
Use of a more explicit color coding. Green for goods, yellow for logos and warnings and red for errors.
A UnRen-forall.log file is now created in the game directory for more details.
I've also integrated right-click registry add/remove (Admin right required).
The script is now 9.6.39. 39 being the number of changes made to the script.
If you have any problems, please let me know using the UnRen-forall.log file, and I'll make the corrections.

Apparently, the temporary fix for decompiling Ren'Py 8.4 prevents Ren'Py 7 files from being decompiled.
So, while waiting for the final version, use version 9.6.42 for Ren'Py 7.


You don't have permission to view the spoiler content. Log in or register now.
Updated to 9.6.50

Checked
with Ren'Py 8.4.*:
AfterClass-Patreon-v0.12.51p-a01-pc
AwkwardAweakenings-0.20.05-pc
HighSchoolDays-0.23-pc
LoggedOut-0.01PreAlpha-win
summertimesaga-21.0.0-wip.6155-pc
TwistedWorld-0.1.5-pc

with Ren'Py 8.2.*:
hearts_of_the_city2-1.0-pc

With Ren'Py 7.4.*:
Apocalust0.09-0.09-pc

Decompiled without error and game start, still have some cosmetic differences with the original rpy when provided.

IMPORTANT:
For translators who don't understand why certain phrases aren't translated if the scripts are in an rpa archive when it's translated when it's out.
This is because unrpyc is strict about spaces, and if, for example, the developer wrote:

MC“Hello Mom”

unrpyc will rewrite it as

MC “Hello Mom”

I found another error that does not affect the game's functionality, but does affect the translations!
If the second menu entry is followed by a blank line:

mc "No need to apologize. Family is important."
"Make a joke to lighten the mood":

mc "Well, at least you're prepared for any medical emergencies in the neighborhood now."

unrpyc rewrote it by moving the blank line before the menu entry

mc "No need to apologize. Family is important."

"Make a joke to lighten the mood":
mc "Well, at least you're prepared for any medical emergencies in the neighborhood now."

Maybe Madeddy can find a solution, because I haven't been able to.
 
Last edited:

"CJ"LongDong

Conversation Conqueror
Mar 6, 2021
6,752
71,794
699
No problemo. Test it and have fun. I don't use them myself so no idea if its correct.

INFO: Attached is a possible unstable dev version of the injector, a bit ahead of unrpyc v2.0.2 to support Ren'Py v8.4+ games.
Thanks. Confirmed. Its a new class in the Lexer i noticed already 6 months back as they added it and i remember wanted to ask on GH about it. Now we know, i forgot about it till now. :giggle:

valery-iwanofu (Github) solved this already as the previous error with the "init bug" and i will add it to my fork/PR for completeness. Thanks to him!

----
Just so you folks understand why i not simply point you to the other PR on GH:
  • There are other code improvements and additions in there where i solong not know for what they are.
  • Some error fixes i made are missing in his.
So you see, i complete my step by step as the errors from you rolling in. Or the unrpyc dev finds some time to catch up on the project. What ever happens first...

Greets
Madeddy pls update the injectors to the latest version of your GH fork/RP. I'd highly appreciate it!

Could you add these injectors to your GH fork/RP, perhaps in the comments? Then I wouldn't have to ask you here every time you update your fork/RP, as I don't want to bother you.
 

Madeddy

Well-Known Member
Dec 17, 2017
1,016
735
244
If the second menu entry is followed by a blank line:

....

unrpyc rewrote it by moving the blank line before the menu entry
Could be multiple reasons. Linenumbers counting and tracking etc. is a finicky thing. There is also a antique issue on GH about problems with the monologue mode - still unresolved. EDIT: After reading through this again, it seems to me this could be such a case: See and the ".

I think you should make on GH a new issue about this thing or add it to ish 99 maybe.
 
Last edited:

joelurmel

Engaged Member
Nov 3, 2022
2,650
4,704
397
It's time for me to share my modified UnRen-forall.bat with you :)

What's changed:
Added latest rpatool version 0.8 which supports RPA v3 deobsfuscation (not implemented for now).
(used only if Python >= 3.8, otherwise use the old one).

Replaced the old unrpyc with the latest versions of , version 1.3.2 for Ren'Py <= 7 and version 2.0.2 for Ren'Py V8.
Fixed the bug that prevented UnRen-forall from being used if there was a space in the tree structure (as in MyBimbo Beta).
Improved control of the Python version that accompanies the game, to avoid choosing the wrong one as in Milfania.
All commands are now checked for correct execution.
RPA files moved to the game/rpa directory, if you choose not to delete them. This is to avoid the duplicate labels problem when the archive has been poorly constructed.
Introduction of the option not to rewrite RPY files if already present.
Added a timer of 5 sec on Y/N questions with default at N for RPA and RPY. After choosing option from the menu, the script takes care of itself.
Use of a more explicit color coding. Green for goods, yellow for logos and warnings and red for errors.
A UnRen-forall.log file is now created in the game directory for more details.
I've also integrated right-click registry add/remove (Admin right required).
The script is now 9.6.39. 39 being the number of changes made to the script.
If you have any problems, please let me know using the UnRen-forall.log file, and I'll make the corrections.

Apparently, the temporary fix for decompiling Ren'Py 8.4 prevents Ren'Py 7 files from being decompiled.
So, while waiting for the final version, use version 9.6.42 for Ren'Py 7.


You don't have permission to view the spoiler content. Log in or register now.
Updated to 9.6.53. Minor bug fixes and 2 new options
 

Madeddy

Well-Known Member
Dec 17, 2017
1,016
735
244
Apparently, the temporary fix for decompiling Ren'Py 8.4 prevents Ren'Py 7 files from being decompiled.
WTF...?
Decompiling Ren'Py v7 (Py2) apps with a decompiler for v8 (Py3)?

sw7_not_working_so.gif

Or did i miss something? And... the legacy unrpyc(v1.3.2) was not updated(by me at least), because Ren'Py for py2 was recently not changed anymore and will never again, as it's EOL.

Something was lost in translation or so, i guess, huh?
 

joelurmel

Engaged Member
Nov 3, 2022
2,650
4,704
397
WTF...?
Decompiling Ren'Py v7 (Py2) apps with a decompiler for v8 (Py3)?

View attachment 5139403

Or did i miss something? And... the legacy unrpyc(v1.3.2) was not updated(by me at least), because Ren'Py for py2 was recently not changed anymore and will never again, as it's EOL.

Something was lost in translation or so, i guess, huh?
No, I use the legacy version for v7 py2
 

joelurmel

Engaged Member
Nov 3, 2022
2,650
4,704
397
It's time for me to share my modified UnRen-forall.bat with you :)

What's changed:
Added latest rpatool version 0.8 which supports RPA v3 deobsfuscation (not implemented for now).
(used only if Python >= 3.8, otherwise use the old one).

Replaced the old unrpyc with the latest versions of , version 1.3.2 for Ren'Py <= 7 and version 2.0.2 for Ren'Py V8.
Fixed the bug that prevented UnRen-forall from being used if there was a space in the tree structure (as in MyBimbo Beta).
Improved control of the Python version that accompanies the game, to avoid choosing the wrong one as in Milfania.
All commands are now checked for correct execution.
RPA files moved to the game/rpa directory, if you choose not to delete them. This is to avoid the duplicate labels problem when the archive has been poorly constructed.
Introduction of the option not to rewrite RPY files if already present.
Added a timer of 5 sec on Y/N questions with default at N for RPA and RPY. After choosing option from the menu, the script takes care of itself.
Use of a more explicit color coding. Green for goods, yellow for logos and warnings and red for errors.
A UnRen-forall.log file is now created in the game directory for more details.
I've also integrated right-click registry add/remove (Admin right required).
The script is now 9.6.39. 39 being the number of changes made to the script.
If you have any problems, please let me know using the UnRen-forall.log file, and I'll make the corrections.

Apparently, the temporary fix for decompiling Ren'Py 8.4 prevents Ren'Py 7 files from being decompiled.
So, while waiting for the final version, use version 9.6.42 for Ren'Py 7.


You don't have permission to view the spoiler content. Log in or register now.
Updated to 9.6.57 :)
You can now extract RPA archives with extension renamed like in Sunshine Valley [v0.1] [Rehex],
and you can select which RPA files you want to extract.
 

Madeddy

Well-Known Member
Dec 17, 2017
1,016
735
244
No, I use the legacy version for v7 py2
Then I don"t understand the line I quote, because it reads contradictory to me.

Anyway, seeing you've taken apparently the caretaker job for unren:win, i got some thoughts. If you allow.
  1. I think its of advantage to make two unren versionsin the future. One for v8 and another for the old Ren'Py. Pre v8 Ren'Py is EOL, so will not significantly change anymore, means with this also not the unren tools.
    • The old version would be possible the last you make and will not need care anymore.
    • The new version will have less code and will be way less convoluted and very much simpler all around, which will ease maintaining it.
  2. You changed a lot of cmd code, so i would use a new name-suffix to prevent confusion. Unren+current and legacy or +renpy version or something else.
  3. Maybe a new thread for a new unren could be of of advantage. This could replace the others(could still be linked the new), divide from the antique postings and where you have control of the first post(Descriptions, attachments, links).
Ok. This came just to mind. :whistle:
 

"CJ"LongDong

Conversation Conqueror
Mar 6, 2021
6,752
71,794
699
Madeddy sorry to bother you, but maybe you missed my post?
Madeddy pls update the injectors to the latest version of your GH fork/RP. I'd highly appreciate it!

Could you add these injectors to your GH fork/RP, perhaps in the comments? Then I wouldn't have to ask you here every time you update your fork/RP, as I don't want to bother you.
 
5.00 star(s) 3 Votes