How do I print each byte of memory that a process is using in C?

What I want to achieve is to start the process by running a C command line application under Linux and then first find out which one is the lowest and highest virtual memory address used by the process and afterwards print each byte between the hex value with printf ( ). Is it possible?

Is it even possible to figure out what are the lowest and highest virtual memory addresses of my own process?

If I had one, I would guess that I could use pointer arithmetic in combination with printf ("% p, & address") to print it all in between.

Any suggestions?

+3


source to share


1 answer


Use the command ps

as shown below



system("ps aux --sort -rss|grep <your_process_name_or_id>");

      

0


source







All Articles