Tool Ren'Py UnRen.bat v1.0.11d - RPA Extractor, RPYC Decompiler, Console/Developer Menu Enabler

5.00 star(s) 9 Votes

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,846
15,966
What to do?
Find an equivalent tool for the engine used by this game ? Because unren works only with games using Ren'py, which isn't the case of this game. I don't even know what engine it can be, it's not Ren'py, nor RPG Maker, Tyrano builder, Twine, Unity or Unreal. It also don't look like a RAG game, not a QSP one, and it's definitively not a Flash one.
 

sir_rugs

New Member
Feb 7, 2019
4
2
When I run the UnRen batch file Bitdefender opens up with first a "Disinfecting" pop-up and then a "Threat Removed - Malware" pop-up. The following information is give upon clicking on the "Threat Removed" pop-up:

Potentially malicious application blocked
2 minutes ago
Feature:Advanced Threat Defense
Application cmd.exe has been detected as potentially malicious and blocked. Application path: C:\Windows\System32\cmd.exe

Anyone else encounter this? I am new around here and I apologize if this issue is addressed earlier in the thread, I don't want to read through 29 pages but I will if this topic has been addressed and that's the etiquette.

I took a look a the batch file in Notepad++ and all I can discern from it is that I know absolutely nothing about basic programming.
 
  • Like
Reactions: Sheknowsaboutyou

random.person

Active Member
Aug 11, 2017
802
1,291
When I run the UnRen batch file Bitdefender opens up with first a "Disinfecting" pop-up and then a "Threat Removed - Malware" pop-up. The following information is give upon clicking on the "Threat Removed" pop-up:

Potentially malicious application blocked
2 minutes ago
Feature:Advanced Threat Defense
Application cmd.exe has been detected as potentially malicious and blocked. Application path: C:\Windows\System32\cmd.exe

Anyone else encounter this? I am new around here and I apologize if this issue is addressed earlier in the thread, I don't want to read through 29 pages but I will if this topic has been addressed and that's the etiquette.

I took a look a the batch file in Notepad++ and all I can discern from it is that I know absolutely nothing about basic programming.
Seems to me that the antivirus simply doesn't like that unren wants to launch the command prompt. Which is a legit concern from a general point of view, but doesn't take into consideration that unren doesn't do anything malicious with it.
 

sir_rugs

New Member
Feb 7, 2019
4
2
Seems to me that the antivirus simply doesn't like that unren wants to launch the command prompt. Which is a legit concern from a general point of view, but doesn't take into consideration that unren doesn't do anything malicious with it.

For sure, yeah I figured nothing shady was really going on after doing a little googling and finding many threads where folks were either recommending it or explaining how they were using it themselves. I'll whitelist it.

Thanks for the reply random.guy !
 
  • Like
Reactions: Sheknowsaboutyou

Tom Clark

Newbie
Jun 9, 2018
39
4
View attachment 138006

I had originally created this script for myself, but I've decided to clean it up a bit and release it for everyone. You can extract RPA archives (using built in ), decompile RPYC files (using a fork of by @amanapanama ) and enable the console and developer menu for Ren'Py games.

No dependencies, no internet connection required. You can right click->edit to see the source. Works on Windows 7, 8 and 10. XP and Vista users might need this PowerShell update from Microsoft:

Instructions:
1. Copy UnRen.bat to either the game's root directory (where the exe is) or the /game/ folder
2. Double click on UnRen.bat to execute
3. Select the option you require

Both RPA and RPYC files will be extracted/decompiled to the same path as the original files.

Known Issues:
- Having non-ASCII characters in your folder path may cause issues
- Unrpyc hasn't been updated for RenPy v7 yet, games which make use of the new feature will not decompile correctly

Let me know if you encounter any issues or bugs.

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

You don't have permission to view the spoiler content. Log in or register now.
how do i know when the program is finished
 

Hones

Forum Fanatic
Compressor
Aug 10, 2018
4,156
8,635
how do i know when the program is finished
It tells you. When it has completed what ever task, extract rpa, decompile rpyc, etc it will say Finished!
press 1 to go back to menu any other key to exit
unren.png
 

rickbolby

New Member
Oct 30, 2017
1
0
I've been having a lot of trouble with UnRen saying it can't locate files, it says nothing about the directory, just after I try to extract packages it fails to find them.
 

goobdoob

Conversation Conqueror
Modder
Respected User
Dec 17, 2017
7,426
9,693
I've been having a lot of trouble with UnRen saying it can't locate files, it says nothing about the directory, just after I try to extract packages it fails to find them.
Are you sure you're putting it in the right place? You're using it with a Ren'Py game?

What is the exact error message?
 

vPyxi

New Member
Jul 24, 2017
4
2
Are you sure you're putting it in the right place? You're using it with a Ren'Py game?

What is the exact error message?

I'm also getting similar errors.
It's unable to find unrpyc.py.

Exact error message

+ Decompiling "script.rpyc" - 1892772 bytes
D:\<gamedir>\lib\windows-i686\python.exe: can't open file 'D:\<gamedir>\game\..\unrpyc.py': [Errno 2] No such file or directory

Cleaning up temporary files...
Could Not Find D:\<gamedir>\unrpyc.py

I've tried putting unrpyc.py from amanapanama's repo in the root but it will still fail and then end up deleting it afterwards.
 
  • Like
Reactions: if95

goobdoob

Conversation Conqueror
Modder
Respected User
Dec 17, 2017
7,426
9,693
I'm also getting similar errors.
It's unable to find unrpyc.py.

Exact error message

+ Decompiling "script.rpyc" - 1892772 bytes
D:\<gamedir>\lib\windows-i686\python.exe: can't open file 'D:\<gamedir>\game\..\unrpyc.py': [Errno 2] No such file or directory

Cleaning up temporary files...
Could Not Find D:\<gamedir>\unrpyc.py

I've tried putting unrpyc.py from amanapanama's repo in the root but it will still fail and then end up deleting it afterwards.
That's bizarre. The script unpacks unrpyc.py and runs that.

Are you sure:
  1. The directory is writeable
  2. The disk isn't full
  3. There are no odd characters in the path
  4. The path isn't too long (it would need to be REALLY long)
 

f96zonetrooper

Engaged Member
Dec 21, 2018
2,382
2,325
I have a general question :
I used UnRen to extract the script files of a game. The *.rpy-script files seem to not contain any comments from the dev. Does that mean that the developer did not use comments or are the comments removed from script files when scripts are packed und UnRen/unrpyc so cannot restore the comments in script files?

I have special questions :
I used UnRen on CureMyAddiction 0.3.3.
The script file CureMyAddiction-0.3.3-win\game\scripts\!init\_gui.rpy does not have the line "# Decompiled by unrpyc:..." for me. This probably means that extracting the script was incomplete. Is this a hint that the original script code contained a coding error or are there codings which are unsupported by unrpyc? Is there a log file from UnRen/unrpyc giving details why the script could not be unpacked?
 

goobdoob

Conversation Conqueror
Modder
Respected User
Dec 17, 2017
7,426
9,693
I have a general question :
I used UnRen to extract the script files of a game. The *.rpy-script files seem to not contain any comments from the dev. Does that mean that the developer did not use comments or are the comments removed from script files when scripts are packed und UnRen/unrpyc so cannot restore the comments in script files?
When the rpy files are compiled to rpyc, comments are removed. Probably. :) The documentation doesn't talk about this, but that's how .py->.pyc works (and compilers in general).

But...many devs of these kinds of games are not programmers; they don't know the importance of comments. So there might not have been comments in the first place.

I have special questions :
I used UnRen on CureMyAddiction 0.3.3.
The script file CureMyAddiction-0.3.3-win\game\scripts\!init\_gui.rpy does not have the line "# Decompiled by unrpyc:..." for me. This probably means that extracting the script was incomplete. Is this a hint that the original script code contained a coding error or are there codings which are unsupported by unrpyc? Is there a log file from UnRen/unrpyc giving details why the script could not be unpacked?
_gui.rpy might exist in the archive already, so unrpyc would not decompile _gui.rpyc and overwrite it, unless told to. You should check to see if that's the case.

There are things that the unrpyc used in UnRen 0.7 don't support (specifically, blocks and layered images). I don't know what happens if it tries to decompile a file that uses those.

We're not experts on the inner workings of unrpyc; it's just a tool we use. So, you should ask any technical questions about unrpyc at the unrpyc github page: . Don't mention UnRen, though - he gets testy.
 
  • Like
Reactions: f96zonetrooper

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,846
15,966
When the rpy files are compiled to rpyc, comments are removed. Probably.
You can remove your "probably".
While Python can effectively include comments in the "compiled" files, Ren'py don't do it. This is due to the fact that it don't works directly from the source files, but from the memory image of them, which don't include the comments.


But...many devs of these kinds of games are not programmers; they don't know the importance of comments. So there might not have been comments in the first place.
Or at the opposite too much of them and totally useless ones.


There are things that the unrpyc used in UnRen 0.7 don't support (specifically, blocks and layered images). I don't know what happens if it tries to decompile a file that uses those.
The result will be incomplete (and so unusable) .rpy files. Basically if the game have user defined statements defined as block, you'll have something like this :
Code:
label blablabla:
    myUserDefinedBlock blibli:




   pause 1
The version of unrpyc used don't handle the fact that a block can be here, and so don't retrieve it ; it's more or less the same for layered images.
Later, when you'll ask Ren'py to run the game, it will complain because the block is empty.
 
  • Like
Reactions: f96zonetrooper

discepless

Newbie
Aug 16, 2017
22
30
Dunn why, but sometimes it breaks the game.

As example the game

After the executions of all function on Unren, the game don't start.

There is an error log
You don't have permission to view the spoiler content. Log in or register now.
 

f96zonetrooper

Engaged Member
Dec 21, 2018
2,382
2,325
Dunn why, but sometimes it breaks the game.

As example the game

After the executions of all function on Unren, the game don't start.

There is an error log
You don't have permission to view the spoiler content. Log in or register now.
This error log is created by Ren'Py, not by unrpyc.
To improve unrpyc, it would be helpful if unrpyc would report the errors it runs into when restoring the script files.
 
  • Like
Reactions: discepless

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,846
15,966
There is an error log
[...]
NameError: global name '_menu' is not defined
[...]
I really hate this error, because the effective problem have absolutely nothing to do with the error message ; and I never remember what's exactly the problem, which probably mean that there's more than one cause for this.
Editing "[path to the game]/game/unren-dev.rpy" and changing
config.developer = True by config.developer = False is sometime enough to correct the problem. Else, remove (or move them outside of the game) all the .rpy and .rpyc files (warning, keep the .rpa files) and it should works.
 
  • Like
Reactions: discepless

discepless

Newbie
Aug 16, 2017
22
30
I really hate this error, because the effective problem have absolutely nothing to do with the error message ; and I never remember what's exactly the problem, which probably mean that there's more than one cause for this.
Editing "[path to the game]/game/unren-dev.rpy" and changing
config.developer = True by config.developer = False is sometime enough to correct the problem. Else, remove (or move them outside of the game) all the .rpy and .rpyc files (warning, keep the .rpa files) and it should works.
Usually, to fix those errors i was manually jumping to those lines of code and solved them :D

I'll try your method in the next time. Thank you for a responce! :)
 

goobdoob

Conversation Conqueror
Modder
Respected User
Dec 17, 2017
7,426
9,693
Hi, Does anyone have some commands to use in Mythic Manor? For ex set Love levels or jump to scenes. New to UnRen tool. Thanks
UnRen is the tool that enables things; for console commands for specific games you should ask in the respective game threads.
 
  • Like
Reactions: TheAwesomeDJ
5.00 star(s) 9 Votes