mirror of
https://github.com/xiaozhou233/JuiceAgent.git
synced 2026-12-05 13:05:53 +08:00
BugFix: fix playload typo in retransform-class example [skip ci]
- examples: rename playload to payload (directory, class, jar, config, docs) - payload.jar: rebuild with payload.class
This commit is contained in:
1 parent
8cd4c54c07
commit
6a43b3437a
11 files changed
+60
-60
No files matched your search
@@ -0,0 +1,25 @@
|
||||
import cn.xiaozhou233.juiceagent.api.JuiceAgent;
|
||||
|
||||
public class payload {
|
||||
public static void entry() throws java.io.IOException {
|
||||
System.out.println("Payload loaded!");
|
||||
|
||||
java.io.InputStream in = new java.io.FileInputStream("new_target.class");
|
||||
java.io.ByteArrayOutputStream out = new java.io.ByteArrayOutputStream();
|
||||
byte[] buf = new byte[4096];
|
||||
int len;
|
||||
while ((len = in.read(buf)) != -1) {
|
||||
out.write(buf, 0, len);
|
||||
}
|
||||
byte[] bytes = out.toByteArray();
|
||||
in.close();
|
||||
|
||||
JuiceAgent.retransformClassByName(
|
||||
"target",
|
||||
bytes,
|
||||
bytes.length
|
||||
);
|
||||
|
||||
System.out.println("Payload executed!");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user