Saving and reloading application RAM state?

I

Industrial One

Is it possible to save the RAM dump of an application and reload it so
you can get the exact state of it the next time you open it? E.g.
you're playing a game with no save feature and you're in the middle of
it but you gotta restart your computer.

It seems to me that it isn't as simple as editting/copying/pasting the
RAM with a hex editor. Any application like this out there for Windows
XP? http://www.jaryba.com/ looks sweet but it's only for Linux, and I
need to save state now.
 
P

pjp

Industrial One said:
Is it possible to save the RAM dump of an application and reload it so
you can get the exact state of it the next time you open it? E.g.
you're playing a game with no save feature and you're in the middle of
it but you gotta restart your computer.

It seems to me that it isn't as simple as editting/copying/pasting the
RAM with a hex editor. Any application like this out there for Windows
XP? http://www.jaryba.com/ looks sweet but it's only for Linux, and I
need to save state now.


Run a virtual machine comes to mind. Can save state and restore the virtual
environment easily.
 
P

Paul

Industrial said:
Is it possible to save the RAM dump of an application and reload it so
you can get the exact state of it the next time you open it? E.g.
you're playing a game with no save feature and you're in the middle of
it but you gotta restart your computer.

It seems to me that it isn't as simple as editting/copying/pasting the
RAM with a hex editor. Any application like this out there for Windows
XP? http://www.jaryba.com/ looks sweet but it's only for Linux, and I
need to save state now.

The best idea I can come up with on short notice is:

1) Hibernate the computer. This writes the current session out to disk.
(I.e. We're copying entire system state, not just one game.)

2) Once the computer is shut down, remove the hard drive and clone the
drive to a second disk. Also, while doing the cloning, record the
VolumeID of the partitions on the original disk. You can put them
back with VolumeID from Sysinternals, before using the disk the next
time. Try to restore the correct VolumeIDs on each partition, before
booting from a re-cloned copy.

3) By having one disk as a "snapshot" of the saved game, you can
go back to that point in time. You copy the disk back to the original
disk, and after having put the system in hibernate, switch disks on
the system, so that when it comes out of hibernation, it'll bring up
the old (saved) computing session, game and all. If you're careful
to check the VolumeIDs, that will help maintain consistency. As well,
the hard drive has a hardware serial number, and you should always
clone back to the original drive. That is so, when the system comes
out of hibernate, it won't see any hardware serial number changes either.

I haven't tested this, and can't promise what the side effects would be.
In any case, on the first true reboot, don't have a freshly cloned disk
and the original disk in the computer at the same time (two identical looking
disks). Once a cloned disk has been booted once by itself, it should be
safe to mix and match with the other disk(s).

The motherboard and BIOS, keep track of ACPI state, when the
computer is shut down. I think the hiberfile effectively does
as well, which is why, if you were to shut off the computer
completely (losing state in the Southbridge), it's still possible
for the hiberfile to get loaded at boot time (instead of fresh
booting). Something in the system (maybe the OS boot loader), knows
when the hiberfile contents are valid. You can lose power, and
you're supposed to be able to recover from the hiberfile.

Hibernation, was designed to save the state of all the programs,
and also covers issues of restoration of hardware card state. For
example, if you were attempting to store a game, not only would
you need to store the code and data segments of the program, you'd
also have to store the texture RAM on the video card, and restore
the GPU to its previous state. Hibernation does this for everything,
while attempting to save just one program, would mean still having
to do most all of the work that is done during hibernation. As a result,
it's just easier to use hibernate as a solution.

Paul
 
I

Industrial One

Paul, I already know about hibernate and use it. Problem is, sometimes
I am forced to restart because my OS is so buggered up that it
eventually becomes unresponsive and slow after about 20 hours of
uptime. Besides, I don't wanna save state of the entire system, just
one tiny program.

Run a virtual machine comes to mind. Can save state and restore the virtual
environment easily.

I notice virtual machines are very popular today and pardon me if I'm
either getting too ****ing old/out of touch but wouldn't that require
installing a completely new Windows installation? I just wanna save
the state of one tiny program and am not willing to go thru that much
trouble.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top