Examples of FieldInstruction


Examples of org.apache.bcel.generic.FieldInstruction

                    }
                    String sDestX;
                    int count = 0;
                    InstructionSearcher2 iS = new InstructionSearcher2(cg, m);
                    while(iS.nextGETSTATIC() != null){
                      FieldInstruction fi = (FieldInstruction)iS.current();
                      if((fi.getClassName(cpg)+'.'+fi.getFieldName(cpg)).equals(myplayer.path)){
                        count++;
                        if(count==7){
                          fi = iS.nextGETSTATIC();
                          sDestX = fi.getClassName(cpg)+'.'+fi.getFieldName(cpg);
                          data.addField("DestX", sDestX);
                          InstructionFinder f = new InstructionFinder(il);
                          Iterator e = f.search("IF_ICMPNE ICONST_M1 PUTSTATIC ICONST_M1 PUTSTATIC");
                              if(e.hasNext()){
                                InstructionHandle[] handles = (InstructionHandle[]) e.next();
View Full Code Here

Examples of org.apache.bcel.generic.FieldInstruction

                    if (il == null) {
                        continue;
                    }
                    InstructionSearcher2 iS = new InstructionSearcher2(cg, m);
                    while(iS.nextFieldInstruction() != null){
                      FieldInstruction fi = (FieldInstruction)iS.current();
                      if(fi.getClassName(cpg).equals(character.className)){
                        String anim = fi.getFieldName(cpg);
                        character.addField("Animation", anim);
                        int count = 0;
                        while(iS.nextFieldInstruction() != null){
                          fi = (FieldInstruction)iS.current();
                          if((fi instanceof GETFIELD) && (fi.getClassName(cpg)+'.'+fi.getFieldName(cpg)).equals(character.className+'.'+anim)){
                            count++;
                            if(count==2){
                              while(iS.nextGETFIELD() != null){
                                GETFIELD gf = ((GETFIELD)iS.current());
                                if(gf.getClassName(cpg).equals(character.className)){
View Full Code Here

Examples of org.apache.bcel.generic.FieldInstruction

                      }
                      InstructionList iList = gen.getInstructionList();
            InstructionSearcher iS = new InstructionSearcher(iList, cpg);
           
            if(iS.nextLDC("14)") != null){
              FieldInstruction fi = iS.nextFieldInstruction();
              data.addField("LoginIndex", fi.getClassName(cpg)+'.'+fi.getFieldName(cpg));
              return SearchResult.Success;
            }
                  }
              }
          }
View Full Code Here

Examples of org.apache.bcel.generic.FieldInstruction

            MethodSearcher mS = new MethodSearcher(m, cg, cpg);
            RSField menuOpCount = data.getProperField("MenuOptionCount");
            if (m.isStatic() && m.isFinal() && m.getReturnType().equals(Type.VOID) && mS.getArgCount() == 11 &&
                mS.getTypeCount("int")>= 3 && mS.hasField(menuOpCount.path)) {
                if(iS.nextFieldInstructionOf(menuOpCount.path)!=null){
                  FieldInstruction i = null;
                  i = (FieldInstruction)iS.prevGETSTATIC();
                  data.addField("MenuOpen", i.getClassName(cpg)+'.'+i.getFieldName(cpg));
                  iS.nextGETSTATIC();
                }
                if(iS.nextFieldInstructionOf(menuOpCount.path) != null){
                  FieldInstruction i = null;
                  i = (FieldInstruction)iS.prevGETSTATIC();
                  data.addField("MenuNodeList", i.getClassName(cpg)+'.'+i.getFieldName(cpg));
                  return SearchResult.Success;
                }
            }
          }
        }
View Full Code Here

Examples of org.apache.bcel.generic.FieldInstruction

            MethodGen mg = new MethodGen(m, cg.getClassName(), cpg);
            RSClass menu = data.addClass("Menu", c.getValue().getClassName());
            int found = 0;
            InstructionSearcher iS = new InstructionSearcher(mg.getInstructionList(), cpg);
            Instruction i;
            FieldInstruction option;
            FieldInstruction action;
            while(iS.next() != null){
              i = iS.current();
              if(i instanceof ALOAD){
                if(((ALOAD)i).getIndex() == 2){
                  option = iS.nextFieldInstruction();
View Full Code Here

Examples of org.apache.bcel.generic.FieldInstruction

    @Override
    public MatchResult match(InstructionHandle handle, ConstantPoolGen cpg, ValueNumberFrame before, ValueNumberFrame after,
            BindingSet bindingSet) throws DataflowAnalysisException {

        Instruction ins = handle.getInstruction();
        FieldInstruction fieldIns;
        Variable field;

        // The instruction must be PUTFIELD or PUTSTATIC
        if (ins instanceof PUTFIELD) {
            fieldIns = (PUTFIELD) ins;
            int numSlots = before.getNumSlots();
            ValueNumber ref = before.getValue(isLongOrDouble(fieldIns, cpg) ? numSlots - 3 : numSlots - 2);
            field = new FieldVariable(ref, fieldIns.getClassName(cpg), fieldIns.getFieldName(cpg), fieldIns.getSignature(cpg));
        } else if (ins instanceof PUTSTATIC) {
            fieldIns = (PUTSTATIC) ins;
            field = new FieldVariable(fieldIns.getClassName(cpg), fieldIns.getFieldName(cpg), fieldIns.getSignature(cpg));
        } else {
            return null;
        }

        Variable value = snarfFieldValue(fieldIns, cpg, before);
View Full Code Here

Examples of org.apache.bcel.generic.FieldInstruction

     *            ConstantPoolGen of the method containing the instruction
     * @return the Field if the instruction is a read of a field, null otherwise
     */
    public static FieldAnnotation isRead(Instruction ins, ConstantPoolGen cpg) {
        if (ins instanceof GETFIELD || ins instanceof GETSTATIC) {
            FieldInstruction fins = (FieldInstruction) ins;
            String className = fins.getClassName(cpg);
            return new FieldAnnotation(className, fins.getName(cpg), fins.getSignature(cpg), fins instanceof GETSTATIC);
        } else {
            return null;
        }
    }
View Full Code Here

Examples of org.apache.bcel.generic.FieldInstruction

     *            ConstantPoolGen of the method containing the instruction
     * @return the Field if instruction is a write of a field, null otherwise
     */
    public static FieldAnnotation isWrite(Instruction ins, ConstantPoolGen cpg) {
        if (ins instanceof PUTFIELD || ins instanceof PUTSTATIC) {
            FieldInstruction fins = (FieldInstruction) ins;
            String className = fins.getClassName(cpg);
            return new FieldAnnotation(className, fins.getName(cpg), fins.getSignature(cpg), fins instanceof PUTSTATIC);
        } else {
            return null;
        }
    }
View Full Code Here

Examples of org.apache.bcel.generic.FieldInstruction

                        derefs.add(location, valueNumber,
                                PointerUsageRequiringNonNullValue.getReturnFromNonNullMethod(thisMethod));
                    }

                } else if (ins instanceof PUTFIELD || ins instanceof PUTSTATIC) {
                    FieldInstruction inf = (FieldInstruction) ins;
                    XField field = XFactory.createXField(inf, cpg);
                    NullnessAnnotation annotation = AnalysisContext.currentAnalysisContext().getNullnessAnnotationDatabase()
                            .getResolvedAnnotation(field, false);
                    if (annotation == NullnessAnnotation.NONNULL) {
                        ValueNumber valueNumber = valueNumberFrame.getTopValue();
View Full Code Here

Examples of org.apache.bcel.generic.FieldInstruction

            if (opcode != Constants.PUTFIELD && opcode != Constants.PUTSTATIC) {
                continue;
            }

            // Check if field type is a reference type
            FieldInstruction fins = (FieldInstruction) ins;
            Type fieldType = fins.getType(cpg);
            if (!(fieldType instanceof ReferenceType)) {
                continue;
            }

            // Find the exact field being stored into
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.