mirror of
https://github.com/xiaozhou233/JuiceAgent.git
synced 2026-12-05 21:15:56 +08:00
1011 B
1011 B
Inject Method
Method A: Use injector.exe
Run injector.exe from YourDir.
<jps output>
Input PID:
Enter the PID of the target JVM process and press Enter.
Method B: Use JNI to call inject
Create cn/xiaozhou233/juiceagent/injector/InjectorNative.java in your project:
package cn.xiaozhou233.juiceagent.injector;
public class InjectorNative {
/*
* @param pid target process id
* @param path injection DLL path
*/
public native boolean inject(int pid, String path);
/*
* @param pid target process id
* @param path injection DLL path
* @param configDir directory containing config.toml
*/
public native boolean inject(int pid, String path, String configDir);
}
Example:
import cn.xiaozhou233.juiceagent.injector.InjectorNative;
System.load("<path-to-libinject>");
InjectorNative injectorNative = new InjectorNative();
injectorNative.inject(<pid>, "<path-to-libloader>", "<path-to-config-directory>");