Package soot

Examples of soot.SootMethod


            if( !worklist.hasNext() ) {
                rm.update();
                if( !worklist.hasNext() ) break;
            }
            MethodOrMethodContext momc = (MethodOrMethodContext) worklist.next();
            SootMethod m = momc.method();
            if( appOnly && !m.getDeclaringClass().isApplicationClass() ) continue;
            if( analyzedMethods.add( m ) ) processNewMethod( m );
            processNewMethodContext( momc );
        }
    }
View Full Code Here


                        site.subSig(),
                        site.container(),
                        targetsQueue );
            }
            while(targets.hasNext()) {
                SootMethod target = (SootMethod) targets.next();
                cm.addVirtualEdge(
                        MethodContext.v( site.container(), srcContext ),
                        site.stmt(),
                        target,
                        site.kind(),
View Full Code Here

                    if( subSig == sigStart ) {
                        addVirtualCallSite( s, m, receiver, iie, sigRun,
                                Kind.THREAD );
                    }
                } else {
                  SootMethod tgt = ie.getMethod();
                  addEdge(m, s, tgt);
                  if( tgt.getSignature().equals( "<java.security.AccessController: java.lang.Object doPrivileged(java.security.PrivilegedAction)>" )
                      ||  tgt.getSignature().equals( "<java.security.AccessController: java.lang.Object doPrivileged(java.security.PrivilegedExceptionAction)>" )
                      ||  tgt.getSignature().equals( "<java.security.AccessController: java.lang.Object doPrivileged(java.security.PrivilegedAction,java.security.AccessControlContext)>" )
                      ||  tgt.getSignature().equals( "<java.security.AccessController: java.lang.Object doPrivileged(java.security.PrivilegedExceptionAction,java.security.AccessControlContext)>" ) ) {
                   
                    Local receiver = (Local) ie.getArg(0);
                    addVirtualCallSite( s, m, receiver, null, sigObjRun,
                        Kind.PRIVILEGED );
                  }                     
View Full Code Here

        final Tag unknown = new StringTag( "Untagged Spark node" );
        final Map<Node, Tag> nodeToTag = pag.getNodeTags();
        for( Iterator cIt = Scene.v().getClasses().iterator(); cIt.hasNext(); ) {
            final SootClass c = (SootClass) cIt.next();
            for( Iterator mIt = c.methodIterator(); mIt.hasNext(); ) {
                SootMethod m = (SootMethod) mIt.next();
                if( !m.isConcrete() ) continue;
                if( !m.hasActiveBody() ) continue;
                for( Iterator sIt = m.getActiveBody().getUnits().iterator(); sIt.hasNext(); ) {
                    final Stmt s = (Stmt) sIt.next();
                    if( s instanceof DefinitionStmt ) {
                        Value lhs = ((DefinitionStmt) s).getLeftOp();
                        VarNode v = null;
                        if( lhs instanceof Local ) {
View Full Code Here

        int varMass = 0;
        int adfs = 0;
        int scalars = 0;
        if( false ) {
            for( Iterator it = Scene.v().getReachableMethods().listener(); it.hasNext(); ) {
                SootMethod m = (SootMethod) it.next();
                G.v().out.println( m.getBytecodeSignature() );
            }
        }


        for( Iterator vIt = pag.getVarNodeNumberer().iterator(); vIt.hasNext(); ) {
View Full Code Here

            }
        }
    }

    private void processNewMethodContext( MethodOrMethodContext momc ) {
        SootMethod m = momc.method();
        Object ctxt = momc.context();
        Iterator it = cicg.edgesOutOf(m);
        while( it.hasNext() ) {
            Edge e = (Edge) it.next();
            cm.addStaticEdge( momc, e.srcUnit(), e.tgt(), e.kind() );
View Full Code Here

             
      CallGraph cg = Scene.v().getCallGraph();
      ReachableMethods reachableMethods = new ReachableMethods(cg,Collections.<MethodOrMethodContext>singletonList(container));
      reachableMethods.update();
      for (Iterator<MethodOrMethodContext> iterator = reachableMethods.listener(); iterator.hasNext();) {
        SootMethod m = (SootMethod) iterator.next();
        if(m.hasActiveBody() &&
        //exclude static initializer of same class (assume that it has already been executed)
         !(m.getName().equals(SootMethod.staticInitializerName) && m.getDeclaringClass().equals(container.getDeclaringClass()))) {       
          for (Unit u : m.getActiveBody().getUnits()) {
            List<ValueBox> defBoxes = u.getDefBoxes();
            for (ValueBox defBox : defBoxes) {
              Value value = defBox.getValue();
              if(value instanceof FieldRef) {
                usedFieldRefs.remove(new EquivalentValue(value));
View Full Code Here

        registerGuard(container, newInstanceInvokeStmt, "Class.newInstance() call site; Soot did not expect this site to be reached");
      } else {
        for (String clsName : classNames) {
          SootClass cls = Scene.v().getSootClass(clsName);
          if( cls.declaresMethod(sigInit) ) {
            SootMethod constructor = cls.getMethod(sigInit);
            addEdge( container, newInstanceInvokeStmt, constructor, Kind.REFL_CLASS_NEWINSTANCE );
          }
        }
      }
    }
View Full Code Here

      Set<String> constructorSignatures = reflectionInfo.constructorNewInstanceSignatures(container);
      if(constructorSignatures==null || constructorSignatures.isEmpty()) {
        registerGuard(container, newInstanceInvokeStmt, "Constructor.newInstance(..) call site; Soot did not expect this site to be reached");
      } else {
        for (String constructorSignature : constructorSignatures) {
          SootMethod constructor = Scene.v().getMethod(constructorSignature);
          addEdge( container, newInstanceInvokeStmt, constructor, Kind.REFL_CONSTR_NEWINSTANCE );
        }
      }
    }
View Full Code Here

      Set<String> methodSignatures = reflectionInfo.methodInvokeSignatures(container);
      if (methodSignatures == null || methodSignatures.isEmpty()) {
        registerGuard(container, invokeStmt, "Method.invoke(..) call site; Soot did not expect this site to be reached");
      } else {
        for (String methodSignature : methodSignatures) {
          SootMethod method = Scene.v().getMethod(methodSignature);
          addEdge( container, invokeStmt, method, Kind.REFL_INVOKE );
        }
      }
    }
View Full Code Here

TOP

Related Classes of soot.SootMethod

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.