Thread: find variables in memory

  1. #1
    Registered User
    Join Date
    Oct 2005
    Posts
    14

    find variables in memory

    i want to find certain values in a games memory.. but when the game's memory usage is over 200megs which is full of models, textures etc etc. i can't work out a way to locate the memory address of say, your players health.. or stats.

    can someone please point me in the right direction? thanks!

  2. #2
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    Sounds like you want to manipulate those variables, a.k.a. cheat. Am I right?
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  3. #3
    Registered User
    Join Date
    Oct 2005
    Posts
    14
    actually i don't want to change memory, just analyze it to create extended ui.
    do you know how to do it?

  4. #4
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    It's difficult. [edit] Yes, I've done it before. [/edit] You often get segmentation faults if you're not careful, and searching through memory is a real pain. Often data is not stored how you expect it to be. You might be better off downloading a program that does this instead of trying to program it yourself.

    But really, what do you want it for? GDB or other debuggers work really well for programs you have written. (I don't think you would have written that program anyway. ) Why do you need to do this? It would be next to impossible to glean anything from the computer's memory. Even a simple integer like your money would be stored in the sort of format that you get when you write to a binary file. It would be completely unrecognisable.

    The simplest way to identify where a variable actually is is to change it, and watch the memory to see what changes. But in a complex game that would be impossible.

    So, again: what are you doing? Why?
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  5. #5
    "Why use dynamic memory?"
    Join Date
    Aug 2006
    Posts
    186
    tbh, couple of days ago i found a program that does that !! it find the variables everytime the game runs and you can alter em to cheat. But the page is lost now . Try to google it
    "C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg."-Bjarne Stroustrup
    Nearing the end of finishing my 2D card game! I have to work on its 'manifesto' though <_<

  6. #6
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,210
    Quote Originally Posted by Hussain Hani View Post
    tbh, couple of days ago i found a program that does that !! it find the variables everytime the game runs and you can alter em to cheat. But the page is lost now . Try to google it
    You encourage people to cheat?

    Programming should have as a prerequisite a sense of morality and decency.

  7. #7
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    >> Programming should have as a prerequisite a sense of morality and decency.
    Living should have as a prerequisite a sense of morality and decency.

    Programming should just require that you are alive.

  8. #8
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Threads about hacking, cheating, or otherwise breaking into code you either have not written or for which you have malicious intent to either break, modify, or somehow alter are not encouraged on this board.

  9. #9
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,210
    Quote Originally Posted by Daved View Post
    >> Programming should have as a prerequisite a sense of morality and decency.
    Living should have as a prerequisite a sense of morality and decency.

    Programming should just require that you are alive.
    I like that. Thank you very much for posting this. Speaking of morality, I might have to steal it.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Mutex and Shared Memory Segment Questions.
    By MadDog in forum Linux Programming
    Replies: 14
    Last Post: 06-20-2010, 04:04 AM
  2. sorting number
    By Leslie in forum C Programming
    Replies: 8
    Last Post: 05-20-2009, 04:23 AM
  3. tools for finding memory leaks
    By stanlvw in forum C++ Programming
    Replies: 4
    Last Post: 04-03-2009, 11:41 AM
  4. Order of Memory Locations
    By vlrk in forum Linux Programming
    Replies: 11
    Last Post: 06-30-2008, 07:11 AM
  5. Freeing memory for non-pointer variables
    By SuperGodAntMan in forum C++ Programming
    Replies: 7
    Last Post: 02-11-2006, 01:30 AM