How can I retrieve files cached in the RAM?
Run sysdiagnose on the process ID and look over the leaks and allmemory commands to get a feel for the syntax. You will need to know a lot about the data structures for this to be feasible. With that, you can drop the program into the debugger and dump the required data structures to screen.