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

5.00 star(s) 8 Votes

goobdoob

Conversation Conqueror
Modder
Respected User
Dec 17, 2017
7,425
9,677
So has the Renpy 7.0 issue people were mentioning been fixed by the latest version of unrpyc?

The last few releases mention the layered images and renpy 7.0:


If I use unrpa from UnRen and then use the github version of unrpyc everything should be fine right?
I looked at the unrpyc code on github. There are 2 versions - unrpyc.py and un.rpyc. Both use the same decompiler. This decompiler has some commit messages that reference layered images and index expressions. So they SHOULD work.

Do you know of a game that the current unren fails on because of layered images?
 

het2000

Member
Aug 8, 2016
342
396
So theres a new game called Zeliria Sanctuary and .rpa files cant be extracted with neither 0.6 or 0.7 version of Unren.I get "ValueError: the given file is not a valid Ren'Py archive, or an unsupported version".Maybe they've done something to protect the archives. Can someone more knowledgeable try it please? Or if possible please unpack the attached file
 

srksrk 68

Forum Fanatic
Modder
Sep 17, 2018
4,362
5,567
I second what Penfold have said--that they've most likely been been converted to webp format.
That's exactly the case.

You can install Google's WEBP codec to see preview thumbnails in Windows Explorer. Chrome can display them out-of-the-box, and also Firefox as far as I know.

I have not tried the stuff from github personally, but I don't recall anyone saying the layering issues were resolved. However, v1.0.10 from there was supposed to squash that, I believe. So, you should be fine, but I don't know first-hand. I've been told that (and the only game I can come up with at the top of my head) has partially implemented that and is slowly converting towards more layering; thus, if you have that game on hand, then that might be something you can test with. Best of luck, Maim!
*I* said it, I tried it, and it is resolved.
 
  • Like
Reactions: Sheknowsaboutyou

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
9,944
14,546
I often find that if by using unren the game brings up an error screen before loading, but this can be ignored [...]
Are these known issues, or am i doing something wrong.
It's a known issue. The developer mode catch errors that are invisible otherwise. So, basically when you get this kind of error, it's because the author don't even use the SDK to write his game.


"ValueError: the given file is not a valid Ren'Py archive, or an unsupported version".Maybe they've done something to protect the archives.
Yeah, that's what the error say. It's probably just a change in the file signature. When will dev's understand that they can't prevent us to look inside ? At least not with cheep tricks like that...
There's a way to fix it, but it need some knowledge.
 
Sep 8, 2018
335
1,392
Thank you all for useful suggestions. It's because of the reason what you said. I downloaded another crunched version and it was already extracted. Job done. :)
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
9,944
14,546
*I* said it, I tried it, and it is resolved.
And did it finally also works with user defined statements using blocks ?
There's a working code using them in if someone have want.
 

Davox

Well-Known Member
Jul 15, 2017
1,513
2,257
@Davox I've not encountered those issues myself. In fact, I prefer to use v0.6 of UnRen versus v0.7. There must be something wonky going on on your end. I rechecked a game very quickly and works fine; nothing out of the ordinary here.

Editted as a reply to Davox.
I’ve only ever used v0.6. It doesn’t happen in all games. Someone else responded to say it’s the developer mode tripping something and is bad coding by the dev.
 

random.person

Active Member
Aug 11, 2017
802
1,291
So has the Renpy 7.0 issue people were mentioning been fixed by the latest version of unrpyc?

The last few releases mention the layered images and renpy 7.0:


If I use unrpa from UnRen and then use the github version of unrpyc everything should be fine right?
Doesn't unren use rpatool and not unrpa?

Anyway I just hope unrpyc doesn't move to Python 3, I am not particularly good at version control and keeping multiple versions of a software installed =/
 
  • Like
Reactions: Maid Lain

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
9,944
14,546
Anyway I just hope unrpyc doesn't move to Python 3,[...]
It's unlikely to happen because the un.rpyc version rely on the Python embedded by Ren'py.
This said, PyTom expressed more than once the idea to devel a version 8.x of Ren'py in the same time than the 7.x, as transition from Python 2.x to Python 3.x. If he finally do it, it will become a problem and the un.rpyc version will probably disappear, or be limited to only one branch of Ren'py.
 

random.person

Active Member
Aug 11, 2017
802
1,291
It's unlikely to happen because the un.rpyc version rely on the Python embedded by Ren'py.
This said, PyTom expressed more than once the idea to devel a version 8.x of Ren'py in the same time than the 7.x, as transition from Python 2.x to Python 3.x. If he finally do it, it will become a problem and the un.rpyc version will probably disappear, or be limited to only one branch of Ren'py.
Urgh, damn python, them and their fucking backward incompatible on purpose version.
That's what you get for dabbling in interpreted languages, I guess. I'll take a compiled language every day of the week.

If I ever get any time I'm curious to see how to deal with .rpyc myself and maybe implement something not in fucking python. It's probably too much for my hobbyist skills, but maybe I'll learn a thing or two while failing miserably.
 

RaXorX

Newbie
Dec 24, 2018
37
5
Check that powershell's folder is added to your system path variable. It's probably missing from there.
Tell us if you can't figure out what I'm talking about or how to do it.
It is and I guess I said so that the path variable seems to be fine for powershell the path is correct there. That's where I found out where PS was and went there and ran it and it worked so just added the direct path in the unren source.
 

Penfold Mole

Engaged Member
Respected User
May 22, 2017
2,855
6,379
If your %PATH% environment variable is correct, then you should be able to run your powershell from anywhere. If you have to use it with its path, then your %PATH% variable must be broken and nothing in it actually works.
A single typo, a single wrong symbol or a correct symbol in a wrong place in that variable can break it and turn it unusable, even if you can see that powershell path somewhere in there.
 

ShadowFTL

New Member
Jan 16, 2019
5
0
Yeah, that's what the error say. It's probably just a change in the file signature. When will dev's understand that they can't prevent us to look inside ? At least not with cheep tricks like that...
There's a way to fix it, but it need some knowledge.
using rpatool and trying to use this rpa file as normal rpa3 archive i get such error "invalid literal for int() with base 16: 'F 424242'

may be its a key to unpack this .rpa but idk how to use this key
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
9,944
14,546
"invalid literal for int() with base 16: 'F 424242'
The error you get mean that rpatool found something starting by 'F' and containing a space, where it was expecting to find a number. So, I guess that the author of the game changed the signature in the file, apparently by adding two letters to it.
When you look at the .rpa file, it normally start by "RPA-3.0" followed by a series of character (0-9 and a-f), followed by "42424242" ; with "RPA-3.0" being the said signature.

So, to "correct" rpatool you need to :
  1. Open the file "[name of the game]/renpy/loader.py" ;
  2. Search for :
    Code:
    # 3.0 Branch.
    if l.startswith( "[SOMETHING]" );
    The exact line number vary depending of the version of Ren'py, but it should be a line 1xx. Obviously, you'll not found [SOMETHING], but there will be something at this place.
  3. Open the file "rpatool" ;
  4. Search for "RPA3_MAGIC = 'RPA-3.0 '", normally at top of the file ;
  5. Add "RPA3_FIX = 'XXX '" after this line, with "XXX" being the [SOMETHING] you found in step 2 (WARNING, there's a space before the ending quote) ;
  6. Search for :
    Code:
    if magic.startswith(self.RPA3_MAGIC):
    return 3
  7. After these two lines, add :
    Code:
    if magic.startswith(self.RPA3_FIX):
    return 3
  8. Save the changes.

So, if the signature was changed from the original "RPA-3.0" to "AON-3.0".
In the 'loader.py' file, you'll found :
Code:
            # 3.0 Branch.
            if l.startswith( "AON-3.0 " );
And you need to change the 'rpatool' file like this :
Code:
    RPA3_MAGIC = 'RPA-3.0 '
    RPA3_FIX = 'AON-3.0 '

    [many lines]

        if magic.startswith(self.RPA3_MAGIC):
            return 3
        if magic.startswith(self.RPA3_FIX):
            return 3
Normally it should be enough to now extract the content of the .rpa file with the modified rpatool. If you keep this modified version of rpatool, next time you'll just have to change the value you gave to "RPA3_FIX".
 
  • Like
Reactions: random.person

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
9,944
14,546
i find only loader.PYO (and other filesa has .pyo too not .py)
Will they, one day, learn that you can't effectively obfuscate Ren'py ? They can just piss off regular users.


So what to do to open .pyo file properly?
You can't, they are the "pre-processed" version of the source. It's not difficult to revert them into a source file, but installing the needed tool ask for more than basic knowledge.
This said, it's not really a problem. Just open the .rpa file with a hexadecimal editor. If you don't have one, you can use by example ; not the best, but free, easy and small enough for punctual uses. You'll see a bunch of characters, including the signature they used ; the "RPA-3.0" you can see on the right side of the attached image.
Just use everything before the first space (don't forget to include it) as value for "RPA3_FIX". If they didn't messed more in depth, it should work.


hexEdit.jpg
 

ShadowFTL

New Member
Jan 16, 2019
5
0
trying to do this. open .rpa - find RPA-3.2 at right, do fix lines to rpatool. and get unexpected indent


Безымянный.png

p.s. i decompile .pyo file and get .py and yes - it contains 'RPA-3.2 '
 

ShadowFTL

New Member
Jan 16, 2019
5
0
Done! I get it unpacked! last pice of puzzle - this diffenece in file.

self.key = int(metadata[27:35], 16) (standart was 25:33) so after changes its done.


Ok. It was 2nd game wich i cant open with standart rpatool. So i find 1st one. I try open it a while ago. So i thought with new knoleges i can open it too.

So i did same things. Find code at .py file:

# Alternate format based off 3.0
if l.startswith("ALT-1.0 "):
offset = int(l[17:33], 16)
key = int(l[8:16], 16)
extraKey = 0xDABE8DF0
f.seek(offset)
index = loads(f.read().decode("zlib"))

change RPA-3.0 to ALT-1.0 change offset and key, but get this eror:

could not extract file (file name with path) from archive: Python int too large too convert to C long.

I think main thing is line 'extraKey = 0xDABE8DF0' - as at standart code no such line, so its nececary to use it somehow
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
9,944
14,546
5.00 star(s) 8 Votes