The mem file provides access to the computer's physical memory. All byte addresses in the file are interpreted as memory addresses. Thus, memory locations can be examined in the same way as individual bytes in a file. Note that accessing a nonexistent location causes an error.
kmem- provides access to kernel virtual memory
The kmem file is the same as mem except that it corresponds to the kernel virtual memory rather than the computer's physical memory.
In rare cases, the mem and kmem files may be used to write to memory and memory-mapped devices. Such patching is not intended for the naive user and may lead to a system crash if not conducted properly. Patching device registers can lead to unexpected results if the device has read-only or write-only bits.