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

5.00 star(s) 2 Votes

Maim Lain

Well-Known Member
Modder
Apr 4, 2018
658
1,596
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 rpatool from UnRen and then use the github version of unrpyc everything should be fine right?
 

Back

Active Member
Aug 3, 2017
119
92
Most of the images (which are .png) cannot be seen.
I second what Penfold have said--that they've most likely been been converted to webp format. F95 "crunched versions" of Ren'Py games are also converted to this format.

If I use unrpa from UnRen and then use the github version of unrpyc everything should be fine right?
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!
 

goobdoob

Well-Known Member
Modder
Respected User
Dec 17, 2017
2,031
1,832
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?
 
Aug 8, 2016
48
60
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
 

Attachments

srksrk 68

Formerly 'srksrk68'
Sep 17, 2018
57
64
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.
 

anne O'nymous

Well-Known Member
Modder
Respected User
Jun 10, 2017
1,659
1,704
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
17
16
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. :)
 

Davox

Well-Known Member
Jul 15, 2017
563
264
@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.guy

Well-Known Member
Aug 11, 2017
528
709
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 =/
 
Likes: Maim Lain

anne O'nymous

Well-Known Member
Modder
Respected User
Jun 10, 2017
1,659
1,704
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.guy

Well-Known Member
Aug 11, 2017
528
709
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

New Member
Dec 24, 2018
3
0
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

Well-Known Member
May 22, 2017
1,152
1,557
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

Well-Known Member
Modder
Respected User
Jun 10, 2017
1,659
1,704
"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".
 
Likes: random.guy

anne O'nymous

Well-Known Member
Modder
Respected User
Jun 10, 2017
1,659
1,704
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.


238558_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


238576_Bezymjannyj.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
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

5.00 star(s) 2 Votes