visual studio screenshot with memory window open
Hi, I wonder if someone could kindly give me some info on something please?
I have this code in exe1:
int number = 100;
int* p = &number; // p = 0x0050f594
p is pointing to the memory address 0x0050f594
In another program, exe2, I have this:
int* p = (int*)0x0050f594;
So to me, p from exe2, points to the variable number from exe1.
I think it's something to do with different applications running in their own address space, but I would still like to know how to make exe2's p pointer point to the number variable from exe1?
In modern operating systems, processes are isolated. Each process have its own memory. The operating system is in charge of translating process memory address (when a process want to read or write into memory) into a physical address.
If you do not have operating system, or a simple (embedded platform) or if you're writting a kernel mode driver, you have a direct access to physical memory.
For x86 processor, the reading of https://en.wikipedia.org/wiki/Protected_mode and https://en.wikipedia.org/wiki/Real_mode may be interesting.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments