title: Memory hacking / memory allocation : why does this work and how?
body: <p>What i know is you look for some address of of some variables in the software you're trying to manipulate . And once you find it you then try to find the "base pointer" for it so no matter where the process is , you can still access those variables.I mean when the process is restarted the variables would have different addresses , but still you know where they are . </p>
  
  <p>Now what i don't get is why is this possible ?</p>
  
  <p>lets say i do this in C++ :</p>
  
  <pre><code>int *x = (int*)malloc(sizeOf(int));
  </code></pre>
  
  <p>isn't that dynamic ? and shouldn't x be placed in a "random" address that was free at the time ? 
  Basically what I'm asking about is where is x really when that code is executed? </p>
  
  <p>EDIT : i mean like usually variables like health are stored in addresses like game.exe + 0000caff , and then you can always find them there .</p>