Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New Coder
    Join Date
    Feb 2005
    Location
    UK
    Posts
    90
    Thanks
    1
    Thanked 0 Times in 0 Posts

    search through RAM

    How would I go about making a loop to search through the entire RAM? For the purpose of finding lost data, or saving it to disk for later examination...(i'd like to code some sort of ram viewer similar to a hex editor). Using c++.
    Thanks!
    Last edited by _Dan; 02-07-2005 at 06:41 PM.

  • #2
    Senior Coder Mhtml's Avatar
    Join Date
    Jun 2002
    Location
    Sydney, Australia
    Posts
    3,531
    Thanks
    0
    Thanked 1 Time in 1 Post
    You need pointers my friend. Run up a search on google for a c++ pointers tutorial.
    Omnis mico antequam dominus Spookster!

  • #3
    Regular Coder
    Join Date
    Dec 2003
    Posts
    367
    Thanks
    0
    Thanked 0 Times in 0 Posts
    On most machines this will be very hard since the OS won't let your program access all of the RAM but only the portion allocated to it's process. You'll be causing segmentation faults (when a program tries to access memory that isn't it's own) all over the place. I'm guessing you will need to hack the kernel of the OS or something (just shooting from the hip here ).

    shmoove

  • #4
    New Coder
    Join Date
    Jan 2005
    Location
    West Midlands, United Kingdom
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Wouldn't you just get illegal operation errors left right and center?

  • #5
    New Coder
    Join Date
    Feb 2005
    Location
    UK
    Posts
    90
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I know problems would be caused if I tried to write memory that contained something important...but i'm sure i've seen programs that can edit memory of games (for cheating). Googling for "cheat program memory editing", I've found this: http://www.x-ways.net/ramcheat.html
    It talks about "virtual memory access methods". Does anyone have any idea how it (or similar programs) work?
    Thanks again.

    Just another thought: would programs that scan for viruses look in the RAM?
    Daniel
    XZIST.org

  • #6
    Regular Coder
    Join Date
    Oct 2004
    Posts
    230
    Thanks
    0
    Thanked 0 Times in 0 Posts
    There are a few ways to do that, I believe the most common is through the Read/WriteProcessMemory API functions.

  • #7
    New Coder
    Join Date
    Feb 2005
    Location
    UK
    Posts
    90
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Googling them, they could well be the functions i'm looking for. Thankyou
    I did not know that windows prevented you accessing all the ram...but I suppose I don't really need to. Although a whole ram hex editor would sound nice...
    Daniel
    XZIST.org

  • #8
    Regular Coder
    Join Date
    Oct 2004
    Posts
    230
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Most modern (32bit) operating systems run in what's called protected mode. This is what helps make them stable, because one process can't corrupt the memory space of another. This is why when a program crashes, it doesn't take the whole operating system down with it.

    For you to be able to read/write to another processes memory, you need to gain the correct access to the other process (ex: calling OpenProcess() with the correct flags)

  • #9
    New Coder
    Join Date
    Feb 2005
    Location
    UK
    Posts
    90
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Can processes prevent this access of their memory?
    Daniel
    XZIST.org


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •