Page 1 of 2

It's not a DM game without people attacking the save files

Posted: Mon Apr 16, 2012 12:09 am
by seebs
So, save files. What are they? Quick scanning shows character names aren't present in cleartext, and files contain a suspiciously even spread of byte values -- so they're compressed or encrypted, presumably. First few bytes look like a header:

x000000 47 52 49 4d 04 00 00 00 85 c5 0e 00 78 9c ec bd 'GRIM........x...'

If I add a single map note, the save file gets almost 2KB bigger, and the header changes to:

x000000 47 52 49 4d 04 00 00 00 81 c2 0e 00 78 9c ec 7d 'GRIM........x...'

I'm assuming that the 04 is a version tag or something similar. None of these look like length values for the save, and it's not immediately obviously IFF or zlib (the two things I look for first). In any event, I see no zlib stuff. I do note the game's got embedded Lua in it, which suggests that you could have a ton of fun if you could find a script console. :)

Re: It's not a DM game without people attacking the save fil

Posted: Mon Apr 16, 2012 12:19 am
by germanny
Ah :) Thats the first thing i do after first play, open up a save in Hexeditor : D
Console?
SpoilerShow
spawn items from console works fine^^


you may search this topic:
viewtopic.php?f=3&t=905

Re: It's not a DM game without people attacking the save fil

Posted: Mon Apr 16, 2012 1:53 am
by seebs
Super handy. I now have pretty good debugging tools for it.

Re: It's not a DM game without people attacking the save fil

Posted: Mon Apr 16, 2012 2:33 am
by Krotch ScroteGuzzle
Is this possible on Steam? Or do they save the files to Steam Cloud?

Re: It's not a DM game without people attacking the save fil

Posted: Mon Apr 16, 2012 4:07 am
by seebs
Krotch ScroteGuzzle wrote:Is this possible on Steam? Or do they save the files to Steam Cloud?
No clue. Haven't gotten anywhere on the save files, but I have some nice debugger console stuff now.

Re: It's not a DM game without people attacking the save fil

Posted: Mon Apr 16, 2012 4:56 am
by Loktofeit
Krotch ScroteGuzzle wrote:Is this possible on Steam? Or do they save the files to Steam Cloud?
If it is saving to the cloud, you can turn that off and it will save the files to your Documents folder ( drive:\Users\username\Documents\Almost Human\Legend of Grimrock )

Re: It's not a DM game without people attacking the save fil

Posted: Mon Apr 30, 2012 2:50 am
by Dej
x000000 47 52 49 4d 04 00 00 00 81 c2 0e 00 78 9c ec 7d 'GRIM........x...'

I'm assuming that the 04 is a version tag or something similar.
The 04 after the "GRIM" keyword is in fact the size of the segment data. That size is encoded as a 32-bit word in little-endian and will be the same on all save files: 04 00 00 00.

The segment data is therefore the next 32-bit word (at offset 8). It is also a size, and also little-endian. It is the size of the uncompressed zlib data. In the example above 81 c2 0e 00 --> 0x0EC281 = 967'297 bytes.

Following that is the zlib data. The first 16-bit word (offset 12) is the zlib data header. It will not change from one save file to the other: always 0x789C (which corresponds to a standard zlib compression). Following that is the compressed data.

Re: It's not a DM game without people attacking the save fil

Posted: Mon Apr 30, 2012 9:56 am
by kitty
OK, lets try to look at this problem from the other side. From the point of view of dungeon designer.

Imagine a situation that your dungeon is based on "Im missing this item" or some dungeon setup - for example locked mapping. Wouldnt be better if such files as savegames and *.dat files were not only compressed but also passworded? I know this is hard to accomplish to hide password. Because everytime there will be someone who will crack that.

There must be a way how to prevent ruining user created dungeons with spoiler free highway.

Re: It's not a DM game without people attacking the save fil

Posted: Mon Apr 30, 2012 2:38 pm
by zalewapl
kitty wrote:OK, lets try to look at this problem from the other side. From the point of view of dungeon designer.

Imagine a situation that your dungeon is based on "Im missing this item" or some dungeon setup - for example locked mapping. Wouldnt be better if such files as savegames and *.dat files were not only compressed but also passworded? I know this is hard to accomplish to hide password. Because everytime there will be someone who will crack that.

There must be a way how to prevent ruining user created dungeons with spoiler free highway.
Yeah. Disregarding the fact that this is the worst idea I've ever seen, how would the game launch the dungeon if it was passworded? You would have to provide the password or no game for you.
kitty wrote:There must be a way how to prevent ruining user created dungeons with spoiler free highway.
If someone wants to cheat in a single player game then let them.

Re: It's not a DM game without people attacking the save fil

Posted: Mon Apr 30, 2012 3:09 pm
by kitty
The idea was about password hidden in the game. So only application can read that file. Technically what i was suggesting was encryption instead of only zipping. Encryption is known system. Im sure everybody knows or at least heard about it.
zalewapl wrote:If someone wants to cheat in a single player game then let them.
As long as such a cheater is not ruining dungeon with spoilers on public forums.