mirror of
https://github.com/threedr3am/ZhouYu
synced 2026-06-08 17:47:28 +00:00
rebase
This commit is contained in:
+1
-4
@@ -1,10 +1,7 @@
|
||||
package me.threedr3am.zhouyu.agent;
|
||||
package zhouyu.agent;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @author threedr3am
|
||||
*/
|
||||
public class ExpGen {
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
+3
-6
@@ -1,4 +1,4 @@
|
||||
package me.threedr3am.zhouyu.agent;
|
||||
package zhouyu.agent;
|
||||
|
||||
import com.sun.tools.attach.AgentInitializationException;
|
||||
import com.sun.tools.attach.AgentLoadException;
|
||||
@@ -6,12 +6,9 @@ import com.sun.tools.attach.AttachNotSupportedException;
|
||||
import com.sun.tools.attach.VirtualMachine;
|
||||
import java.io.IOException;
|
||||
import java.lang.instrument.Instrumentation;
|
||||
import me.threedr3am.zhouyu.core.config.Config;
|
||||
import me.threedr3am.zhouyu.core.transformer.CoreClassFileTransformer;
|
||||
import zhouyu.core.config.Config;
|
||||
import zhouyu.core.transformer.CoreClassFileTransformer;
|
||||
|
||||
/**
|
||||
* @author threedr3am
|
||||
*/
|
||||
public class ZhouYu {
|
||||
|
||||
public static void premain(String agentArg, Instrumentation inst) {
|
||||
+5
-5
@@ -11,7 +11,7 @@ buildscript {
|
||||
allprojects {
|
||||
apply plugin: 'java'
|
||||
|
||||
group 'me.threedr3am.zhouyu'
|
||||
group 'zhouyu'
|
||||
version '1.0-SNAPSHOT'
|
||||
|
||||
sourceCompatibility = 1.7
|
||||
@@ -41,14 +41,14 @@ project(":agent") {
|
||||
|
||||
shadowJar {
|
||||
manifest {
|
||||
attributes 'Main-Class': 'me.threedr3am.zhouyu.agent.ZhouYu'
|
||||
attributes 'Premain-Class': 'me.threedr3am.zhouyu.agent.ZhouYu'
|
||||
attributes 'Agent-Class': 'me.threedr3am.zhouyu.agent.ZhouYu'
|
||||
attributes 'Main-Class': 'zhouyu.agent.ZhouYu'
|
||||
attributes 'Premain-Class': 'zhouyu.agent.ZhouYu'
|
||||
attributes 'Agent-Class': 'zhouyu.agent.ZhouYu'
|
||||
attributes 'Can-Redefine-Classes': true
|
||||
attributes 'Can-Retransform-Classes': true
|
||||
}
|
||||
|
||||
relocate 'javassist', 'me.threedr3am.zhouyu.javassist'
|
||||
relocate 'javassist', 'zhouyu.javassist'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* @author threedr3am
|
||||
*/
|
||||
package me.threedr3am.zhouyu.core;
|
||||
+1
-4
@@ -1,4 +1,4 @@
|
||||
package me.threedr3am.zhouyu.core.config;
|
||||
package zhouyu.core.config;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.HashMap;
|
||||
@@ -6,9 +6,6 @@ import java.util.Map;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* @author threedr3am
|
||||
*/
|
||||
public class Config {
|
||||
|
||||
private static Config config;
|
||||
+2
-5
@@ -1,14 +1,11 @@
|
||||
package me.threedr3am.zhouyu.core.init;
|
||||
package zhouyu.core.init;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import javassist.ClassPool;
|
||||
import javassist.CtClass;
|
||||
import javassist.LoaderClassPath;
|
||||
import me.threedr3am.zhouyu.core.transformer.Transformer;
|
||||
import zhouyu.core.transformer.Transformer;
|
||||
|
||||
/**
|
||||
* @author threedr3am
|
||||
*/
|
||||
public class ProtectTransformer implements Transformer {
|
||||
|
||||
@Override
|
||||
+3
-6
@@ -1,4 +1,4 @@
|
||||
package me.threedr3am.zhouyu.core.init;
|
||||
package zhouyu.core.init;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
@@ -19,12 +19,9 @@ import javassist.CtClass;
|
||||
import javassist.CtConstructor;
|
||||
import javassist.CtMethod;
|
||||
import javassist.LoaderClassPath;
|
||||
import me.threedr3am.zhouyu.core.transformer.Transformer;
|
||||
import me.threedr3am.zhouyu.core.util.JavassistUtil;
|
||||
import zhouyu.core.transformer.Transformer;
|
||||
import zhouyu.core.util.JavassistUtil;
|
||||
|
||||
/**
|
||||
* @author threedr3am
|
||||
*/
|
||||
public class WriteShellTransformer implements Transformer {
|
||||
|
||||
private String[][] methods = new String[][] {
|
||||
+3
-6
@@ -1,4 +1,4 @@
|
||||
package me.threedr3am.zhouyu.core.transformer;
|
||||
package zhouyu.core.transformer;
|
||||
|
||||
import java.lang.instrument.ClassFileTransformer;
|
||||
import java.lang.instrument.IllegalClassFormatException;
|
||||
@@ -9,12 +9,9 @@ import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import me.threedr3am.zhouyu.core.init.ProtectTransformer;
|
||||
import me.threedr3am.zhouyu.core.init.WriteShellTransformer;
|
||||
import zhouyu.core.init.ProtectTransformer;
|
||||
import zhouyu.core.init.WriteShellTransformer;
|
||||
|
||||
/**
|
||||
* @author threedr3am
|
||||
*/
|
||||
public class CoreClassFileTransformer implements ClassFileTransformer {
|
||||
|
||||
private Instrumentation inst;
|
||||
+1
-4
@@ -1,8 +1,5 @@
|
||||
package me.threedr3am.zhouyu.core.transformer;
|
||||
package zhouyu.core.transformer;
|
||||
|
||||
/**
|
||||
* @author threedr3am
|
||||
*/
|
||||
public interface Transformer {
|
||||
|
||||
boolean condition(String className);
|
||||
+1
-4
@@ -1,4 +1,4 @@
|
||||
package me.threedr3am.zhouyu.core.util;
|
||||
package zhouyu.core.util;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
@@ -7,9 +7,6 @@ import javassist.CtClass;
|
||||
import javassist.CtConstructor;
|
||||
import javassist.CtMethod;
|
||||
|
||||
/**
|
||||
* @author threedr3am
|
||||
*/
|
||||
public class JavassistUtil {
|
||||
|
||||
public static Set<CtMethod> getAllMethods(CtClass ctClass) {
|
||||
Reference in New Issue
Block a user