That is not how modern operating systems work.
You cannot simply read out the systems ram, because applications memory is virtualized and also the OS prohibits direct access due to security policies.
The OS may offer some API to access other processes memory (assumed you have the rights to do). On Win32Api this is ReadProcessMemory
.
May be some other OS API allows the direct read out of the systems address space.
You may dig into How do you read directly from physical memory?
2
solved C Pointers to scan memory