How can I access all bytes of RAM and ROM of my computer?

前端 未结 3 1803
名媛妹妹
名媛妹妹 2021-01-22 08:53

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

相关标签:
3条回答
  • 2021-01-22 09:40

    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

    0 讨论(0)
  • 2021-01-22 09:41

    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.

    0 讨论(0)
  • 2021-01-22 09:43

    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

    0 讨论(0)
提交回复
热议问题