Any chance of hacking Glulx save file to change variable?

Another player got bitten by a soft lock in Counterfeit Monkey, and this time they provided a save file:

I understand that this is pretty hopeless, even if the save file had been smaller than 78 kilobytes, but still: If I were to start changing random values in the save file, is there any particular part which is more likely to store global variables, where I should concentrate my efforts?

The soft lock is caused by this condition never becoming true:

Attempting entry ends when entry-attempt-timer is greater than 0
and time since Attempting entry began is greater than entry-attempt-timer

So we would need to change either the entry-attempt-timer global variable, or the current time, or the time when the scene “Attempting entry” began.

Changing the save file directly is going to be a major headache.

If you start the game and load in the save file, then adjusting variables in interpreter memory is “easy” – if you know where they are. The gameinfo.dbg file generated while compiling will contain this information.

Okay, I say “easy”, but interpreters are not normally built to allow you to perform these memory hacks. So you’d first have to modify an interpreter to allow it.

1 Like

To clarify: the save file contains a snapshot of memory, but it’s compressed. So to edit it, you’d have to uncompress it, make changes, and then recompress it. The only practical way to do this is to let the interpreter do it.

1 Like

Thanks! Challenge accepted.

I think I did it.

1 Like

It’s been awhile, but you should be able to run a glulx story in the c# version of fyrevm within visual studio in debug mode and modify whatever you need to.

1 Like

This was actually caused by a pretty devious Inform 7 time bug. I’ll make a new topic about it.