Package soot.rbclassload

Examples of soot.rbclassload.ClassHierarchy


public class ConcreteMethods {

  public List<String> get(String signature){
    MethodSignatureUtil util = new MethodSignatureUtil();
   
    ClassHierarchy class_hierarchy = RootbeerClassLoader.v().getClassHierarchy();
    List<String> virtual_methods = class_hierarchy.getVirtualMethods(signature);
   
    List<String> ret = new ArrayList<String>();
    for(String virt_method : virtual_methods){
      util.parse(virt_method);
      SootMethod method = util.getSootMethod();
View Full Code Here


    return hash;
  }

  private List<NumberedType> getTypeList(SootClass soot_class) {
   
    ClassHierarchy class_hierarchy = RootbeerClassLoader.v().getClassHierarchy();
    HierarchyGraph hgraph = class_hierarchy.getHierarchyGraph();

    Set<Integer> visited = new TreeSet<Integer>();
    visited.add(StringNumbers.v().addString(soot_class.getName()));
    LinkedList<String> queue = new LinkedList<String>();
    queue.add(soot_class.getName());
   
    Set<Integer> new_invokes = RootbeerClassLoader.v().getNewInvokes();
    List<NumberedType> ret = new ArrayList<NumberedType>();
   
    while(queue.isEmpty() == false){
      String entry = queue.removeFirst();
      Integer num = StringNumbers.v().addString(entry);
      if(new_invokes.contains(num)){
        NumberedType ntype = class_hierarchy.getNumberedType(entry);
        ret.add(ntype);
      }
     
      Set<Integer> children = hgraph.getChildren(num);
      for(Integer child : children){
View Full Code Here

    String signature = soot_method.getSignature();
   
    ConcreteMethods concrete_method_finder = new ConcreteMethods();
    List<String> concrete_methods = concrete_method_finder.get(signature);
   
    ClassHierarchy class_hierarchy = RootbeerClassLoader.v().getClassHierarchy();
    List<String> virtual_methods = class_hierarchy.getVirtualMethods(signature);
   
    String base_sig = virtual_methods.get(0);
    m_util.parse(base_sig);
    m_baseMethod = m_util.getSootMethod();
       
View Full Code Here

    }
    return ret;
  }
 
  private List<SootMethod> getVirtualMethods(){
    ClassHierarchy class_hierarchy = RootbeerClassLoader.v().getClassHierarchy();
    List<String> virtual_methods = class_hierarchy.getVirtualMethods(m_sootMethod.getSignature());
    List<SootMethod> ret = new ArrayList<SootMethod>();
    for(String virtual_method : virtual_methods){
      m_util.parse(virtual_method);
      SootMethod soot_method = m_util.getSootMethod();
      if(soot_method.isConcrete()){
View Full Code Here

      }
      m_testCase = new_test_case;
    }
    m_provider = m_testCase;
   
    ClassHierarchy class_hierarchy = RootbeerClassLoader.v().getClassHierarchy();
    HierarchySootClass prov_class = class_hierarchy.getHierarchySootClass(m_provider);
    HierarchySootMethod create_method = prov_class.findMethodByName("create");
    HierarchySootClass kernel_class = searchMethod(create_method);
    HierarchySootMethod gpu_method = kernel_class.findMethodBySubSignature("void gpuMethod()");
    m_signature = gpu_method.getSignature();
    m_initialized = true;
View Full Code Here

  public String getProvider() {
    return m_provider;
  }
   
  private HierarchySootClass searchMethod(HierarchySootMethod method) {
    ClassHierarchy class_hierarchy = RootbeerClassLoader.v().getClassHierarchy();
    List<HierarchyInstruction> instructions = method.getInstructions();
    for(HierarchyInstruction inst : instructions){
      String name = inst.getName();
      if(name.equals("new")){
        List<Operand> operands = inst.getOperands();
        for(Operand operand : operands){
          if(operand.getType().equals("class_ref") == false){
            continue;
          }
          String class_name = operand.getValue();
          HierarchySootClass hclass = class_hierarchy.getHierarchySootClass(class_name);
          List<String> ifaces = hclass.getInterfaces();
          for(String iface : ifaces){
            if(iface.equals("org.trifort.rootbeer.runtime.Kernel")){
              return hclass;
            }
View Full Code Here

       
    StringToType converter = new StringToType();
    FieldSignatureUtil futil = new FieldSignatureUtil();
   
    //load all virtual methods to be followed
    ClassHierarchy class_hierarchy = RootbeerClassLoader.v().getClassHierarchy();
    List<HierarchySignature> virt_methods = class_hierarchy.getVirtualMethods(signature);
    for(HierarchySignature virt_method : virt_methods){
      if(virt_method.equals(signature) == false){
        queue.add(virt_method);
      }
    }
View Full Code Here

    bcl_mem.incrementAddress(3);
    Local ctor_used = bcl_mem.readByte();
    Local class_number = bcl_mem.readInt();
   
    ClassHierarchy class_hierarchy = RootbeerClassLoader.v().getClassHierarchy();
    long string_number = class_hierarchy.getNumberForType("java.lang.String");
   
    //create readers for String and char[]
    Local ret;

    String after_ctors_label = getNextLabel();
View Full Code Here

    }
   
    String label = getNextLabel();
    BytecodeLanguage bcl = m_bcl.top();
       
    ClassHierarchy class_hierarchy = RootbeerClassLoader.v().getClassHierarchy();
    long number = class_hierarchy.getNumberForType(type.toString());
   
    bcl.ifStmt(class_number, "!=", IntConstant.v((int) number), label);
   
    Local ret;
    if(type instanceof ArrayType){
View Full Code Here

    List<TreeNode> all_tree_nodes = new ArrayList<TreeNode>();
   
    Set<Type> dfs_types = RootbeerClassLoader.v().getDfsInfo().getDfsTypes();
    Set<String> dfs_string_types = getRefTypes(dfs_types);
   
    ClassHierarchy class_hierarchy = RootbeerClassLoader.v().getClassHierarchy();
    SootClass obj_class = Scene.v().getSootClass("java.lang.Object");
    HierarchyGraph hgraph = class_hierarchy.getHierarchyGraph();
    Set<Integer> roots = hgraph.getChildren(0);   //java.lang.Object is 0
   
    for(Integer root : roots){   
      String root_name = StringNumbers.v().getString(root);
      SootClass root_class = Scene.v().getSootClass(root_name);
View Full Code Here

TOP

Related Classes of soot.rbclassload.ClassHierarchy

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.