|
-
Jul 18th, 2003, 05:59 AM
#1
Thread Starter
Member
Application program memory area
Hi friends,
One query. every program is loaded into memory for execution. Considering only those programs loaded in RAM, is there any way to determine where in my RAM my application program is ruuning ? I mean is my program running in STACK, HEAP, CODE SEGMENT, DATA SEGMENT ?
Any help ?
-
Jul 18th, 2003, 07:15 AM
#2
Basically, there's no way to know where in physical RAM your app resides.
However, to answer this:
I mean is my program running in STACK, HEAP, CODE SEGMENT, DATA SEGMENT ?
Your program is running in memory. The code was loaded from the code (.text) segment of your exe, the static data was loaded from the data (.data) segment of your exe. The function locals and return addresses are on the stack and whatever you allocated is on the heap.
Segments in this case are parts of an exe file, not of memory. Stack and Heap are two concepts of memory usage, not areas in memory.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jul 18th, 2003, 02:03 PM
#3
Hyperactive Member
You can use GetModuleHandle to return the memory address of a module. (module meaning the application exe itself, or any .dll's its using)
Most applications start at address 0x400000. You can use ReadProcessMemory and WriteProcessMemory to read/write to the memory.
-
Jul 19th, 2003, 04:13 AM
#4
That's not the address in memory.
Make 5 different apps, load them all and let every one call GetModuleHandle. Very likely all will return 0x400000.
It actually is the address in the process' address space, that is, an address mapped to some physical memory address which you'll never find out.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|