As far as I know, a memory address like 0x0 of a program is the beginning of its code segment in its virtual address space. Is it possible to simply read what's in there from within a program? What about checking things like the size of the stack/heap? If not possible in C/++ programs, is it possible in assembly?
Edit: I find memory allocation and management interesting. I'm asking out of curiosity. I like the idea of being able to see what's in every address of my program's virtual address space. When I mentioned stack/heap size, I meant those of the program, too.