Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Program location in memory

Program location in memory

Scheduled Pinned Locked Moved C / C++ / MFC
performancetutorialquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    I am wondering how to find where a certain program is loaded into memory so I can access that section of RAM and read/change/ect the data. I do not know how to find where that program loaded itself into memory. I also don't really know how to access/change the data but I assume I can just create a pointer and move it along from the start of the memory block and figure it out from there. Which also reminds me, how can I tell the end of the memory location as well. So I guess I need to know how to find the block(start/end) of memory that a program has loaded itself into. I am just looking for links that show me how or explain it. But source code is always nice as well. Thanks

    H 1 Reply Last reply
    0
    • L Lost User

      I am wondering how to find where a certain program is loaded into memory so I can access that section of RAM and read/change/ect the data. I do not know how to find where that program loaded itself into memory. I also don't really know how to access/change the data but I assume I can just create a pointer and move it along from the start of the memory block and figure it out from there. Which also reminds me, how can I tell the end of the memory location as well. So I guess I need to know how to find the block(start/end) of memory that a program has loaded itself into. I am just looking for links that show me how or explain it. But source code is always nice as well. Thanks

      H Offline
      H Offline
      Hydralisk
      wrote on last edited by
      #2

      It's the operating system who load the program to memory, not program itself. You can appoint a base address when you compile a program. System try to load program on that address, if failed, it load program by it's own rule.Access other process's memory also has it's own rule. I suggest you read about the book <> by Jeffrey Richter.I thought there you can find the answer you want. Thinking in difference!

      L 1 Reply Last reply
      0
      • H Hydralisk

        It's the operating system who load the program to memory, not program itself. You can appoint a base address when you compile a program. System try to load program on that address, if failed, it load program by it's own rule.Access other process's memory also has it's own rule. I suggest you read about the book <> by Jeffrey Richter.I thought there you can find the answer you want. Thinking in difference!

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Thanks. :) I do know that the OS tries to place the program first then to the program. I am just wondering if the WINAPI or something in C++ allowed for finding where a program was loaded. For example, I want to find out where Minesweeper is loaded into memory so I can try to read its memory block and figure out what tiles are bombs. That is what I am aiming to do. I will try to find that book and see if it can yeild what I am looking for... given I am not exactly sure what the code will be that I want. Thanks again.

        D 1 Reply Last reply
        0
        • L Lost User

          Thanks. :) I do know that the OS tries to place the program first then to the program. I am just wondering if the WINAPI or something in C++ allowed for finding where a program was loaded. For example, I want to find out where Minesweeper is loaded into memory so I can try to read its memory block and figure out what tiles are bombs. That is what I am aiming to do. I will try to find that book and see if it can yeild what I am looking for... given I am not exactly sure what the code will be that I want. Thanks again.

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          There's an MSDN article titled "Minimizing the Memory Footprint of Your Windows CE-based Program" by Douglas Boling that might give you some clues. See the "An Application's Address Space " section. I did not look to see what API was used.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups