1

When I use Cheat Engine to inspect the memory of a game I see a particular value at address 0x009FF414. When I try to read that same location with a little C program (see below), I get a runtime error.

Why can Cheat Engine access that address even though my program cannot? What would I need to do in my program to read that memory?

My Program:

#include <stdio.h>
int main(void)
{
  int *ptr = 0x009FF414;
  printf("%d\n", *ptr);
}
Peter - Reinstate Monica
  • 15,048
  • 4
  • 37
  • 62
Developer
  • 31
  • 9

2 Answers2

0

A 32 bit micro processor can address about 4GB of memory. This does not mean all 4GB are mapped into the current address space. What is mapped depends both on the operating system and whether ASLR is being used. Processes can also map more RAM or other resources using APIs like mmap or VirtualAlloc. So what may work in one process, may not work somewhere else.

doron
  • 27,972
  • 12
  • 65
  • 103
-1

The memory address you are trying to read may be used by another process which you cannot access from your program. For better understanding of how operating system prevents one program from accessing another programs memory you can read this.