Search code examples
c#c++assemblyilunsafe

Dump a process memory to file / recreate process from dump file


Just curious, maybe someone knows a way:

Is it possible, while having an opened process (app domain), dump its entire memory space to a file, send it by wire to a LAN workstation and recreate the process as it was on the first computer.

Assumptions:

  • the application exists on both computers;
  • the process is not creating any local settings/temporary files;
  • the OS is the same on both computers;

Solution

  • If you want to do so, you have to ensure you have the same environment to run the "dumped" process. Some of them:

    • You have to provide the same handles with the same state (process, threads, file, etc.)

    • The new environment must have the same memory addresses allocated (including runtime allocations) as previous had

    • All the libraries must be initialized and put in the same state

    • If you have some GUI interface even GPU must be in the same state (you have to preload all graphic resources etc.)

    • And many more stuff to take care about.