What's new

how to decrypt file .rvdata2


JustLurksHere

Jungle Girl
Joined
Oct 28, 2016
Messages
558
Reputation score
45
:rolleyes: ...the ignorance. As if this wasn't addressed dozens of times on this forum.

Just google 'ruby marshal format'. The only trick is to provide class definitions for relevant RPG Maker classes.
 

habisain

Tentacle God
Joined
Jul 15, 2012
Messages
1,447
Reputation score
465
The actual question in the post isn't too bad, actually. You can convert the files to JSON with Ruby by unmarshalling them, then with 'require json' and then using the 'to_json' method of the unmarshalled file.

However, I once tried to do this with RPGMaker Trans back in the day, and big files can break Ruby's JSON-ifier unless you have huge amounts of RAM. I'd go for the answer in general being "In theory this can be done, but in practice no".
 

JustLurksHere

Jungle Girl
Joined
Oct 28, 2016
Messages
558
Reputation score
45
@habisain: The thing is going from marshal data to json is nearly trivial (after you load the data, that is), going back is not so.
For all of psych downsides and edges, you're still better of with YAML.

That rvpacker thing on github for all its bugs is actually pretty decent, that is if you don't hit one of those bugs.
Just a few relatively minor tweaks improve its coverage significantly.
 

habisain

Tentacle God
Joined
Jul 15, 2012
Messages
1,447
Reputation score
465
@JustLurksHere: Actually, I tried JSON after using a few YAML dumpers. Now, I did try this about 8 years or so ago, so it's entirely possible that the issues I encountered have been fixed. But certainly with some games with large files, I was running into both extreme memory usage and extremely large output in both YAML and JSON; I'm not sure exactly what the causes were, but I'd guess that some of the binary data types were quite inefficiently represented in JSON/YAML.

Incidentally, rvpacker seems to be a dead project so this perhaps isn't something to push to the devs there, but there might be easy ways to increase game coverage to perfect. I wrote for RPGMaker Trans which will unmarshal anything (by inspecting the errors of Marshal.load and dynamically generating stubs until Marshal.load succeeds). If someone wrote a similar thing for YAML/JSON loading, you'd have a perfect Ruby Marshal<->YAML/JSON converter.
 

JustLurksHere

Jungle Girl
Joined
Oct 28, 2016
Messages
558
Reputation score
45
@habisain: if you want to argue that way, technically ruby makers are dead projects as their upstream no longer develops them and even the latest internally uses a version of ruby that's been EOL for over 6 years.

As for your code, that was one of the issues I was talking about, though I partially cargo-culted a slightly different method, a slightly extended version of 'Object.const_get($1[0..i-1]).const_set($1[i+2..-1], Class.new)'. Of course, both of our ways only work if the missing class doesn't require user-defined marshaling method.
 

habisain

Tentacle God
Joined
Jul 15, 2012
Messages
1,447
Reputation score
465
@JustLurksHere What I meant was that if either of us tries to submit our improvements to rvpacker, we probably won't get a response as Github shows that project as being not updated in many years. Of course all of RPGMaker XP/VX/VXAce are pretty much dead projects at this stage.

Incidentally, my method does work with user-defined marshaling, albeit with the caveat that you can't see inside user-marshaled classes. My Ruby-fu isn't anywhere near good enough to come up with the one-liner you gave, but I make up for a lack of Ruby knowledge with persistence. Also, for various legal reasons, specifically the Oracle-Google "Can I copyright an API?" case, I didn't want to include the RPGMaker Stubs inside RPGMaker Trans, as that would potentially open me up to DMCA'ing. So I kind-of needed the ability to handle user marshaled classes as they're present inside vanilla RPGMaker.
 

JustLurksHere

Jungle Girl
Joined
Oct 28, 2016
Messages
558
Reputation score
45
@habisain: my ruby-fu ain't that good either, it's more from my google-fu and combining various snippets.

As for the Unholy Trinity of Copyright, Trademark and Patent, for all the crime against humanity they currently are, you'd likely need at least several million people to get a positive change there - after all, even the pandemic didn't do it.
 

habisain

Tentacle God
Joined
Jul 15, 2012
Messages
1,447
Reputation score
465
@habisain: As for the Unholy Trinity of Copyright, Trademark and Patent, for all the crime against humanity they currently are, you'd likely need at least several million people to get a positive change there - after all, even the pandemic didn't do it.
Well, don't be so pessimistic on that front. The 2021 ruling on the Google-Oracle case found that fair use covered Google's use of Java APIs, circumventing the lower court judgements. There is some positive change there. Not enough, but some.

Also this wasn't on topic, but I do feel the need to spread good news where possible.
 

JustLurksHere

Jungle Girl
Joined
Oct 28, 2016
Messages
558
Reputation score
45
Actually, originally that judge has ruled it's not copyrightable (as it shouldn't be), but the more corrupt higher court has overturned that. And that's the point - the higher it gets, the more corrupt it is, till it gets to the level of Evil Empire's Supremely Corrupt Court. The Unholy Trinity is just in my opinion most blatant and long term most damaging example, but there are many other laws that sort of work on a small scale in very narrow applications, but once you start generalizing away, often become harmful to things they purportedly protect. And that's if they aren't simply badly disguised power grabs.

(also, I'd argue that while a digression, it was something that needed saying)
 

nano1111

New member
Joined
Jan 16, 2023
Messages
1
Reputation score
0
:rolleyes: ...the ignorance. As if this wasn't addressed dozens of times on this forum.

Just google 'ruby marshal format'. The only trick is to provide class definitions for relevant RPG Maker classes.
im sorry but can you tell me how to use marshal to convert rvdata2
 

JustLurksHere

Jungle Girl
Joined
Oct 28, 2016
Messages
558
Reputation score
45
That's some impressive grave digging here.

Anyway, as long as you have the class definitions and a ruby interpreter, loading a marshal blob is as simple as:
Ruby:
def self.load_data_file(file)
  File.open(file, "rb") do |f|
    return Marshal.load(f)
  end
end
The trick lies in having those definitions. As I've said, rvpacker is a decent starting point. Though besides the standard RGSS classes it only has a fixed list of some more common RPGMaker classes (see ). A better solution is to have an exception handler that tries a trivial class definition - it works in most cases.

Once you have the object loaded, you can - for example - dump it as yaml, edit that and load the edited yaml. That's roughly like rvpacker is meant to be used.

Though rvpacker could use quite a bit of polish. Also, I'm not sure if some of the changes made in ruby 3.2 (removing the old Integer classes) made using new interpreter tricky.
 
Top