Uncrypt RPA?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Message
Author
Amaku
Regular
Posts: 50
Joined: Thu Jun 19, 2008 9:35 pm
Contact:

Uncrypt RPA?

#1 Post by Amaku »

Hi! Ive got a problem, there are errors in my game and i have encrypted everything, how can i uncrypt the RPA package, please? Thanks

F.I.A
Miko-Class Veteran
Posts: 546
Joined: Wed Sep 21, 2005 10:49 pm
Projects: Winter Shard, EVE, Hyperion
Contact:

Re: Uncrypt RPA?

#2 Post by F.I.A »

Last I know, you cannot decompress the rpa once you archived it.

Your only option is to track back to the "Archived" folder created after archiving, edit its files then place back into the game directory and rebuild the archive.

EDIT: @ Gau_Veldt: The "cannot" is as in "not able to access it easily." Anyone with sufficient knowledge in archiving should be able to open it. :wink:
Last edited by F.I.A on Mon Aug 04, 2008 1:27 am, edited 2 times in total.
「通りすがりのメーカだ。覚えとけ。」

----------
Winter shard
Image
WIP: Hyperion(Trace unknown), ?????(Progressing)

User avatar
PyTom
Ren'Py Creator
Posts: 16122
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Uncrypt RPA?

#3 Post by PyTom »

If you have the archived directory, everything is there. Building the archive again includes stuff from the archive as well as the game directory.

If you don't have anything else, send me the rpa and I can extract it for you.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Gau_Veldt
Regular
Posts: 86
Joined: Tue Jun 10, 2008 8:22 pm
Location: Prince George, BC
Contact:

Re: Uncrypt RPA?

#4 Post by Gau_Veldt »

Amaku wrote:Hi! Ive got a problem, there are errors in my game and i have encrypted everything, how can i uncrypt the RPA package, please? Thanks
If you still have your game directory nothing is lost. Hopefully this is the case since undoing an RPA without the original files requires using parts of internal Ren'Py engine code to make a reverse-engineer of Ren'Py's loader. It can be done if you understand Python code and can look into Ren'Py's loader code. Any programmer would be able to read the loader code and have the obfuscation pretty much fall apart in doing so. The main key is Ren'Py itself has to be able to read the archive back in so that alone is the major cryptographic weakness. It's security by culture since anyone who publicly told you how to do so would get a big boo-hiss from the community here.

Morals of the story:

1. Don't ever delete your game directory.
2. If you put your social security number anywhere in a .rpa you may have your identity stolen.
Last edited by Gau_Veldt on Sun Aug 03, 2008 3:46 pm, edited 6 times in total.

Gau_Veldt
Regular
Posts: 86
Joined: Tue Jun 10, 2008 8:22 pm
Location: Prince George, BC
Contact:

Re: Uncrypt RPA?

#5 Post by Gau_Veldt »

F.I.A wrote:Last I know, you cannot decompress the rpa once you archived it.

Your only option is to track back to the "Archived" folder created after archiving, edit its files then place back into the game directory and rebuild the archive.
Depends on how you define 'cannot'. Ren'Py has to decompress the files in the archive to rerun the story after all.

User avatar
PyTom
Ren'Py Creator
Posts: 16122
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Uncrypt RPA?

#6 Post by PyTom »

Yeah. Since Ren'Py can open the file, so can anyone who's willing to spend the time to understand how Ren'Py works internally. It's made easier because Ren'Py is open source... but if you look at how many games people are able to reverse-engineer in order to translate, it's not hard even in the closed-source case.

That's why I'm careful to call it "archiving" or "obfuscation", rather than something like "encryption" or "protection". It'll keep casual people out, that's all.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Gau_Veldt
Regular
Posts: 86
Joined: Tue Jun 10, 2008 8:22 pm
Location: Prince George, BC
Contact:

Re: Uncrypt RPA?

#7 Post by Gau_Veldt »

PyTom wrote:Yeah. Since Ren'Py can open the file, so can anyone who's willing to spend the time to understand how Ren'Py works internally. It's made easier because Ren'Py is open source... but if you look at how many games people are able to reverse-engineer in order to translate, it's not hard even in the closed-source case.

That's why I'm careful to call it "archiving" or "obfuscation", rather than something like "encryption" or "protection". It'll keep casual people out, that's all.
I wrote a uncooker myself just to serve as a Mythbusters-style reminder about the myth of "security by obscurity". Took about 15 minutes of mythbusting to get a working unrpa.rpy. Myth of security by obscurity: Totally BUSTED.

Amaku
Regular
Posts: 50
Joined: Thu Jun 19, 2008 9:35 pm
Contact:

Re: Uncrypt RPA?

#8 Post by Amaku »

Thanks! I didnt realize the "Archive" folder was there ^^U Sorry for the trouble

WinKi
Newbie
Posts: 24
Joined: Thu Jun 14, 2007 12:50 am
Contact:

Re: Uncrypt RPA?

#9 Post by WinKi »

Hello. Some people here probably heard about our little Windows GUI toolkit called AnimED. It's written in a pure Object Pascal (no dynamically linked dlls or whatsoever). Current 0.6.8.406 build includes RPA 3.0 extraction support. It was hard to reimplement pickle behavior, but we did it. No repacking yet though.

P.S. The current build is known to correctly unpack the following titles:

* Higurashi Fun 1.0
* Katawa Shoujo: Act 1
* SFK Vol.1
* SFK Vol.3
* TFQ 1.7

Please see compatibility list for details.

P.P.S. Speaking about the legality - it's completely legal to create additional tools for Open Source engine. If you want your data to be protected and secure, do not use Open Source engines AND Open Source algorithms. Furthermore, if you DON'T want your code to be spreaded into public, forget about the Internets, seriously.
Last edited by WinKi on Wed Nov 25, 2009 10:15 am, edited 9 times in total.

User avatar
mugenjohncel
Hentai Poofter
Posts: 2121
Joined: Sat Feb 04, 2006 11:13 pm
Organization: Studio Mugenjohncel
Location: Philippines
Contact:

Re: Uncrypt RPA?

#10 Post by mugenjohncel »

Unpack... RPA... packs?... :shock:

Now this I got to get my hands on this... so I can finally crack open "Final Week's" RPA files and steal err... I mean figure out how he did that quick save quick load thing...

So umm WinKi my friend... is this well... you know... already available?...

I swear on samu-kun's someone else's grave I won't use it for evil purposes... really (Puppy eyes)

"POOF" (Disappears)

User avatar
Samu-kun
King of Moé
Posts: 2262
Joined: Mon Sep 03, 2007 3:49 pm
Organization: Love in Space Inc
Location: United States
Contact:

Re: Uncrypt RPA?

#11 Post by Samu-kun »

...just the sort of slimy business you'd have your hand in, Mugen...

Well... At least the law protects our assets... even if programming doesn't.

User avatar
killdream
Veteran
Posts: 325
Joined: Wed Nov 05, 2008 1:05 pm
Projects: EVūL (WIP), insilo (WIP), Cute Demon Crashers!
Deviantart: robotlolita
Github: robotlolita
Location: World's End (aka Brazil)
Contact:

Re: Uncrypt RPA?

#12 Post by killdream »

@WinKi:
Let me see... you're writing a graphical tool entirely in Object Pascal, which is a compiled language and takes more time to get something done than Python, to unpack Ren'Py's RPA files...

I wrote a script back in the time of Ren'Py 6.6.x that did the same thing, importing the internals of the engine, and it took 10 lines of code. Well, there's the blank lines and the code to force the directory structure when unpacking, imports and such, that I didn't count. But even so, the entire script is 30 lines of code.

@Mugen
Well... if you're talking about source code, the RPA files don't store them. But quick-saves and quick-loads are simple enough to do.

Code: Select all

label quick_save:    
    python hide:
        renpy.take_screenshot()
        # will save the current state on the "quicksave" file. This will overwrite any previous quicksaved game, of course                
        renpy.save("quicksave", extra_info=store.save_name)

label quick_load:
    python hide:
        # if we have some quicksaved game, we'll load it, otherwise this will do nothing
        if renpy.can_load("quicksave"):
                renpy.load("quicksave")

    return

Vendor_Honyaku
Regular
Posts: 30
Joined: Thu Apr 09, 2009 8:31 am
Projects: Honyaku-Subs translations
Location: Russia, Novosibirsk
Contact:

Re: Uncrypt RPA?

#13 Post by Vendor_Honyaku »

Great job, WinKi!
I wrote RPA-unpacker for translation projects, but it require Ren'Py. Your standalone tool is really great.
if you're talking about source code, the RPA files don't store them
Hmm, if we can unpack RPA-archive, we can find rpyc (and maybe rpy).
Next, rpyc is basically compressed with zlib. After extraction we can see code, fairly close to source (yes, some expression will be lost, but it's can be enough for analysis).
The bear looked on the car, and there was a wild gleam in his eyes. He knew what to do.

F.I.A
Miko-Class Veteran
Posts: 546
Joined: Wed Sep 21, 2005 10:49 pm
Projects: Winter Shard, EVE, Hyperion
Contact:

Re: Uncrypt RPA?

#14 Post by F.I.A »

WinKi wrote:* SFK Vol.1
* SFK Vol.3
As far as I know, the two mentioned titles are commercials only. And last I heard, they are not open-source.
P.P.S. Speaking about the legality - it's completely legal to create additional tools for Open Source engine. If you want your data to be protected and secure, do not use Open Source engines AND Open Source algorithms. Furthermore, if you DON'T want your code to be spreaded into public, forget about the Internets, seriously.
I guess that's explains why there are plagiarisms on even open-source engines like M.U.G.E.N. Because there are those with enough time to mess with others' timeless efforts. If there isn't any rpy file lying in the game, give the maker a piece of mind, seriously.

Vendor_Honyaku wrote:Hmm, if we can unpack RPA-archive, we can find rpyc (and maybe rpy).
From what I know, rpyc files tend to be separated from rpa to allow re-patching. If there are rpy files in the rpa, it wouldn't allow any possible update to game itself.
「通りすがりのメーカだ。覚えとけ。」

----------
Winter shard
Image
WIP: Hyperion(Trace unknown), ?????(Progressing)

JinzouTamashii
Eileen-Class Veteran
Posts: 1686
Joined: Mon Sep 21, 2009 8:03 pm
Projects: E-mail me if you wanna rock the planet
Location: USA
Contact:

Re: Uncrypt RPA?

#15 Post by JinzouTamashii »

F.I.A wrote:If there isn't any rpy file lying in the game, give the maker a piece of mind, seriously.
I don't understand what this means.
F.I.A. wrote:From what I know, rpyc files tend to be separated from rpa to allow re-patching. If there are rpy files in the rpa, it wouldn't allow any possible update to game itself.
You can make a patch for a released game? That's news to me.
Don't worry, we can get through it together. I didn't forget about you! I just got overwhelmed.
https://cherylitou.wordpress.com

Post Reply

Who is online

Users browsing this forum: No registered users