Package org.apache.bcel.util

Examples of org.apache.bcel.util.InstructionFinder.search()


                    if (m.isStatic()) {
                        MethodGen gen = new MethodGen(m,c.getClassName(),cpg);
                        InstructionList il = gen.getInstructionList();
                        if (il == null) continue;
                        InstructionFinder f = new InstructionFinder(il);
                        Iterator e = f.search("GETSTATIC LDC FSUB PUTSTATIC");
                        if (e.hasNext()) {
                            InstructionHandle[] handles = (InstructionHandle[]) e.next();
                            data.addField("MapAngle", ((GETSTATIC)handles[0].getInstruction()).getClassName(cpg) + "." + ((GETSTATIC)handles[0].getInstruction()).getFieldName(cpg));
                            return SearchResult.Success;
                        }
View Full Code Here


                      InstructionList il = gen.getInstructionList();
                      if (il == null) {
                          continue;
                      }
                      InstructionFinder f = new InstructionFinder(il);
                      Iterator e = f.search("INVOKESTATIC IFEQ GETSTATIC ICONST_2 IF_ICMPLE");
                      if (e.hasNext()) {
                          InstructionHandle[] handles = (InstructionHandle[]) e.next();
                          String opCount = ((GETSTATIC) handles[2].getInstruction()).getClassName(cpg)+'.'+((GETSTATIC) handles[2].getInstruction()).getFieldName(cpg);
                          data.addField("MenuOptionCount", opCount);
                          return SearchResult.Success;
View Full Code Here

                                InstructionList il = gen.getInstructionList();
                                if (il == null) {
                                    continue;
                                }
                                InstructionFinder f = new InstructionFinder(il);
                                Iterator e = f.search("ALOAD GETFIELD GETFIELD ALOAD GETFIELD GETFIELD");
                                if (e.hasNext()) {
                                    InstructionHandle[] handles = (InstructionHandle[]) e.next();
                                    String getviewport = ((GETFIELD) handles[1].getInstruction()).getFieldName(cpg);
                                    e = f.search("ILOAD ALOAD GETFIELD if_icmplt ILOAD ALOAD GETFIELD if_icmple", handles[handles.length - 1]);
                                    if (e.hasNext()) {
View Full Code Here

                                InstructionFinder f = new InstructionFinder(il);
                                Iterator e = f.search("ALOAD GETFIELD GETFIELD ALOAD GETFIELD GETFIELD");
                                if (e.hasNext()) {
                                    InstructionHandle[] handles = (InstructionHandle[]) e.next();
                                    String getviewport = ((GETFIELD) handles[1].getInstruction()).getFieldName(cpg);
                                    e = f.search("ILOAD ALOAD GETFIELD if_icmplt ILOAD ALOAD GETFIELD if_icmple", handles[handles.length - 1]);
                                    if (e.hasNext()) {
                                        handles = (InstructionHandle[]) e.next();
                                        String zmin = ((GETFIELD) handles[2].getInstruction()).getFieldName(cpg);
                                        String zmax = ((GETFIELD) handles[6].getInstruction()).getFieldName(cpg);
                                        e = f.search("ALOAD GETFIELD ALOAD GETFIELD GETFIELD ALOAD GETFIELD GETFIELD", handles[handles.length - 1]);
View Full Code Here

                                    e = f.search("ILOAD ALOAD GETFIELD if_icmplt ILOAD ALOAD GETFIELD if_icmple", handles[handles.length - 1]);
                                    if (e.hasNext()) {
                                        handles = (InstructionHandle[]) e.next();
                                        String zmin = ((GETFIELD) handles[2].getInstruction()).getFieldName(cpg);
                                        String zmax = ((GETFIELD) handles[6].getInstruction()).getFieldName(cpg);
                                        e = f.search("ALOAD GETFIELD ALOAD GETFIELD GETFIELD ALOAD GETFIELD GETFIELD", handles[handles.length - 1]);
                                        if (e.hasNext()) {
                                            handles = (InstructionHandle[]) e.next();
                                            String xscale = ((GETFIELD) handles[1].getInstruction()).getFieldName(cpg);
                                            e = f.search("ALOAD GETFIELD ALOAD GETFIELD GETFIELD ALOAD GETFIELD GETFIELD", handles[handles.length - 1]);
                                            if (e.hasNext()) {
View Full Code Here

                                        String zmax = ((GETFIELD) handles[6].getInstruction()).getFieldName(cpg);
                                        e = f.search("ALOAD GETFIELD ALOAD GETFIELD GETFIELD ALOAD GETFIELD GETFIELD", handles[handles.length - 1]);
                                        if (e.hasNext()) {
                                            handles = (InstructionHandle[]) e.next();
                                            String xscale = ((GETFIELD) handles[1].getInstruction()).getFieldName(cpg);
                                            e = f.search("ALOAD GETFIELD ALOAD GETFIELD GETFIELD ALOAD GETFIELD GETFIELD", handles[handles.length - 1]);
                                            if (e.hasNext()) {
                                                handles = (InstructionHandle[]) e.next();
                                                String yscale = ((GETFIELD) handles[1].getInstruction()).getFieldName(cpg);
                                                e = f.search("ILOAD ALOAD GETFIELD if_icmplt ILOAD ALOAD GETFIELD if_icmpgt", handles[handles.length - 1]);
                                                if (e.hasNext()) {
View Full Code Here

                                            String xscale = ((GETFIELD) handles[1].getInstruction()).getFieldName(cpg);
                                            e = f.search("ALOAD GETFIELD ALOAD GETFIELD GETFIELD ALOAD GETFIELD GETFIELD", handles[handles.length - 1]);
                                            if (e.hasNext()) {
                                                handles = (InstructionHandle[]) e.next();
                                                String yscale = ((GETFIELD) handles[1].getInstruction()).getFieldName(cpg);
                                                e = f.search("ILOAD ALOAD GETFIELD if_icmplt ILOAD ALOAD GETFIELD if_icmpgt", handles[handles.length - 1]);
                                                if (e.hasNext()) {
                                                    handles = (InstructionHandle[]) e.next();
                                                    String xmin = ((GETFIELD) handles[2].getInstruction()).getFieldName(cpg);
                                                    String xmax = ((GETFIELD) handles[6].getInstruction()).getFieldName(cpg);
                                                    e = f.search("ILOAD ALOAD GETFIELD if_icmplt ILOAD ALOAD GETFIELD if_icmpgt", handles[handles.length - 1]);
View Full Code Here

                                                e = f.search("ILOAD ALOAD GETFIELD if_icmplt ILOAD ALOAD GETFIELD if_icmpgt", handles[handles.length - 1]);
                                                if (e.hasNext()) {
                                                    handles = (InstructionHandle[]) e.next();
                                                    String xmin = ((GETFIELD) handles[2].getInstruction()).getFieldName(cpg);
                                                    String xmax = ((GETFIELD) handles[6].getInstruction()).getFieldName(cpg);
                                                    e = f.search("ILOAD ALOAD GETFIELD if_icmplt ILOAD ALOAD GETFIELD if_icmpgt", handles[handles.length - 1]);
                                                    if (e.hasNext()) {
                                                        handles = (InstructionHandle[]) e.next();
                                                        String ymin = ((GETFIELD) handles[2].getInstruction()).getFieldName(cpg);
                                                        String ymax = ((GETFIELD) handles[6].getInstruction()).getFieldName(cpg);
                                                        sdtoolkit.addField("xMin", xmin);
View Full Code Here

        if(m.getName().equals("<init>")){
          InstructionList il = mg.getInstructionList();
          if(il == null || il.getInstructions().length != 6)
            continue;
          InstructionFinder f = new InstructionFinder(il);
                    Iterator e = f.search("ALOAD INVOKESPECIAL ALOAD ICONST PUTFIELD");
                    if (e.hasNext()) {
                      matches++;
                    }
        }
      }
View Full Code Here

                    ConstantPoolGen cpg = c.getValue().getConstantPool();
                    MethodGen gen = new MethodGen(m,c.getValue().getClassName(),cpg);
                    InstructionList il = gen.getInstructionList();
                    if (il == null) continue;
                    InstructionFinder f = new InstructionFinder(il);
                    Iterator e = f.search("(ALOAD ICONST ALOAD GETFIELD ALOAD GETFIELD ILOAD IMUL ALOAD GETFIELD ILOAD IMUL IADD ALOAD GETFIELD ILOAD IMUL IADD BIPUSH ISHR IADD IASTORE)+");
                    if (e.hasNext()) {
                        InstructionHandle[] handles = (InstructionHandle[]) e.next();
                        String sdviewport = ((GETFIELD)handles[3].getInstruction()).getClassName(cpg);
                        if (!sdviewport.equals(c.getKey())) continue;
                        data.addClass("Viewport",classes.get(sdviewport).getSuperclassName());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.