0

I'm trying to change value of address memory of another running proccess in java.
I did have known process is running, but how to access the static address of the process and alter?

Like something that : writeByte(process, address, (int) value)

Address is something like: 0x005B8980

String line;
    String pidInfo ="";
    Process p;
    try {
        p = Runtime.getRuntime().exec(System.getenv("windir") +"\\system32\\"+"tasklist.exe");


    BufferedReader input =  new BufferedReader(new InputStreamReader(p.getInputStream()));

    while ((line = input.readLine()) != null) {
        pidInfo+=line; 
    }

    input.close();

    if(pidInfo.contains("APP"))
    {

    // DO send bytes to APP

    }
  • AFAIK if you are able to get an `Unsafe` through reflection, you are able to copy an object to a memory pointer. – GiantTree Sep 13 '15 at 17:40
  • Sounds like you are asking the wrong question. What's your use case? Why can't you use other inter process communication methods? – Henry Sep 13 '15 at 18:09
  • Sometimes, my app communicates via socket to this process, when they are in remote system. But in this case, i can't retrieve and change some values, and it's local machine – Felipe Moraes Sep 13 '15 at 18:29
  • Looks like a dupe of http://stackoverflow.com/questions/25396664/shared-memory-between-two-jvms, or is there something here that's different than that? – yshavit Sep 14 '15 at 02:11
  • yea, it's different, cuz another process is from third part, and its not build in java – Felipe Moraes Sep 14 '15 at 11:47
  • by using java, i just wanna inject bytes to another running process – Felipe Moraes Sep 14 '15 at 23:11

0 Answers0