CREATE YOUR AI CUM SLUT ON CANDY.AI TRY FOR FREE
x

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

5.00 star(s) 9 Votes

pepplez

Member
Jun 7, 2020
426
542
In the end, this worked.

I had tried CensoredUsername's unrpyc casually a few times yesterday. The simplest method for using it is as you said, just dropping the un.rpy into the game's /game/ directory and then running the program, but for whatever reason, my game was crashing on startup whenever that file was present.

I had to get a little sweatier today. Installed Python, read the full documentation and some of the closed issues on the guy's git, tried multiple versions of unrpyc.

Finally succeeded in just doing command line stuff directly on the one .rpyc file I was trying to open.

edit for posterity in case someone else randomly comes here via Google in the next 10 years:

stats.rpyc finally opened via this method but moods.rpyc still doesn't decompile properly
Hum, there are just three files (un.rpyc, un.rpy, bytecode.rpyb) which can perform the injection. I have only tried with Renpy 8 and there it was enough to move the un.rpy into the game-folder. I think un.rpyc and/or bytecode.rpyb do the same (?). Just out of curiosity, which version did you use?
Edit: You installed python. Version 2.x? Did the files provided not work?
 

cooky223

New Member
Jul 25, 2019
9
3
Hum, there are just three files (un.rpyc, un.rpy, bytecode.rpyb) which can perform the injection. I have only tried with Renpy 8 and there it was enough to move the un.rpy into the game-folder. I think un.rpyc and/or bytecode.rpyb do the same (?).
I tried all 3 methods (un.rpyc, un.rpy, bytecode.rpyb) and in the case of using it with Long Live The Queen, none of them worked. I'm assuming there's just something unique in the code for this game, or it is obfuscated, or something, because the game crashed on startup.

For what it's worth, a game like Doki Doki Literature Club every tool I tried (unren, RPATool, etc) all worked first try, no tweaking, no pain, no sweat, super duper easy.

Just out of curiosity, which version did you use?
Edit: You installed python. Version 2.x? Did the files provided not work?
I installed Python 3.13 64 bit for Windows. To be honest, I have no idea if that did the trick or not since when I go down a rabbit hole like this, I get increasingly impatient and just start doing everything half assed while I watch a movie or something on the side lol.

Also in my understanding on unren, it is supposed to use the Python included with the Ren'py game, and although Long Live The Queen does have a /lib/windows-x86/ Python included, it never seemed to detect it.
 
  • Like
Reactions: pepplez

Madeddy

Active Member
Dec 17, 2017
847
499
I tried all 3 methods (un.rpyc, un.rpy ...
These are the same file. The .rpyc is just the already compiled variant of the .rpy after you used it already on a app. So no need for trying both.
...just start doing everything half assed...
Then its mostly a waste of time doing it, if not right. But from the look of it you know this anyway.
...in the case of using it with Long Live The Queen, none of them worked...

... a game like Doki Doki Literature Club every tool I tried (unren, RPATool, etc) all worked first try ...
So, there is a pointer in this two lines above i would say. This studio has more as a dozen games under their belt an sells them regularly. This means they are no slouches like some of the riffraff on `treon and such. Without looking at the code i put my money on a modified engine or some form of obfuscation, to prevent people from getting some code of theirs.

In the end, you should not wonder about the outcome of this. :coffee: On a game from 2012 this version or even older ones of unren should work. The only ones causing trouble are the newer Ren'Py versions in the 7.x line (newer as v7.5) and all after v8.0(py3 branch).
Greets
 
Last edited:
  • Like
Reactions: pepplez

haro19

Newbie
Jun 9, 2023
34
34
I tried all 3 methods (un.rpyc, un.rpy, bytecode.rpyb) and in the case of using it with Long Live The Queen, none of them worked. I'm assuming there's just something unique in the code for this game, or it is obfuscated, or something, because the game crashed on startup.

For what it's worth, a game like Doki Doki Literature Club every tool I tried (unren, RPATool, etc) all worked first try, no tweaking, no pain, no sweat, super duper easy.



I installed Python 3.13 64 bit for Windows. To be honest, I have no idea if that did the trick or not since when I go down a rabbit hole like this, I get increasingly impatient and just start doing everything half assed while I watch a movie or something on the side lol.

Also in my understanding on unren, it is supposed to use the Python included with the Ren'py game, and although Long Live The Queen does have a /lib/windows-x86/ Python included, it never seemed to detect it.
I can't even find this game, but the git version of unren requires all three file to be placed in the game folder at the same time including bytecode.rpyb in the game/cache folder which is actually quite important, on a developers guess I believe it overwrites the compiled python during the next load. Even then the version on git is only required for versions above 7.2 or 7.4 (I forget offhand), what seems to be your problem is a corrupt exe file as that's actually the python exe used for decompiling, what may work is sticking another games executable in the folder and renaming it to the exe file along with the .py and .sh of the same name as the exe files.

Such as

Long Live The Princess.exe
Long Live The Princess.py
Long Live The Princess.sh

Copy those three similar files from another folder and give them those file names, backing up the originals. Then try again. If they were able to put any form of lock on the game it would be in the python exe which IS the game executable, it has nothing to do with which version of python you have installed locally or the tool would never work...and ren'py would not work the way it does.
 
  • Thinking Face
Reactions: pepplez

pepplez

Member
Jun 7, 2020
426
542
I can't even find this game, but the git version of unren requires all three file to be placed in the game folder at the same time including bytecode.rpyb in the game/cache folder which is actually quite important, on a developers guess I believe it overwrites the compiled python during the next load. Even then the version on git is only required for versions above 7.2 or 7.4 (I forget offhand), what seems to be your problem is a corrupt exe file as that's actually the python exe used for decompiling, what may work is sticking another games executable in the folder and renaming it to the exe file along with the .py and .sh of the same name as the exe files.

Such as

Long Live The Princess.exe
Long Live The Princess.py
Long Live The Princess.sh

Copy those three similar files from another folder and give them those file names, backing up the originals. Then try again. If they were able to put any form of lock on the game it would be in the python exe which IS the game executable, it has nothing to do with which version of python you have installed locally or the tool would never work...and ren'py would not work the way it does.
Not sure if this statement is right, but AFAIK Ren'Py engine compiles .rpy files while it launches even if it's distributed. So no need to inject the .exe as it's just a loader imo.
 
  • Like
Reactions: haro19

haro19

Newbie
Jun 9, 2023
34
34
Not sure if this statement is right, but AFAIK Ren'Py engine compiles .rpy files while it launches even if it's distributed. So no need to inject the .exe as it's just a loader imo.
If you try to unren a game without the exe file it will tell you python.exe is missing. Coincidence? I doubt it.

I also just unren'd one game with another games exe file before commenting and had no issues...yet it errors if there is no executable.

If you use ren'py, you'll notice almost all code is passed more or less directly through a python interpreter, although most is encapsulated. Its practically a python bridge with a convenience layer on top.

I may not be dead on...since I haven't dug into it much and this is just my assumption from using ren'py and being a c++ dev for ages...but give it a try, it may just work.
 

pepplez

Member
Jun 7, 2020
426
542
If you try to unren a game without the exe file it will tell you python.exe is missing. Coincidence? I doubt it.

I also just unren'd one game with another games exe file before commenting and had no issues...yet it errors if there is no executable.

If you use ren'py, you'll notice almost all code is passed more or less directly through a python interpreter, although most is encapsulated. Its practically a python bridge with a convenience layer on top.
Yeah, no wonder. But I guess we're talking past each other. (Maybe I had to much booze)
 
  • Haha
Reactions: haro19

haro19

Newbie
Jun 9, 2023
34
34
Yeah, no wonder. But I guess we're talking past each other. (Maybe I had to much booze)
I've had those days, just try switching the exe file and the matching .py and .sh files. See if it works, I mean it can't hurt.

EDIT:

Just to use unren...don't expect the game to load obviously lol.
 
  • Haha
Reactions: pepplez

cooky223

New Member
Jul 25, 2019
9
3
I've had those days, just try switching the exe file and the matching .py and .sh files. See if it works, I mean it can't hurt.
This sounded like a novel idea so I gave it a shot. I couldn't get it to work. Though I didn't try very hard, only attempting a swap with DDLC. I guess if I had more interest I could try it with a lot of different Ren'py games to see if the results would be different.

But as far as my goals for doing all this stuff: I wanted to access LLTQ's script.rpyc, stats.rpyc, and moods.rpyc and I got 2/3 of them, so I called that a win in my book lol.

Script.rpyc I got from GRViewer.com

stats.rpyc I got from running command line unrenpyc

moods.rpyc is stubborn and doesn't want to decompile no matter what I do to it but I ran outta fucks to give

And since I didn't post it the first time around, here's my error log from trying to run the .exe with CensoredUsername's un.rpy in the /game/ directory.

Once again, I got to access the files I wanted to see for the most part. I'm just posting in case someone else randomly falls into a Google rabbit hole and obsesses over this for about 12 hours like I have lol.

Code:
I'm sorry, but an uncaught exception occurred.

While loading the script.
  File "game/un-v2.0.2.rpy", line 5, in python
        renpy_meta_path = sys.meta_path.copy()
AttributeError: 'list' object has no attribute 'copy'

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "H:\games\lltq\renpy\bootstrap.py", line 274, in bootstrap
  File "H:\games\lltq\renpy\main.py", line 223, in main
  File "H:\games\lltq\renpy\script.py", line 173, in load_script
  File "H:\games\lltq\renpy\script.py", line 384, in load_appropriate_file
  File "H:\games\lltq\renpy\script.py", line 355, in load_file
  File "H:\games\lltq\renpy\ast.py", line 664, in early_execute
  File "H:\games\lltq\renpy\python.py", line 981, in py_exec_bytecode
  File "game/un-v2.0.2.rpy", line 5, in <module>
AttributeError: 'list' object has no attribute 'copy'

Windows-post2008Server-6.2.9200
Ren'Py 6.12.2.1531
 

haro19

Newbie
Jun 9, 2023
34
34
This sounded like a novel idea so I gave it a shot. I couldn't get it to work. Though I didn't try very hard, only attempting a swap with DDLC. I guess if I had more interest I could try it with a lot of different Ren'py games to see if the results would be different.

But as far as my goals for doing all this stuff: I wanted to access LLTQ's script.rpyc, stats.rpyc, and moods.rpyc and I got 2/3 of them, so I called that a win in my book lol.

Script.rpyc I got from GRViewer.com

stats.rpyc I got from running command line unrenpyc

moods.rpyc is stubborn and doesn't want to decompile no matter what I do to it but I ran outta fucks to give

And since I didn't post it the first time around, here's my error log from trying to run the .exe with CensoredUsername's un.rpy in the /game/ directory.

Once again, I got to access the files I wanted to see for the most part. I'm just posting in case someone else randomly falls into a Google rabbit hole and obsesses over this for about 12 hours like I have lol.

Code:
I'm sorry, but an uncaught exception occurred.

While loading the script.
  File "game/un-v2.0.2.rpy", line 5, in python
        renpy_meta_path = sys.meta_path.copy()
AttributeError: 'list' object has no attribute 'copy'

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "H:\games\lltq\renpy\bootstrap.py", line 274, in bootstrap
  File "H:\games\lltq\renpy\main.py", line 223, in main
  File "H:\games\lltq\renpy\script.py", line 173, in load_script
  File "H:\games\lltq\renpy\script.py", line 384, in load_appropriate_file
  File "H:\games\lltq\renpy\script.py", line 355, in load_file
  File "H:\games\lltq\renpy\ast.py", line 664, in early_execute
  File "H:\games\lltq\renpy\python.py", line 981, in py_exec_bytecode
  File "game/un-v2.0.2.rpy", line 5, in <module>
AttributeError: 'list' object has no attribute 'copy'

Windows-post2008Server-6.2.9200
Ren'Py 6.12.2.1531
If you swapped exe files I would have expected you to use the unren batch file not run the exe with the newer unren off the git. The swapped exe files would prevent the second method from working.

The version I have from the git is also is just called un.rpy so if thats NOT from the git, I would assume that may be your problem. I mean the obvious first suggestion would be to go in and look at the list.copy function its calling, it may be ancient ren'py code that's been removed or changed.

Either way if your good then your good...figured it was worth trying to help at least.
 

pepplez

Member
Jun 7, 2020
426
542
This sounded like a novel
DDLC is rather old, so make sure to download the older version and try it again:


maybe try the latest version of renpy using python 2.x:
 
  • Like
Reactions: cooky223

Madeddy

Active Member
Dec 17, 2017
847
499
(Maybe I had to much booze)
Wait! There is something as "too much"? :unsure: This would certainly explain some things in our civilization... :giggle:
...the git version of unren requires all three file to be placed in the game folder at the same time including bytecode.rpyb...
No. There are two files and you use one or the other. They're even basically the same code, but use Ren'Py in different ways to get the decompiled files.

Reading folks. Read! Its all there:

...Ren'Py engine compiles .rpy files while it launches even if it's distributed. So no need to inject the .exe as it's just a loader imo.
Correct.
Manipulating these files is pretty pointless, as they're generated at every distribution through Ren'Py. Also AFAIK Ren'Py checks them and throws a tandrum if someone frak's with the exe. Or the host systems AV gets mad. The shell and python files are plain text, what would make "bad code" pretty obvious for some people.
maybe try the latest version of renpy using python 2.x:
Yes. RenPy below v8.x needs the unrypc v1.3 and from Ren'Py v8+ you need unrpyc v2.
 
  • Like
Reactions: pepplez

haro19

Newbie
Jun 9, 2023
34
34
No. There are two files and you use one or the other. They're even basically the same code, but use Ren'Py in different ways to get the decompiled files.
I was talking about the three files in the zip, not the difference between the two versions.

Reading folks. Read! Its all there:
I did, actually, beyond the git. Python exe files compile the python interpreter into the executable....making them standalone so they require no python installation, therefore if an older exe or a tampered exe file happened to be the case....my logic was actually sound.

Now if the AV or ren'py would take a fit over it I can't really say, considering my malicious coding days are far behind me.

I'm certainly not an expert on the matter and don't pretend to be, but I do know how exe files and hard drives find the loading code, so if the python interpreters loading code was ancient or faulty there's a good chance that replacing it with a new version may solve the issue.

EDIT:

Now this is a long shot, but judging from your error you may have found one of the astronomically low amount of games that were compiled during an upgrade to python versions used in renpy.

 
Last edited:

Madeddy

Active Member
Dec 17, 2017
847
499
I was talking about the three files in the zip, not the difference between the two versions.
Sry, i misunderstood. You meant the .exe .py. .sh in the games root? If yes they are static AFAIK and just taken from the SDK and renamed to the games name. If you are interested you can DL the SDK and look for the code in the "/launcher/game/distribute.rpy". The *gamename.py should be the entry point and the sh/exe beside it just starters from the respective OS which point at the *.py.

In the end, if you need these files, you can look for the renpy version of a game and get the Ren'Py SDK for this version. There you can get the files or even redistribute the .../game directory again with it.


I've used unren a bunch and never seen this.
Happens. Should be a manipulated RPA header or maybe a broken file. Can you open the .rpa file(if there are multiple rpa the smallest) and cite the first line?
 
  • Like
Reactions: haro19

haro19

Newbie
Jun 9, 2023
34
34
Sry, i misunderstood. You meant the .exe .py. .sh in the games root?
No big deal. But yes, considering they said the game was 9yrs old...I figure there are alot of things that could be wrong with the loading code. PE executables haven't changed much, but python and ren'py are two entirely different stories, I can barely keep up with the changelogs.
If you are interested you can DL the SDK and look for the code in the "/launcher/game/distribute.rpy".
already have it ;)
Should be a manipulated RPA header or maybe a broken file. Can you open the .rpa file(if there are multiple rpa the smallest) and cite the first line?
Seems he's in better hands than my own for this particular problem...i'll leave you to it.
 

justaplayer69

Member
Nov 29, 2023
166
200
Game Ripper rips all of the game's assets (sprites/BGM) like a champ but doesn't give me the decrypted .rpyc code that I am looking for.
It should, as long as the python that the game uses can be found (only needed for unren, unpacking requires no python). Can you please run GR with the "-v" verbose flag and attach the log and a link to the game files in the GR thread so that I can take a look? But please post your answer in the GR thread, I don't want to derail this thread.
 
5.00 star(s) 9 Votes