Package smart.updater

Examples of smart.updater.RSClass


public class NPCDefName extends Search{

  @Override
  public SearchResult run(RSClient data, HashMap<String, ClassGen> classes) {
    RSClass npcDef = data.getProperClass("NPCDef");
    for(Entry<String, ClassGen> c : classes.entrySet()){
      if(c.getValue().getClassName().equals(npcDef.className)){
        int count = 0;
        for(Field f : c.getValue().getFields()){
          if(!f.isStatic()){
            if(f.getType().equals(Type.STRING)){
              npcDef.addField("GetName", f.getName());
              count++;
            }
            if(f.getType().toString().equals("java.lang.String[]")){
              npcDef.addField("GetActions", f.getName());
              count++;
            }
            if(count == 2)
              return SearchResult.Success;
          }
View Full Code Here


                        String plane = ((GETFIELD) handles[1].getInstruction()).getFieldName(cpg);
                        String animx = ((GETFIELD) handles[4].getInstruction()).getFieldName(cpg);
                        String animy = ((GETFIELD) handles[11].getInstruction()).getFieldName(cpg);
                        String basex = ((GETSTATIC) handles[7].getInstruction()).getClassName(cpg) + "." + ((GETSTATIC) handles[7].getInstruction()).getFieldName(cpg);
                        String basey = ((GETSTATIC) handles[14].getInstruction()).getClassName(cpg) + "." + ((GETSTATIC) handles[14].getInstruction()).getFieldName(cpg);
                        RSClass animableClass = data.addClass("Animable", animable);
                        animableClass.addField("PixelX", animx);
                        animableClass.addField("PixelY", animy);
                        animableClass.addField("Plane", plane);
                        data.addField("MyPlayer", myplayer);
                        data.addField("BaseX", basex);
                        data.addField("BaseY", basey);
                        String player = ((GETSTATIC) handles[0].getInstruction()).getType(cpg).getSignature().replaceAll("L|;", "");
                        data.addClass("Player", player);
View Full Code Here

public class NPCLevel extends Search{

  @Override
  public SearchResult run(RSClient data, HashMap<String, ClassGen> classes) {
    RSClass npcDef = data.getProperClass("NPCDef");
    for(Entry<String, ClassGen> c : classes.entrySet()){
      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

public class Interacting extends Search{
 
  @Override
  public SearchResult run(RSClient data, HashMap<String, ClassGen> classes) {
    RSClass character = data.getProperClass("Character");
    for(Entry<String, ClassGen> c : classes.entrySet()){
      ClassGen cg = new ClassGen(c.getValue().getJavaClass());
      ConstantPoolGen cpg = cg.getConstantPool();
      for(Method m : cg.getMethods()){
        MethodGen mg = new MethodGen(m, c.getValue().getClassName(), cpg);
        MethodSearcher mS = new MethodSearcher(m, cg, cpg);
        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

public class CharacterHeight extends Search{

  @Override
  public SearchResult run(RSClient data, HashMap<String, ClassGen> classes) {
    RSClass character = data.getProperClass("Character");
    for(Entry<String, ClassGen> c : classes.entrySet()){
      if(c.getValue().getClassName().equals(character.className)){
        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

import smart.updater.Search.SearchResult;

public class NodeNext extends Search{

  public String findNextNode(RSClient data, HashMap<String, ClassGen> classes){
    RSClass nodeClass = data.getProperClass("Node");
    for(Entry<String, ClassGen> c : classes.entrySet()){
      ClassGen cg = new ClassGen(c.getValue().getJavaClass());
      ConstantPoolGen cpg = c.getValue().getConstantPool();
      for(Method m : c.getValue().getMethods()){
        MethodSearcher mS = new MethodSearcher(m, cg, cpg);
        if(m.isSynchronized() && m.isFinal() && m.getReturnType().equals(Type.VOID)
            && mS.getTypeCount("int[]") == 1){
          MethodGen mg = new MethodGen(m, c.getValue().getClassName(), cpg);
          InstructionList il = mg.getInstructionList();
          for(Instruction i : il.getInstructions()){
            if(i instanceof FieldInstruction){
              if(((FieldInstruction) i).getClassName(cpg).equals(nodeClass.className)){
                nodeClass.addField("Next", ((FieldInstruction) i).getFieldName(cpg));
                return ((FieldInstruction) i).getFieldName(cpg);
             
            }
          }
        }
View Full Code Here

  public SearchResult run(RSClient data, HashMap<String, ClassGen> classes)
  {
    String nextNode = findNextNode(data, classes);
    if (nextNode == null)
      return SearchResult.Failure;
    RSClass nodeClass = data.getProperClass("Node");
    for(Entry<String, ClassGen> c : classes.entrySet()){
      if(c.getValue().getClassName().equals(nodeClass.className)){
        for(Field f : c.getValue().getFields()){
          if(f.getType().toString().equals(nodeClass.className) &&
              !f.getName().equals(nextNode)){
            nodeClass.addField("Previous", f.getName());
            return SearchResult.Success;
          }
          if(f.getType().equals(Type.LONG))
            nodeClass.addField("GetID", f.getName());
        }
      }
    }
    return SearchResult.Failure;
  }
View Full Code Here

public class NPCNode extends Search{

  @Override
  public SearchResult run(RSClient data, HashMap<String, ClassGen> classes) {
    RSClass npc = data.getProperClass("NPC");
    for(Entry<String, ClassGen> c : classes.entrySet()){
      if(c.getValue().isFinal()){
        ClassGen cg = new ClassGen(c.getValue().getJavaClass());
        ConstantPoolGen cpg = cg.getConstantPool();
        for(Method m : c.getValue().getMethods()){
          MethodSearcher mS = new MethodSearcher(m, cg, cpg);
          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

                    }
                    if (!field.isStatic() && field.getName().equals("nativeid")) {
                        continue classloop;
                    }
                }
                RSClass sdtoolkit = data.addClass("SDToolkit", clazz.getClassName());
                for (Method m : clazz.getMethods()) {
                    if (!m.isStatic()) {
                        for (Type t : m.getArgumentTypes()) {
                            if (t instanceof ArrayType && ((ArrayType) t).getBasicType() == Type.INT) {
                                ConstantPoolGen cpg = clazz.getConstantPool();
                                MethodGen gen = new MethodGen(m, clazz.getClassName(), cpg);
                                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()) {
                                        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()) {
                                                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]);
                                                    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);
                                                        sdtoolkit.addField("xMax", xmax);
                                                        sdtoolkit.addField("yMin", ymin);
                                                        sdtoolkit.addField("yMax", ymax);
                                                        sdtoolkit.addField("zMin", zmin);
                                                        sdtoolkit.addField("zMax", zmax);
                                                        sdtoolkit.addField("xScale", xscale);
                                                        sdtoolkit.addField("yScale", yscale);
                                                        for (Field field : clazz.getFields()) {
                                                            if (!field.isStatic() && field.getSignature().contains(data.getProperClass("SDViewport").className)) {
                                                                sdtoolkit.addField("Viewport", field.getName());
                                                                return true;
                                                            }
                                                        }
                                                    }
                                                }
View Full Code Here

                        twodintarrayhits++;
                        groundheights = field;
                    }
                }
                if (twodintarrayhits == 1) {
                    RSClass sdplane = data.addClass("SDPlane", clazz.getClassName());
                    sdplane.addField("TileHeights", groundheights.getName());
                    return true;
                }
            }
        }
        return false;
View Full Code Here

TOP

Related Classes of smart.updater.RSClass

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.