Package smart.updater

Examples of smart.updater.InstructionSearcher


        ConstantPoolGen cpg = c.getValue().getConstantPool();
        for(Method m : c.getValue().getMethods()){
          if(m.getName().equals("<init>")){
            MethodGen mg = new MethodGen(m, c.getValue().getClassName(), cpg);
            InstructionList il = mg.getInstructionList();
            InstructionSearcher iS = new InstructionSearcher(il, cpg);
            while(iS.next() != null){
              Instruction i = iS.current();
              if(i instanceof LDC){
                if(((LDC) i).getValue(cpg).equals(-32768)){
                  i = iS.nextPUTFIELD();
                  character.addField("GetHeight", ((PUTFIELD) i).getFieldName(cpg));
                  return SearchResult.Success;
                }
              }
            }
View Full Code Here


          if(m.getName().equals("<init>") && mS.getTypeCount(npc.className) == 1 &&
              mS.getArgCount() == 1){
            RSClass npcnode = data.addClass("NPCNode", c.getValue().getClassName());
            MethodGen mg = new MethodGen(m, cg.getClassName(), cpg);
            InstructionList il = mg.getInstructionList();
            InstructionSearcher iS = new InstructionSearcher(il, cpg);
            Instruction i = iS.nextPUTFIELD();
            npcnode.addField("GetNPC", ((PUTFIELD) i).getFieldName(cpg));
            return SearchResult.Success;
          }
        }
      }
View Full Code Here

                      InstructionList il = gen.getInstructionList();
                      if (il == null) {
                          continue;
                      }
                      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

            for (Method m : c.getValue().getMethods()){
              MethodSearcher mS = new MethodSearcher(m, cg, cpg);
              if(mS.getTypeCount("java.awt.Canvas") >= 1 && m.getName().equals("<init>")){
                MethodGen mg = new MethodGen(m, c.getValue().getClassName(), cpg);
                InstructionList il = mg.getInstructionList();
                InstructionSearcher iS = new InstructionSearcher(il, cpg);
                Instruction i = iS.nextNEW();
                data.addClass("NodeList", ((NEW)i).getLoadClassType(cpg).getClassName());
                return(((NEW)i).getLoadClassType(cpg).getClassName());
              }
            }
          }
View Full Code Here

            MethodGen gen = new MethodGen(m, c.getValue().getClassName(), cpg);
              InstructionList il = gen.getInstructionList();
              if (il == null) {
                 continue;
              }
              InstructionSearcher iS = new InstructionSearcher(il, cpg);
            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

            InstructionFinder f = new InstructionFinder(il);
            Iterator e = f.search("INVOKEVIRTUAL CHECKCAST GETFIELD ASTORE ALOAD GETFIELD IFEQ");
            if(e.hasNext()){
              InstructionHandle[] handles = (InstructionHandle[]) e.next();
              String getHits = ((GETFIELD) handles[5].getInstruction()).getFieldName(cpg);
              InstructionSearcher iS = new InstructionSearcher(il, cpg);
              iS.nextGETSTATIC();
              iS.nextGETSTATIC();
              String npcIndexArray = ((GETSTATIC)iS.current()).getClassName(cpg)+'.'+((GETSTATIC)iS.current()).getFieldName(cpg);
              data.addField("NPCIndexArray", npcIndexArray);
              RSClass character = data.getProperClass("Character");
              character.addField("GetHitDamges", getHits);
              return SearchResult.Success;
            }
View Full Code Here

          if(m.getName().equals("<init>") && mS.getArgCount() == 10 &&
              mS.getTypeCount("int") == 5 && mS.getTypeCount("java.lang.String")==2){
            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();
                  menu.addField("Option", option.getFieldName(cpg));
                  found++;
                  if(found==2)
                    return SearchResult.Success;
                }
                if(((ALOAD)i).getIndex() == 1){
                  option = iS.nextFieldInstruction();
                  menu.addField("Action", option.getFieldName(cpg));
                  found++;
                  if(found==2)
                    return SearchResult.Success;
                }
View Full Code Here

TOP

Related Classes of smart.updater.InstructionSearcher

Copyright © 2018 www.massapicom. 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.