Ok, I have a working program that reads external virtual memory on linux. This is what I want to do: Program 1 is executed and has specific addresses in memory to communicate with program 2. I know that program 2, which is reading and writing values to and from program 1 is working I am stuck with the making of program 2, I have this code:
#include <iostream>
using namespace std;
int main()
{
int* i;
i = (int*)0x7ffABCDDCBA1;
*i = 1;
cout << *i << " " << i << endl;
}
Note:
this is just a test code to see if it works(it doesn't)
program1 would read 0x7ffABCDDCBA1 at program 2's pid, it compiles just fine, but on executing i get "Segmentation fault"
Note:
#include <iostream>
using namespace std;
int main()
{
int* i;
i = (int*)0x7ffABCDDCBA1;
cout << i << endl;
}
Works just fine