Saturday 28 September 2013

Access (read/write) to virtual memory process from another application

Access (read/write) to virtual memory process from another application

I have simple program:
#include <stdio.h>
int a = 5;
int
main(void)
{
while(1)
{
int i;
sleep(1);
printf("%p %i\n", &a, a);
}
return 0;
}
Output (Ubuntu x64):
0x601048 5
0x601048 5
0x601048 5
0x601048 5
I was learning about pointers in C and I already know that you can use
memcpy to write data wherever (almost) you want within virtual memory of
process. But, is it possible to modify value of int a, placed at 0x601048
address, by using another application(which is of course using its own
virtual memory)? How to do this? I'm interested in solutions only for C.

No comments:

Post a Comment