(编辑:jimmy 日期: 2024/10/30 浏览:2)
import com.fr.license.selector.AbstractLicenseSelector;import com.fr.license.selector.EncryptedLicenseSelector;import com.fr.log.FineLoggerFactory;import com.fr.stable.Hidden;@Hiddenpublic abstract class EncryptedLicenseSelector extends AbstractLicenseSelector { byte[] getBytes() { byte[] arrayOfByte = readRawBytes(); return decrypt(arrayOfByte); } protected void decryptFailed(Throwable paramThrowable) { FineLoggerFactory.getLogger().error("Read license failed." + paramThrowable.getMessage(), paramThrowable); } abstract byte[] readRawBytes(); public byte[] decrypt(byte[] paramArrayOfbyte);}
import com.fr.license.selector.AbstractLicenseSelector;import com.fr.license.selector.EncryptedLicenseSelector;import com.fr.log.FineLoggerFactory;import com.fr.stable.Hidden;@Hiddenpublic abstract class EncryptedLicenseSelector extends AbstractLicenseSelector { byte[] getBytes() { byte[] arrayOfByte = readRawBytes(); return decrypt(arrayOfByte); } protected void decryptFailed(Throwable paramThrowable) { FineLoggerFactory.getLogger().error("Read license failed." + paramThrowable.getMessage(), paramThrowable); } abstract byte[] readRawBytes(); public native byte[] decrypt(byte[] paramArrayOfbyte);}
import com.fr.license.selector.AbstractLicenseSelector;import com.fr.license.selector.EncryptedLicenseSelector;import com.fr.log.FineLoggerFactory;import com.fr.stable.Hidden;@Hiddenpublic abstract class EncryptedLicenseSelector extends AbstractLicenseSelector {byte[] getBytes() {byte[] arrayOfByte = readRawBytes();return decrypt(arrayOfByte);}protected void decryptFailed(Throwable paramThrowable) {FineLoggerFactory.getLogger().error("Read license failed." + paramThrowable.getMessage(), paramThrowable);}abstract byte[] readRawBytes();public byte[] decrypt(byte[] paramArrayOfbyte);}
package crack;import crack.transformer.MultiMethodTransformer;import crack.transformer.SingleMethodTransformer;import javassist.ClassPool;import javassist.CtClass;import java.lang.instrument.ClassDefinition;import java.lang.instrument.Instrumentation;public class FineCrackAgent { public static void agentmain(String args, Instrumentation inst) throws Exception { ClassPool pool = new ClassPool(true); CtClass cl = pool.get("java.lang.reflect.Modifier"); cl.getDeclaredMethod("isNative").setBody("{ return true; }"); inst.redefineClasses(new ClassDefinition[] { new ClassDefinition(Class.forName(cl.getName(), false, null), cl.toBytecode()) }); System.out.println(cl.getName() + " 替换完成!"); Class<?>[] classes = inst.getAllLoadedClasses(); for (Class<?> clazz : classes) { String name = clazz.getName(); if (name.equals("com.fr.license.security.LicFileRegistry")) { inst.addTransformer(new SingleMethodTransformer(name, "check", 1, 2, new byte[]{4, -84}, null), true); inst.retransformClasses(clazz); System.out.println(name + " 替换完成!"); } if (name.equals("com.fr.license.entity.AbstractLicense")) { inst.addTransformer(new MultiMethodTransformer(name, "support", 1, 2, new byte[]{4, -84}, null), true); inst.retransformClasses(clazz); System.out.println(name + " 替换完成!"); } if (name.equals("com.fr.license.selector.EncryptedLicenseSelector")) { inst.addTransformer(new SingleMethodTransformer(name, "decrypt", 1, 2, new byte[]{43, -80}, null), true); inst.retransformClasses(clazz); System.out.println(name + " 替换完成!"); } } }}
{"VERSION":"11.0","DEADLINE":4102444799499,"CONCURRENCY":"0"}