r/AskReverseEngineering • u/myrobozim • Sep 07 '24
How to decode a savefile?
I have a binary save file (read with a hex code reader) and need to decode it to a human understandable file… how to do so?
0E E2 48 1F 1A, for example.
3
Upvotes
6
u/khedoros Sep 07 '24
A save file can be arbitrary data, and how it's interpreted depends completely on the game's code.
Getting more specific, you'd have to talk about a specific game. The situation could be anything from "Hey, cool, this is unobfuscated json" to "The developer encrypted the save for some reason. And unencrypted, it's a binary dump of a bunch of engine-specific structs. Let's pull out ghidra."
2
u/shrolkar Sep 08 '24
Any idea what engine it uses? The devlog #2 (discussing porting to Android) leads me to believe it's written without a brand name engine, as shifting to a different target platform in most frameworks is pretty straightforward - and this doesn't seem to be the case.
If it's unity or similar there's a good chance of a standard format for save files.
I'm assuming you've already run "strings" over it? Any plaintext?
If you've poked at the save file and haven't found anything human-readable are you comfortable with a debugger? I'd put a breakpoint on a write call and then see if I can look at traceback to find a function call with a name relating to marshalling data. This would let you get a sense for what to look for within a disassembler/decompiler.