I tried pointers and reference(&) but when I try to get the info(I am only reading from memory) computer \"beeps\" and program terminates. NO problem when assigning a pointe
This should help me:
typedef struct _MEMORY_BASIC_INFORMATION {
PVOID BaseAddress;
PVOID AllocationBase;
DWORD AllocationProtect;
DWORD RegionSize;
DWORD State;
DWORD Protect;
DWORD Type;
} MEMORY_BASIC_INFORMATION, *PMEMORY_BASIC_INFORMATION;
and this:
VirtualQueryEx(
HANDLE hProcess,
LPCVOID lpAddress,
PMEMORY_BASIC_INFORMATION lpBuffer,
DWORD dwLength
);
at least in my OS thanks Bo Persson and Jerry Coffin or Mysticial
You can't. Modern OSes use virtual mode and memory protection which don't permit this. To access all physical RAM, you'll most likely need to write your own OS or a kernel driver for an existing OS.
You can not do this, because you have not privilege to do, when you run your code, it creates a process to run your program, and each process can only access to its address space, access to others process address space make a trap to os, and your kernel suspends works and checks your stack and your process, then it find that you did an unprivileged task, and then it kills your process