Thread: Reading physical memory

  1. #1
    meatpuppet
    Guest

    Reading physical memory

    I am trying to access/read information from an SMBIOS table. The documentation indicates that the info is located within 000F0000h - 000FFFFFh.
    How do access this memory area to read it?

  2. #2
    Evil Member
    Join Date
    Jan 2002
    Posts
    638

    What OS?

    Depending on your OS, you might not be able to.

    WinXP and some other dozes have the "feature" of cutting off your ability to directly access your own hardware and memory. If you are able to access memory, simple cast the byte address to a pointer. (char* is better because it addresses one byte)

  3. #3
    meatpuppet
    Guest
    I need to run the program under both win95 and w2k.

    To cast the pointer - something like this?

    char ptr;
    ptr=000f0000h;


    or am I WAY off base here?

  4. #4
    Evil Member
    Join Date
    Jan 2002
    Posts
    638

    I think 2k is one of the flat addressing ones, but

    char* ptr = (char*) 0x000f000;

    ought to do it. Make sure you include the cast, as it won't implicitly cast from an integer to a pointer.

    Also, don't write to it. Don't even try.

  5. #5
    meatpuppet
    Guest
    When looking at the pointer in Debug mode, it gives me a "Cannot read from location 0x001B:0x000F0000" error. If I try to look at the raw memory it points me off somewhere else.

    int main(int argc, char *argv[]) {
    char* ptr=(char*)0x000f0000;

    return 0;
    }

    I step through to the return 0, so the pointer has been assigned the new address, but that address is inaccessible. I am programing under Win2k.

  6. #6
    Evil Member
    Join Date
    Jan 2002
    Posts
    638
    I'm pretty sure 2k has that flat space BS, which means you can't get at your memory or hardware. Massivesoft considers this an improvement.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Reading Process Memory
    By polydegmon in forum C# Programming
    Replies: 0
    Last Post: 05-26-2009, 07:18 AM
  2. tools for finding memory leaks
    By stanlvw in forum C++ Programming
    Replies: 4
    Last Post: 04-03-2009, 11:41 AM
  3. Shared Memory - shmget questions
    By hendler in forum C Programming
    Replies: 1
    Last Post: 11-29-2005, 02:15 AM
  4. Reading from Low Memory Error...
    By Unregistered in forum C Programming
    Replies: 1
    Last Post: 06-13-2002, 10:22 AM
  5. Reading from file into memory
    By GaPe in forum C Programming
    Replies: 15
    Last Post: 12-17-2001, 04:19 PM