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

5.00 star(s) 9 Votes

VepsrP

Well-Known Member
Modder
Dec 13, 2017
1,387
1,367
Okay. Now try starting the game. I assume we are both talking about Mythos.
Of course, it is now a new test bed for me. Although I already got bad code when decompiling Maou-sama Zero(The benefit is only in one line). I also encountered a similar problem in Ecchi-sensei, where decompilation occurred with problems due to some complex code structures or something like that.
 

Walter Victor

Forum Fanatic
Dec 27, 2017
5,677
19,602
Of course, it is now a new test bed for me. Although I already got bad code when decompiling Maou-sama Zero(The benefit is only in one line). I also encountered a similar problem in Ecchi-sensei, where decompilation occurred with problems due to some complex code structures or something like that.
Just did a quick run through the game, fast-forwarding through most of it (except the sex scenes :D), and even did a restart from the console to get rid of the text box, after adding Ren'Py Transparent Text to the game folder. No problems whatsoever.

It looks like a really well-made game, by the way. Good writing, good effects and interesting story. The choice of either a male or a female MC is an interesting approach, although it's been done before. But it would seem to be a bitch (and time-consuming) to develop.
 

Madeddy

Active Member
Dec 17, 2017
814
468
MY BAD!!! My abject apologies for not thinking about what might be needed. Thank you for looking into it despite my blunder.
Ah.. is ok, don't sweat it. :)
Modified the code to work on games that only support 64 bits. ...
Did a look into your UnRen mod file and thought i drop my two cent:
  • AFAIK there is no else if in batch/cmd script and my personal tests and try's gave me just problems with it. For myself i try to stay away from nested else if(as workaround), even from use of else. Its too easy to fall into some trap an bug your script.

    Its always possible to go just with if and if not. Quod vide "De Morgan's laws". --> not (A ∧ B) is equivalent to ((not A) ∨ (not B))

    Means you could go like:
    Bash:
    set "currentdir=%~dp0%"
    set "gamedir=%currentdir%"
    set "libdir=%currentdir%..\lib\"
    
    if exist "game" if exist "lib" if exist "renpy" (
    set "gamedir=%currentdir%game\"
    set "libdir=%currentdir%lib\"
    )
    
    set "pythondir=%libdir%windows-x86_64\"
    if not exist %pythondir% (
    set "pythondir=%libdir%windows-i686\"
    )
    
    if not exist "%pythondir%python.exe" (
    ... bla bla
    The three set ... lines inside the if conditionals should be indented but this software here fucks it up.

  • If you write anyway around in there: set "renpydir=%currentdir%renpy\" this is never used, so can be droped.
  • Why does the unpacking of unrpyc now say "Creating rpatool..."? C&P mistake? :p
The missing python error msg and others could also get some love about what it says. Walter Victor 's cas did show how it is partly.
 
Last edited:

VepsrP

Well-Known Member
Modder
Dec 13, 2017
1,387
1,367
Ah.. is ok, don't sweat it. :)

Did a look into your UnRen mod file and thought i drop my two cent:
  • AFAIK there is no else if in batch/cmd script and my personal tests and try's gave me just problems with it. For myself i try to stay away from nested else if(as workaround), even from use of else. Its too easy to fall into some trap an bug your script.

    Its always possible to go just with if and if not. Quod vide "De Morgan's laws". --> not (A ∧ B) is equivalent to ((not A) ∨ (not B))

    Means you could go like:
    Bash:
    set "currentdir=%~dp0%"
    set "gamedir=%currentdir%"
    set "libdir=%currentdir%..\lib\"
    
    if exist "game" if exist "lib" if exist "renpy" (
    set "gamedir=%currentdir%game\"
    set "libdir=%currentdir%lib\"
    )
    
    set "pythondir=%libdir%windows-x86_64\"
    if not exist %pythondir% (
    set "pythondir=%libdir%windows-i686\"
    )
    
    if not exist "%pythondir%python.exe" (
    ... bla bla
    The three set ... lines inside the if conditionals should be indented but this software here fucks it up.

  • If you write anyway around in there: set "renpydir=%currentdir%renpy\" this is never used, so can be droped.
  • Why does the unpacking of unrpyc now say "Creating rpatool..."? C&P mistake? :p
The missing python error msg and others could also get some love about what it says. Walter Victor 's cas did show how it is partly.
I just modified the original version of unRen.bat v0.9, so that it can decompile files from the latest RenPy version. What happened with varying success, as practice has shown. In General, I am far from writing a batch file. Literally on my knee, I studied how it was all written and worked. I remember about wrong message, I just keep forgetting to change it, being distracted by more important issues. I will try to fix this message today and see what's wrong with the decompiler, most likely I just cut out the deobfuscation complete with multiprocessing. The latter, unfortunately, had to be absolutely performed, because this stuff requires a file .pyd, which is not supported by python in RenPy. :unsure:
 

VepsrP

Well-Known Member
Modder
Dec 13, 2017
1,387
1,367
Well, I did everything that came to mind. I returned deobfuscation, applied different keys - nothing helped. I can't even understand the difference between the compiled un.rpyc file, since it can easily handle all this.
Update: as it turned out, un.rpyc also fails. When I re-run - the same error came out. In the end, I spent 5 hours trying to find out that the problem was not in my build. Now I feel like a complete moron.
 
  • Like
Reactions: yoyomistro

Madeddy

Active Member
Dec 17, 2017
814
468
...
Update: as it turned out, un.rpyc also fails. When I re-run - the same error came out. In the end, I spent 5 hours trying to find out that the problem was not in my build. Now I feel like a complete moron.
:unsure:
Um... whats happening? I cannot follow just now? Could you please describe where you trip?

I hope you do not use the "unchanged" node.js build files from the unren repo to build unren. Sam did there some strange js vodoo. If i remember correctly the recent changes to unrpyc should break the building process. I think the new file for deobfuscating will not get packed allong the others.


...
I can't even understand the difference between the compiled un.rpyc file...
Do you mean the diff between unrpyc.py and un.rpyc? If yes i could somewhat explain if wanted. I am sure anne O'nymous even more.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,299
15,166
VepsrP
Do you mean the diff between unrpyc.py and un.rpyc? If yes i could somewhat explain if wanted. I am sure anne O'nymous even more.
Both rely on Ren'py's core to works. But a part of the core have been radically changed with the 7.4.0 version, the renpy library. With version prior to 7.4.0 it was a series of individual compiled libraries (DLL or so, depending of the OS), while with the version 7.4.0 it became a single compiled library, that is now named "librenpython".
For un.rpyc, it present no problem, being proceeded by Ren'py itself, it have access to everything. The library have already be imported (and correctly) by Ren'py itself, and therefore Python know how to address it. But because it's an independent application, unrpyc.py have to load it by itself. And it fail to do it, at least because of the name change ; I haven't really looked further, but I guess that there's also few changes in the structure of the library itself.
 
  • Like
Reactions: yoyomistro

VepsrP

Well-Known Member
Modder
Dec 13, 2017
1,387
1,367
:unsure:
Um... whats happening? I cannot follow just now? Could you please describe where you trip?

I hope you do not use the "unchanged" node.js build files from the unren repo to build unren. Sam did there some strange js vodoo. If i remember correctly the recent changes to unrpyc should break the building process. I think the new file for deobfuscating will not get packed allong the others.


Do you mean the diff between unrpyc.py and un.rpyc? If yes i could somewhat explain if wanted. I am sure anne O'nymous even more.
I mean, the unrpyc tool itself can't handle the code from the Mythos game. It does not matter if it is python source code or compiled un.rpyc of the latest version. So here we can only wait for developers to deal with this problem, My level is clearly not enough to write decompilers or modify them at this level.:rolleyes: As for deobfuscation, I just cut it out at the same time as I cut out multiprocessing, most likely so that there would be less hassle with base64.:WeSmart: In general, we are waiting for new versions of the decompiler.:)
 

VepsrP

Well-Known Member
Modder
Dec 13, 2017
1,387
1,367
VepsrP


Both rely on Ren'py's core to works. But a part of the core have been radically changed with the 7.4.0 version, the renpy library. With version prior to 7.4.0 it was a series of individual compiled libraries (DLL or so, depending of the OS), while with the version 7.4.0 it became a single compiled library, that is now named "librenpython".
For un.rpyc, it present no problem, being proceeded by Ren'py itself, it have access to everything. The library have already be imported (and correctly) by Ren'py itself, and therefore Python know how to address it. But because it's an independent application, unrpyc.py have to load it by itself. And it fail to do it, at least because of the name change ; I haven't really looked further, but I guess that there's also few changes in the structure of the library itself.
Well, there are no problems with loading libraries, except that for third-party (decompiler folder) I had to use crutches. I wanted to look at its code in general(the part that I can understand at least). Understand why it does not decompile itself, including if I try to do it not in the RenPy itself, but through a Python file.:unsure:
 

Madeddy

Active Member
Dec 17, 2017
814
468
I mean, the unrpyc tool itself can't handle the code from the Mythos game. It does not matter if it is python source code or compiled un.rpyc of the latest version. So here we can only wait for developers to deal with this problem...
I don't know what you do, if you talk just around it with vague descriptions. Sry, i just dont understand what you do or try. :unsure:

Anyway, there is no problem with current unrpyc-v1.1.5 for me if i go with a native py2.7 installation(i test with the UnRen rewrite). This way it works for different games, even this "Mythos-0.1.0".
 

VepsrP

Well-Known Member
Modder
Dec 13, 2017
1,387
1,367
I don't know what you do, if you talk just around it with vague descriptions. Sry, i just dont understand what you do or try. :unsure:

Anyway, there is no problem with current unrpyc-v1.1.5 for me if i go with a native py2.7 installation(i test with the UnRen rewrite). This way it works for different games, even this "Mythos-0.1.0".
I just decided to write the latest available version of unrpyc in a prepared batch file, which initially does not belong to me. The batch is more convenient to use than the tools separately. But when I try to decompile the Mythos game files - the game starts, but when the menu should appear, the game crashes. I'll send you an error message later when I get home. Moreover, even if i decompile the game with the un.rpyc file, it will start calmly at first, but if i close it and open again, the same error crashes, something about the "tuple".
 
Last edited:
  • Like
Reactions: yoyomistro

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,299
15,166
But when I try to decompile the Mythos game files [...] the same error crashes, something about the "tuple".

Congratulation, you've found a bug, both in Ren'py, un.rpyc and the game.

In Ren'py, that should complain when it see this :
Code:
define config.font_replacement_map["fonts/RobotoCondensed-Regular.ttf", False, True] = ("fonts/RobotoCondensed-Italic.ttf", False, False)

In un.rpyc, that should restore it as it, and not as :
Code:
define config.font_replacement_map = ("fonts/RobotoCondensed-Italic.ttf", False, False)
But to be fair, I really wonder how Ren'py stored it. Plus, the line is so ridiculous and goes against all logic, therefore who would have guessed that it would be accepted by Ren'py.


And finally in the game, that shouldn't have this line (and the two after it), but
Code:
init python:
    config.font_replacement_map["fonts/RobotoCondensed-Regular.ttf", False, True] = ("fonts/RobotoCondensed-Italic.ttf", False, False)
as said in the documentation.
 
  • Like
Reactions: yoyomistro

VepsrP

Well-Known Member
Modder
Dec 13, 2017
1,387
1,367
Congratulation, you've found a bug, both in Ren'py, un.rpyc and the game.

In Ren'py, that should complain when it see this :
Code:
define config.font_replacement_map["fonts/RobotoCondensed-Regular.ttf", False, True] = ("fonts/RobotoCondensed-Italic.ttf", False, False)

In un.rpyc, that should restore it as it, and not as :
Code:
define config.font_replacement_map = ("fonts/RobotoCondensed-Italic.ttf", False, False)
But to be fair, I really wonder how Ren'py stored it. Plus, the line is so ridiculous and goes against all logic, therefore who would have guessed that it would be accepted by Ren'py.


And finally in the game, that shouldn't have this line (and the two after it), but
Code:
init python:
    config.font_replacement_map["fonts/RobotoCondensed-Regular.ttf", False, True] = ("fonts/RobotoCondensed-Italic.ttf", False, False)
as said in the documentation.
That is, is it more a mistake of the game developer or is it RenPy itself that in original form(before decompilation) calmly accepted such a structure? :unsure:
 
  • Like
Reactions: Right_Raven

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,299
15,166
That is, is it more a mistake of the game developer or is it RenPy itself that in original form(before decompilation) calmly accepted such a structure? :unsure:
It's both.
define statement is to declare a variable, while the dev used it to declare a dictionary key. If you want, it's like building a building. You don't decide to build one floor, then later decide to add a second, then later decide to add a third, and so on (what he did). No, you build it globally, so something like:
Code:
define config.font_replacement_map = { "Key": value, "key": value, [...] }
But, I guess that, like the majority of devs on the scene, he don't have a coding background and so didn't knew that it shouldn't works.

What lead to Ren'py fault, since it shouldn't accept such syntax as valid. But in the same time one of the advantage of Ren'py is its strength face to code mistake like this one.

What finally lead to un.rpyc fault, that shouldn't assume, neither try to guess, what is a valid syntax. As Postel's law say, "be conservative in what you do, be liberal in what you accept from others."
 

VepsrP

Well-Known Member
Modder
Dec 13, 2017
1,387
1,367
It's both.
define statement is to declare a variable, while the dev used it to declare a dictionary key. If you want, it's like building a building. You don't decide to build one floor, then later decide to add a second, then later decide to add a third, and so on (what he did). No, you build it globally, so something like:
Code:
define config.font_replacement_map = { "Key": value, "key": value, [...] }
But, I guess that, like the majority of devs on the scene, he don't have a coding background and so didn't knew that it shouldn't works.

What lead to Ren'py fault, since it shouldn't accept such syntax as valid. But in the same time one of the advantage of Ren'py is its strength face to code mistake like this one.

What finally lead to un.rpyc fault, that shouldn't assume, neither try to guess, what is a valid syntax. As Postel's law say, "be conservative in what you do, be liberal in what you accept from others."
Thank you for your detailed answer. (y) I think this is the rare case when permissiveness and ambition in programming led to someone else's headache. The person really made a cool game with music and special effects, but lost in the basic settings. And after all, it was a ride, the game works calmly.:unsure: Now I don't have to worry. Put the UnRen.bat in order, just in case, return the deobfuscation to the decompiler and wait for the next versions of RenPy and unrpyc.:)
 

VepsrP

Well-Known Member
Modder
Dec 13, 2017
1,387
1,367
And so. I added deobfuscation(although it is generally not necessary, but since it was originally, then let it be). Do not be afraid of the increased number of messages when decompiling each file, the main thing is that the word "successful" flashes in the whole pile. Also removed the unfortunate message about "creating rpatool" during decompilation. I hope this is the last modification for the near future.:WutFace:
Meet the UnRen.bat v0.9-Dev Modded by Gideon.v5
I love fives. As well as the nickname Gideon, which, due to some well-known reasons, I can not get on almost any platform:BootyTime:
 

yoyomistro

Engaged Member
Jan 15, 2017
2,765
3,549
And so. I added deobfuscation(although it is generally not necessary, but since it was originally, then let it be). Do not be afraid of the increased number of messages when decompiling each file, the main thing is that the word "successful" flashes in the whole pile. Also removed the unfortunate message about "creating rpatool" during decompilation. I hope this is the last modification for the near future.:WutFace:
Meet the UnRen.bat v0.9-Dev Modded by Gideon.v5
I love fives. As well as the nickname Gideon, which, due to some well-known reasons, I can not get on almost any platform:BootyTime:
Interesting saga man. Just a couple of questions. Did you base your version on Madeddy 's edited 10.1 version, or Sam's 0.9 version? Looks like Sam's based on the RPATool. Second, is your deobfuscation backwards compatible, or only for the newest version of Ren'Py? It looks like unrpyc was updated last month so just wondering if it was even necessary to use something different for deobfuscation.

Good work dude always interesting to see someone take a deep dive into the world of hacking tools, I'm content to wade around on the surface for the most part :LUL:.

EDIT: Also, why not name yourself @Gideon678 get an obscure biblical reference in and your name =P.
 

Madeddy

Active Member
Dec 17, 2017
814
468
Congratulation, you've found a bug, both in Ren'py, un.rpyc and the game.

In Ren'py, that should complain when it see this :
Code:
define config.font_replacement_map["fonts/RobotoCondensed-Regular.ttf", False, True] = ("fonts/RobotoCondensed-Italic.ttf", False, False)
...
What a find. Indeed. And a weird one also. I am jealous i think. You should have probably played in the lottery this week. :oops:
Anyway, this "dict object" looks really gruesome. As the dict 'value' I've seen everything, but this?
... As well as the nickname Gideon, which, due to some well-known reasons, I can not get on almost any platform
Huh? I do not get this one? Whats wrong with the name? Is this some english thing? A insider joke? :WaitWhat:

BACK to bug stuff: I get it nobody reported the bug(s) anywhere? Do/did you? Or should I?
 
Last edited:
5.00 star(s) 9 Votes