[Ren'Py] UnRen.bat v0.7 - RPA Extractor, RPYC Decompiler, Console/Developer Menu Enabler

5.00 star(s) 2 Votes

Sam

Sysadmin
Staff Member
Administrator
Dec 23, 2016
869
3,119
#1
unren07.png

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.

v0.7
RPYC decompiling is now handled within UnRen
Improved the quicksave/quickload code
Added default keymap for rollback
Fixed noblock for RenPy v7
Fixed back to menu bug

v0.6
Fixed the v0.5 regression when handling normal brackets
Made the "enable scrollback" feature more versatile by setting "hard_rollback_limit" and "rollback_length" to 256, and overwriting renpy.block_rollback()
When finishing a task, it now asks you if you want to perform another

v0.5
Fixed issue with square brackets in path
Fixed "Enable Rollback" feature being inaccessible from menu
Fixed issue where "All" option could halt early if un.rpyc file already existed
Adjusted length of base64 strings, to reduce impact of batch path length limitations
Removed unnecessary usage of powershell, increasing UnRen speed significantly

v0.4
Added "Quick Save" and "Quick Load" hotkey functionality (Thanks @Bloo & @TCMS)
Added "Enable Skip" feature, to force enable skipping of unseen text
Added "Enable Rollback" feature, to force enable scrollwheel rollback
Switched the method used to enable console and developer mode, to better support older renpy games
Tweaked the numbering of the options to group similar functions together
Added error if folder path contains square brackets, temporary workaround
Cleaned up the codebase a bit

v0.3
Set PYTHONPATH for rpatool

v0.2
Correctly handle special characters in directory name

v0.1
Initial release


Mac version is not created or maintained by me
 

Attachments

Krull

Well-Known Member
Donor
GFX Designer
Feb 2, 2017
1,151
5,769
#4
Awesome , can always use more tech-ish stuff like this.
Thanks!
 

gue5t

Well-Known Member
Uploader
Sep 11, 2016
548
646
#7
Can you make a version where the external files are not incorporated in the bat file but the path to them is set?

P.S. Embedding executable content in bat files is bad because it can't be updated by the end user and it's easy to replace it and send the file as new/updated version in order to infect unsuspecting user systems.
 
Likes: rafae khan

Sam

Sysadmin
Staff Member
Administrator
Dec 23, 2016
869
3,119
#8
Can you make a version where the external files are not incorporated in the bat file but the path to them is set?

P.S. Embedding executable content in bat files is bad because it can't be updated by the end user and it's easy to replace it and send the file as new/updated version in order to infect unsuspecting user systems.
That is the same for any executable, any exe can have malicious code in it or be easily binded with another. At least with a .bat script the source is viewable and the base64 encoded strings can be easily decoded. As with anything; if you don't trust the source, don't run it.

This script is intended to be a simple 1 click option, having multiple files, users having to copy different things, having to update the libraries by themselves etc doesn't fit in with the tools intended scope.
 

gue5t

Well-Known Member
Uploader
Sep 11, 2016
548
646
#9
My suggestion was to have 2 versions: one with everything embedded and one where the external files are linked to by the user.

P.S. The problem arrives when people start trusting you and someone else gives them a link to a modified version of the file.
 
Likes: unknown78

Sam

Sysadmin
Staff Member
Administrator
Dec 23, 2016
869
3,119
#10
My suggestion was to have 2 versions: one with everything embedded and one where the external files are linked to by the user.

P.S. The problem arrives when people start trusting you and someone else gives them a link to a modified version of the file.
In v0.3 I can add a variable to define your own path, and if it isn't set it can use the built in version, best of both worlds.

I understand what you meant, however I'm saying that isn't unique to a .bat script, anyone could do that with any exe that is shared anywhere on the internet. It is the users own fault if they decide to trust a random 3rd party.
 
Likes: gue5t
Aug 5, 2016
388
727
#11
So what is supposed to be the end result of all of this? I'm looking in my /game/ folder after running the .bat and there doesn't seem to be any change other than the addition of an un.rpyc file. I'm also seeing an ImportError: no module named site on the app when I run it, is that something that should not be happening?
 

Sam

Sysadmin
Staff Member
Administrator
Dec 23, 2016
869
3,119
#12
So what is supposed to be the end result of all of this? I'm looking in my /game/ folder after running the .bat and there doesn't seem to be any change other than the addition of an un.rpyc file. I'm also seeing an ImportError: no module named site on the app when I run it, is that something that should not be happening?
Just updated to v0.3, which sets PYTHONPATH which should fix your issue, link in OP :)

I'll add the optional configuration gue5t requested in 0.4.
 

Lt. Aldo Raine

Sharing Is Caring
Moderator
Donor
Mar 24, 2017
842
3,131
#14
Just updated to v0.3, which sets PYTHONPATH which should fix your issue, link in OP :)

I'll add the optional configuration gue5t requested in 0.4.
You have completely changed all my plans I had today just by this tools creation. You've made a Happy Perv today......his friends not so much.
 

Sam

Sysadmin
Staff Member
Administrator
Dec 23, 2016
869
3,119
#16
What is the purpose of Extracting RPA packages and decompile RPYC file?
All the images used in renpy games are usually packaged in an RPA file, by extracting them you'll be able to easily see all images contained in the game.

Sometimes a developer will only distribute the RPYC files, which are compiled RPY files, meaning they cannot be viewed in a text editor. Decompiling them will allow you to view the games source code.
 
Likes: abc6969

yolostar

New Member
May 2, 2017
6
0
#17
All the images used in renpy games are usually packaged in an RPA file, by extracting them you'll be able to easily see all images contained in the game.

Sometimes a developer will only distribute the RPYC files, which are compiled RPY files, meaning they cannot be viewed in a text editor. Decompiling them will allow you to view the games source code.
K thnx for the info.
 
5.00 star(s) 2 Votes