1

I'm trying to attach and call methods and edit variables from a java process that's running from a separate java process.

Example: Process 1 has a loop that prints a String variable that's private and defined in the class. Process 2 (when started), changes the String message and then process 1 will continue to print out the changed variable.

This is more of a simple version of what i'm trying, but if i can figure that out, i can easily find out the rest myself.

Thanks! Erouax

Erouax
  • 163
  • 2
  • 10

1 Answers1

0

Just adding this because i totally forgot about my question when i found the answer.

It's possible (and very easy) to do using Java Agents and injecting using things such as the Hotspot Attach API. This is a very 'detectable' method, but still works. If you wish to keep your injection more low-key for whatever reason, i suggest using DLL injection to chuck in your classes and using JNI to call your entry method from the DLL. These DLL's and injectors are quite easy to come by, even quite easy to make if you have decent native knowledge.

Erouax
  • 163
  • 2
  • 10