Package smart.updater

Examples of smart.updater.InstructionSearcher2


    for(Entry<String, ClassGen> c : classes.entrySet()){
      if(c.getValue().getClassName().equals("client")){
        ClassGen cg = new ClassGen(c.getValue().getJavaClass());
        ConstantPoolGen cpg = cg.getConstantPool();
        for(Method m : cg.getMethods()){
          InstructionSearcher2 iS = new InstructionSearcher2(cg, m);
          if(iS.nextSIPUSH(1500)!= null){
            FieldInstruction fi = iS.previousFieldInstruction();
            data.addField("LoopCycle", fi.getClassName(cpg)+'.'+fi.getFieldName(cpg));
            return SearchResult.Success;
          }
        }
      }
View Full Code Here


                    if (il == null) {
                        continue;
                    }
                    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()){
View Full Code Here

      if(c.getValue().getClassName().equals(npcDef.className)){
        ClassGen cg = new ClassGen(c.getValue().getJavaClass());
        ConstantPoolGen cpg = c.getValue().getConstantPool();
        for(Method m : c.getValue().getMethods()){
          if(m.getReturnType().equals(Type.VOID)){
            InstructionSearcher2 search = new InstructionSearcher2(cg, m);
            while(search.nextBIPUSH() != null) {
              Instruction i = search.current();
              if(((BIPUSH)i).getValue().intValue() == -98 || ((BIPUSH)i).getValue().intValue() == 97){
                FieldInstruction npcLevel = search.previousFieldInstruction();
                npcDef.addField("GetLevel", npcLevel.getFieldName(cpg));
                return SearchResult.Success;
              }
            }
          }
View Full Code Here

      for(Method m : c.getValue().getMethods()){
        if(m.isFinal() && m.isStatic() && m.getReturnType().equals(Type.VOID)){
          MethodGen mg = new MethodGen(m, cg.getClassName(), cpg);
          InstructionList il = mg.getInstructionList();
          if(il != null){
            InstructionSearcher2 iS = new InstructionSearcher2(cg, m, il);
            if(iS.nextLDC("gnp2 pos:") != null){
              FieldInstruction fi = iS.nextFieldInstruction();
              data.addField("NPCCount", fi.getClassName(cpg)+'.'+fi.getFieldName(cpg));
              return SearchResult.Success;
            }
          }
        }
View Full Code Here

        if(m.isStatic() && m.isFinal() && m.getReturnType().equals(Type.INT) && mS.getArgCount() == 2
            && mS.getTypeCount(character.className) == 1){
          InstructionList il = mg.getInstructionList();
          if(il == null)
            continue;
          InstructionSearcher2 iS = new InstructionSearcher2(cg, m, il);
          while(iS.nextLDC() != null){
            LDC i = (LDC) iS.current();
            if(i.getValue(cpg).equals(-32769) || i.getValue(cpg).equals(32768)){
              FieldInstruction fi = iS.previousFieldInstruction();
              if(fi.getClassName(cpg).equals(character.className)){
                character.addField("GetInteracting", fi.getFieldName(cpg));
                return SearchResult.Success;
              }
            }
View Full Code Here

                  mS.getArgCount() == 4 && mS.getTypeCount(player.className) == 1){
                    InstructionList il = gen.getInstructionList();
                    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)){
                                  character.addField("Motion", gf.getFieldName(cpg));
                                  return SearchResult.Success;
                                }
                              }
View Full Code Here

          ConstantPoolGen cpg = cg.getConstantPool();
          MethodGen mg = new MethodGen(m, cg.getClassName(), cpg);
          InstructionList il = mg.getInstructionList();
          if(il == null)
            continue;
          InstructionSearcher2 iS = new InstructionSearcher2(cg, m, il);
          if(iS.nextSIPUSH(2048) != null){
            ANEWARRAY na = iS.nextANEWARRAY();
            if(na != null && na.getLoadClassType(cpg).toString().equals(player.className)){
              FieldInstruction fi = iS.nextFieldInstruction();
              data.addField("GetPlayers", fi.getClassName(cpg)+'.'+fi.getFieldName(cpg));
              return SearchResult.Success;
            }
          }
        }
View Full Code Here

            ConstantPoolGen cpg = cg.getConstantPool();
            MethodGen mg = new MethodGen(m, cg.getClassName(), cpg);
            InstructionList il = mg.getInstructionList();
            if(il == null)
              continue;
            InstructionSearcher2 iS = new InstructionSearcher2(cg, m, il);
            if(iS.nextSIPUSH(200)!= null){
              if(iS.nextBIPUSH(50)!= null){
                iS = new InstructionSearcher2(cg, m, il);
                FieldInstruction fi = iS.nextGETSTATIC();
                data.addField("PlayerCount", fi.getClassName(cpg)+'.'+fi.getFieldName(cpg));
                fi = iS.nextGETSTATIC();
                data.addField("PlayerIndexArray", fi.getClassName(cpg)+'.'+fi.getFieldName(cpg));
                return SearchResult.Success;
              }
            }
          }
View Full Code Here

        if(m.isStatic() && m.isFinal() && m.getReturnType().equals(Type.VOID) &&
            mS.getTypeCount(player.className) == 1){
          InstructionList il = mg.getInstructionList();
          if(il == null)
            continue;
          InstructionSearcher2 iS = new InstructionSearcher2(cg, m, il);
          if(iS.nextSIPUSH(-300) != null){
            FieldInstruction fi = iS.previousGETSTATIC();
            if(fi != null && (fi.getClassName(cpg)+'.'+fi.getFieldName(cpg)).equals(loopcycle.path)){
              fi = iS.nextPUTFIELD();
              if(fi != null && fi.getClassName(cpg).equals(character.className)){
                character.addField("LoopCycleStatus", fi.getFieldName(cpg));
                return SearchResult.Success;
              }
            }
View Full Code Here

            && m.getArgumentTypes().length == 2){
          MethodGen mg = new MethodGen(m, cg.getClassName(), cpg);
          InstructionList il = mg.getInstructionList();
          if(il == null)
            continue;
          InstructionSearcher2 iS = new InstructionSearcher2(cg, m, il);
          if(iS.nextSIPUSH(3326) != null){
            FieldInstruction fi = iS.nextGETFIELD();
            FieldInstruction tester = iS.previousGETSTATIC();
            if((tester.getClassName(cpg)+'.'+tester.getFieldName(cpg)).equals(myplayer.path)){
              player.addField("GetLevel", fi.getFieldName(cpg));
              count++;
              if(count==2)
                return SearchResult.Success;
            }
          }
          iS = new InstructionSearcher2(cg, m, il);
          if(iS.nextSIPUSH(5015) != null){
            FieldInstruction fi = iS.nextGETSTATIC();
            if(fi != null && (fi.getClassName(cpg)+'.'+fi.getFieldName(cpg)).equals(myplayer.path)){
              fi = iS.nextGETFIELD();
              if(fi != null && fi.getType(cpg).equals(Type.STRING)){
                player.addField("GetName", fi.getFieldName(cpg));
                count++;
                if(count==2)
                  return SearchResult.Success;
View Full Code Here

TOP

Related Classes of smart.updater.InstructionSearcher2

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.