3

I can't figure out how to keep my static pointers working for multiple play sessions. It's getting rather annoying to have to find the addresses at the start of every session.

For fun, I'm trying to see if I can change the values of a singleplayer game (Jamestown: Legend of the Lost Colony, to be exact) so I can have different amounts of lives and continues from the game defaults and not stress out about dying so much.

Using both Cheat Engine and L. Spiro's Memory Hacking Software (MHS), I've been successful at changing these values by watching for the values to decrement and grabbing the correct address. I can change these values with the expected results. I can even find a static (colored green) pointer that will update the appropriate value.

The problem is that this pointer does not seem to be valid when I start a new play session. It's pointing to nothing, or something completely unrelated. Where might I be going wrong? Is there an easier way to do this? I'd rather not have to go through finding the correct address every time I start playing. :)

  • Are you actually talking about static pointers as in used in programming or just a game that simulates hacking? The former would be way offtopic for a site that deals with playing games... – deutschZuid Jun 5 '13 at 5:59
  • 6
    He's using a tool designed to aid in hacking games to change memory values. I don't think the question deserves to be downvoted since it is a valid question that makes sense, it is answerable, it shows effort, etc. I would also argue that it does belong on Arqade as opposed to somewhere like Stackoverflow because these tools are not designed for software development but are instead targeted at hacking games. Its a very narrow scope, but it does fall within gaming. – Ian Jun 5 '13 at 8:40
  • @deutschZuid neither, he's talking about memory editing, an advanced cheating mechanism. – kotekzot Jun 5 '13 at 11:25
  • 1
    I suspect actual memory addresses change whenever you restart the game. It's not going to occupy exactly the same spot in RAM, each and every time you play. – Frank Jun 5 '13 at 12:25
  • @fbueckert yes, but the way the program accesses it doesn't. See my answer. – kotekzot Jun 5 '13 at 12:55
7

Speaking from my coding experience; If I am understanding this correctly, your pointers point to memory addresses where certain values reside which you want to modify. A pointer is just a variable that instead of saving some value, saves a memory location.

You need find the addresses again for every time you restart the game. The reason for this is that the Operating System keeps track of allocated memory and which processes that have allocated that memory. Each process maintains its separate memory space. Memory is not an infinite resource so when a process exits, is shut down or killed, the memory tied to that process is released and becomes available for other processes to use. When a process needs a certain amount of memory, the operating system attempts to allocate that memory somewhere in the memory where there is enough space and then gives the process a link to that memory. However, depending on the current state of system memory and all the other things that are in it, you can never really be sure where that memory might be found. This causes the addresses to be different for each run.

Here's a link to Memory Addresses at Wikipedia and there are plenty of other resources on how computer memory work available online.

| improve this answer | |
3

Steinin's answer is 100% correct, I would just like to add an analogy.

All software exists within memory when it is running. Memory consists of a huge series of storage areas which are identified by their addresses. Think of it as a warehouse full of boxes where each box has an ID number written on the front. In each box I could store data of some sort (numbers, words, etc). Or I could store the ID number of another box; doing so would make this box a Pointer to the other box.

However the warehouse is much bigger than just my program, it contains the entire computers software; managing this huge storage area is one of the primary jobs of the operating system. The operating system assigns boxes to our program when it requests them, but we have no control over which boxes we get. This doesn't actually matter, you don't write a program to use specific addresses, the language takes care of this for you under the hood. Your code works more like:

  • Give me a Box
  • Store '7' in it
  • Give me another Box
  • Store the address of the first Box in the new Box
  • etc

Every time a program runs the majority of the data values may be the same, and the relationship between our boxes may be the same, but the actual addresses are different every time. The boxes we get depends on which ones the OS has free when we request them. This means that whenever we create a pointer to another box the actual value of that pointer is different every time. There is nothing that you can do about this, even the software developer who wrote the game would have a great deal of difficulty forcing an address to be the same every time and doing so would be a very bad idea.

Unfortunately you must find the addresses again every time you start the game.

N.B - - A Static Pointer doesn't mean what you think it means, 'Static' is a keyword used in several programming languages to specify a particular type of behavior (which I'll not go into now). Suffice it to say, it does not override the operating system's control of memory.

The reason that your pointer sometimes points to nothing is because nothing (or NULL) is the default state of a pointer, since a pointer could be pointing to anything in memory its very dangerous to leave one lying around pointing to something that you aren't using any more. So programmers assign the NULL value to it to stop it doing damage.

| improve this answer | |
  • I'm a C# programmer, so I probably understand your usage of static (i.e. one pointer shared between objects of the same class). I guess what I'm looking for is a way to find the pointer I need every time, using offsets and whatever else (read: I didn't do so well in my Assembly classes in college). :) – Silhouette Jun 5 '13 at 14:57
0

You can use ArtMoney's pointer search feature to create an address table that will work every time you start the game without any extra work. The process, however, is non-trivial, so here's a tutorial from the authors of ArtMoney (See section 'Using "Pointers"').

| improve this answer | |
  • I've used Cheat Engine and MHS to find these pointers, but they didn't work once I restarted the game. Is ArtMoney's pointer scan feature somehow superior to those other programs? – Silhouette Jun 5 '13 at 14:54
  • @Silhouette I haven't compared them, but give it a go - it's free, so what have you got to lose? – kotekzot Jun 5 '13 at 15:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.