The company "Undo" and Microsoft have time travel debuggers that can do the recording side of the work. See if there is a way to leverage those.