2

I'm playing the PC game Per Aspera with Steam, and attempting to edit a save. When I opened a .save file in the SaveGames folder with Notepad++, the text had some recognizable words, but most of it is random unknown characters.

Below is a sample of the text, and an image of what it looks like in Notepad++. The file has over 26,000 lines.

I'm assuming the file is using some encoding I'm not familiar with, or needs to be opened in a program other than Notepad++. How can I open this file so it's readable by a human and I can make edits?

Lines 9-12. All code blocks are a single character in Notepad++

{9} ÄúÅ NAKDLE E DC2 SI
{10} øöéÄ NAK ô ENQ E GS I SUB DC1
{11} SI resource_crater% NUL NUL €?5×£dB@ NUL H NUL P NUL X SOH NUL mZ NUL DLE 1Q NUL DC1 ETX Q NUL DC1 ETX Q NUL €.ƒMÅ NAK “[ Q NUL ïR ¿D NAK _†ÿD GS GB J VT ÅQ NUL ACK 0\jQ NUL FS SOH Q NUL DC1 EOT Q NUL ÿ
{12} <G%Ä NAK RQùD DC2 SI

.save file opened with Notepad++

7
  • 2
    I doubt it can be recognized based on the interpretation of the characters in Notepad++ alone, and, even then, it would not be on topic here, as it is about opening a computer file.
    – Joachim
    Feb 1 at 23:34
  • 9
    I’m voting to close this question because it is about opening a seemingly arbitrary file.
    – Joachim
    Feb 1 at 23:35
  • 1
    If you wanted to edit a specific in-game value (like how much money you have), you could potentially open it with a hex editor, look for that value in various formats, cross-reference that with a save with a different value to eliminate duplicates, and then just change it (but back it up first). That's basically the same approach one can use to edit the values in-memory for a running game. But that isn't guaranteed to work and requires a decent amount of advanced computing knowledge to do.
    – NotThatGuy
    Feb 2 at 14:30
  • 6
    I don't think you understand just how much work could be involved in answering this question fully (except by one of the game developers). If you want a peek into what it takes, a good search term is "reverse engineering". Here's a very entertaining post reverse engineering a very simple (!) format for a game from the 80's that should give you a bit of an idea how much more work it is to even know the answer than it is to write the answer. Feb 2 at 15:51
  • 2
    What's your end goal here? If you just want to edit variables in game (like gold or whatever) you might have better luck with a programme like Cheat Engine.
    – Showsni
    Feb 2 at 22:50

2 Answers 2

24

Short answer:

You can edit the file using a "hex editor", but you can't make it human-readable.

Long answer:

This is a binary file. It means that every byte in that file is supposed to be interpreted as a byte, as opposed to a human-readable character. For example, the first 15 characters in the first line in your screenshot:

NUL NUL NUL BS NUL DLE   SUB ENQ 2 9 6 5 8 8

represent the following 15 values:

0 0 0 8 0 16 32 26 5 50 57 54 53 56 56

Notepad++ is interpreting those values as if they represented text. But since this isn't a text file, you only get gibberish. The readable words, on the other hand, are actual text embedded within the file.

Binary files are typically edited in what is known as a "hex editor". It's the only way to write values that represent non-printable characters, such as any value below 32 (whitespace), among others. Unfortunately, a hex editor won't make the file any more readable. Nothing will. After all, what does the first 0 in the above example stand for? Do the first 4 values together represent a single 32 bit integer? Or do they form a 32 bit float? No general-purpose software can tell you that, much less what it'll affect in the game.

You will need to either gain access to the game's code, or reverse engineer it, if you want to make sense of this file. If you can't do either, you'll have to wait for someone else to do it and release a save editor for this game.

Note that you should always keep a backup of the save file before attempting any edits yourself. Some games may include some form of integrity check (such as a hash) to check for tampering (cheating) or file corruption (e.g. incomplete save due to unexpected crash), or you may accidentally enter an invalid value, causing the game to flag the file as corrupt.

3
  • 12
    One relatively simple form of reverse engineering is to make a copy of the file, then go and for example collect some item or do some quest, then make another copy of the file, then analyze what is different between the two files. (Not that it's trivial but at least it is an easy idea to understand)
    – user253751
    Feb 2 at 19:27
  • 1
    @user253751 Technically possible but especially in simulation-type games where all sorts of things continue to happen with every tick of the clock the list of changes tends to be too big to get anything useful out of unless you first earmark some values that look promising then check if they've changed -- assuming they're even still there.
    – Shadur
    Feb 3 at 8:13
  • 1
    @Shadur yes, it is quite dependent on the game. Not all games will be easy to reverse-engineer that way. I just wanted to give a brief demo of what reverse-engineering means.
    – user253751
    Feb 3 at 19:05
6

This is a binary or encoded file.

Basically, it's written in a way that only something that has a decoder for that specific format will be able to read. Really, I'm surprised that there are a few readable words in there.

Try opening an image with Notepad++, it will look not far off. And its just that image showing programs know how to take that mess and figure out an image out of it.

So except if someone developed a save file editor for the game you are currently playing, there is no way to humanly modify that file. If you change even 1 letter of this mess, your save file will be lost.

But why is it like that? Well, my guess is that developers usually don't like you editing the file and giving you weird, probably untested states of the game. But that is not much more than a guess on my part.

8
  • 2
    The "readable" words might have trickled through, or it could be intended. It might be a custom file format that only the game is capable of decoding. It reminds me of a portable executable format where there is a DOS Stub that you can find to this day in many files of this executable format, like so: i.stack.imgur.com/sh8Xp.png
    – Timmy Jim
    Feb 2 at 4:25
  • 8
    "compiled" is the wrong word here. Generally you'd say it's "encoded in a binary format", where "binary" just means an arbitrary, non-text encoding. Feb 2 at 7:47
  • 12
    The simplest way to write data to a file is actually to not make it human-readable: you just directly dump some object in memory to file. Making it human-readable requires a bit more work, making it human-editable requires even more work (since you need to verify the data being read in), and it makes the file a bit bigger (but that part is usually negligible for save files, given how small they are). It isn't part of the intended gaming experience for people to edit their save files, so there's little reason to provide this functionality.
    – NotThatGuy
    Feb 2 at 13:52
  • 3
    @TimmyJim Many of the readable strings in binary files would be there because that's just part of whatever binary data they wanted to store (or because it's noise). If you dump some amount of numbers and some amount of strings to file, those would just all be squashed together, the numbers would be gibberish, while the strings may already be in a format that text editors can display.
    – NotThatGuy
    Feb 2 at 14:03
  • 2
    @murgatroid99 Dumping an entire section of memory might well not be possible, but it's far easier to save and load the memory representation of an integer, or even a variable-length list of integers, than to convert it into an equivalent text representation. Most binary file formats don't have a formal "serialization scheme", just ad hoc instructions for how to pack and unpack a stream of bytes, as in this documentation of part of the legacy Microsoft Word format.
    – IMSoP
    Feb 2 at 22:54

Not the answer you're looking for? Browse other questions tagged .