I understand everything is a flat file in Linux. How hard is it to dump the contents of the main memory into a flat file? Does it already exist in Linux? If yes, what's the path to the file? What are the default permissions?
2 Answers
/dev/mem is probably what you are looking for, this file is manipulated like any other device file with dd and other utilities.
Permissions on my Debian linux system are:
crw-r----- 1 root kmem 1, 1 Aug 21 09:31 mem
kcore is (should be) an exact copy of what is running in memory.
cat /proc/kcore
should be readable by everyone.
-
On my system it's
-r-------- 1 root rootMichael Mrozek– Michael Mrozek2011-09-12 13:22:48 +00:00Commented Sep 12, 2011 at 13:22 -
2It had better not be readable by anyone but root, since it allows snooping on the memory of every process.
/proc/kcoreon Linux is readable only by root. Also,/proc/kcoreis the kernel's memory mapping;/dev/memis the physical RAM.Gilles 'SO- stop being evil'– Gilles 'SO- stop being evil'2011-09-13 06:47:17 +00:00Commented Sep 13, 2011 at 6:47