protected void internalTransform(String phaseName, Map options) { int numAppMethods = 0; for (Iterator mIt = Scene.v().getReachableMethods().listener(); mIt.hasNext();) { final SootMethod m = (SootMethod) mIt.next(); if (isAppMethod(m)) { // System.out.println(m); // assert OnFlyCallGraphBuilder.processedMethods.contains(m) : m // + " not processed!!"; numAppMethods++; } } logger.debug("Number of reachable methods in application: " + numAppMethods); }
protected void initializeUnitToOwner() { for (Iterator<MethodOrMethodContext> iter = Scene.v().getReachableMethods().listener(); iter.hasNext();) { SootMethod m = iter.next().method(); initializeUnitToOwner(m); } }
= 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() &&
methodToContexts = new MethodToContexts(Scene.v().getReachableMethods().listener());
public OnFlyCallGraph(PAG pag, boolean appOnly) { this.pag = pag; callGraph = Scene.v().internalMakeCallGraph(); Scene.v().setCallGraph(callGraph); ContextManager cm = CallGraphBuilder.makeContextManager(callGraph); reachableMethods = Scene.v().getReachableMethods(); ofcgb = new OnFlyCallGraphBuilder(cm, reachableMethods, appOnly); reachablesReader = reachableMethods.listener(); callEdges = cm.callGraph().listener(); }
methodToContexts = new MethodToContexts(Scene.v().getReachableMethods().listener());
public OnFlyCallGraphBuilder(ContextManager cm, ReachableMethods rm) { this.cm = cm; this.rm = rm; worklist = rm.listener(); options = new CGOptions(PhaseOptions.v().getPhaseOptions("cg")); if (!options.verbose()) { logger.debug("" + "[Call Graph] For information on where the call graph may be incomplete," + "use the verbose option to the cg phase."); } if (options.reflection_log() == null || options.reflection_log().length() == 0) { if (options.types_for_invoke() && new SparkOptions(PhaseOptions.v().getPhaseOptions("cg.spark")).enabled()) { reflectionModel = new TypeBasedReflectionModel(); } else { reflectionModel = new DefaultReflectionModel(); } } else { reflectionModel = new TraceBasedReflectionModel(); } this.fh = Scene.v().getOrMakeFastHierarchy(); }
public void build() { QueueReader<MethodOrMethodContext> worklist = reachables.listener(); while (true) { ofcgb.processReachables();
public void reset() { if (methodToContexts == null) { methodToContexts = new MethodToContexts(Scene.v().getReachableMethods().listener()); } if (Scene.v().hasCallGraph()) { SootClass sc = Scene.v().getMainClass(); SootMethod sm = getFirstMethod(sc); // logger.debug("got first method"); ArrayList<MethInfo> tgts = getTgtMethods(sm, true); // logger.debug("got tgt methods"); ArrayList<MethInfo> srcs = getSrcMethods(sm, true); // logger.debug("got src methods"); CallGraphInfo info = new CallGraphInfo(sm, tgts, srcs); // logger.debug("will handle new call graph"); InteractionHandler.v().handleCallGraphStart(info, this); } }
n_reach_spark_user_methods = 0; id = 1; QueueReader<MethodOrMethodContext> smList = Scene.v().getReachableMethods().listener(); CallGraph soot_callgraph = Scene.v().getCallGraph();
protected Collection<SootMethod> getMethodsForSeeds(IInfoflowCFG icfg) { List<SootMethod> seeds = new LinkedList<SootMethod>(); // If we have a callgraph, we retrieve the reachable methods. Otherwise, // we have no choice but take all application methods as an // approximation if (Scene.v().hasCallGraph()) { ReachableMethods reachableMethods = Scene.v().getReachableMethods(); reachableMethods.update(); for (Iterator<MethodOrMethodContext> iter = reachableMethods.listener(); iter.hasNext();) { SootMethod sm = iter.next().method(); if (isValidSeedMethod(sm)) seeds.add(sm); } } else { long beforeSeedMethods = System.nanoTime(); Set<SootMethod> doneSet = new HashSet<SootMethod>(); for (SootMethod sm : Scene.v().getEntryPoints()) getMethodsForSeedsIncremental(sm, doneSet, seeds, icfg); logger.info("Collecting seed methods took {} seconds", (System.nanoTime() - beforeSeedMethods) / 1E9); } return seeds; }
public OnFlyCallGraphBuilder( ContextManager cm, ReachableMethods rm ) { this.cm = cm; this.rm = rm; worklist = rm.listener(); options = new CGOptions( PhaseOptions.v().getPhaseOptions("cg") ); if( !options.verbose() ) { G.v().out.println( "[Call Graph] For information on where the call graph may be incomplete, use the verbose option to the cg phase." ); } // if(options.reflection_log()==null || options.reflection_log().length()==0) { reflectionModel = new DefaultReflectionModel(); // } else { // reflectionModel = new TraceBasedReflectionModel(); // } } public OnFlyCallGraphBuilder( ContextManager cm, ReachableMethods rm, boolean appOnly ) {
public OnFlyCallGraphBuilder( ContextManager cm, ReachableMethods rm ) { this.cm = cm; this.rm = rm; worklist = rm.listener(); options = new CGOptions( PhaseOptions.v().getPhaseOptions("cg") ); if( !options.verbose() ) { G.v().out.println( "[Call Graph] For information on where the call graph may be incomplete, use the verbose option to the cg phase." ); } // if(options.reflection_log()==null || options.reflection_log().length()==0) { reflectionModel = new DefaultReflectionModel(); // } else { // reflectionModel = new TraceBasedReflectionModel(); // } } public OnFlyCallGraphBuilder( ContextManager cm, ReachableMethods rm, boolean appOnly ) {
public void build() { QueueReader worklist = reachables.listener(); while(true) { ofcgb.processReachables();
public void build() { QueueReader worklist = reachables.listener(); while(true) { ofcgb.processReachables();
methodToContexts = new MethodToContexts( Scene.v().getReachableMethods().listener() );
methodToContexts = new MethodToContexts( Scene.v().getReachableMethods().listener() );
Iterator<MethodOrMethodContext> rmIterator = Scene.v().getReachableMethods().listener(); while (rmIterator.hasNext()) { SootMethod sm = rmIterator.next().method();
public void reset() { if (methodToContexts == null){ methodToContexts = new MethodToContexts(Scene.v().getReachableMethods().listener()); } if(Scene.v().hasCallGraph()) { SootClass sc = Scene.v().getMainClass(); SootMethod sm = getFirstMethod(sc); //G.v().out.println("got first method"); ArrayList<MethInfo> tgts = getTgtMethods(sm, true); //G.v().out.println("got tgt methods"); ArrayList<MethInfo> srcs = getSrcMethods(sm, true); //G.v().out.println("got src methods"); CallGraphInfo info = new CallGraphInfo(sm, tgts, srcs); //G.v().out.println("will handle new call graph"); InteractionHandler.v().handleCallGraphStart(info, this); } }
public void reset() { if (methodToContexts == null){ methodToContexts = new MethodToContexts(Scene.v().getReachableMethods().listener()); } if(Scene.v().hasCallGraph()) { SootClass sc = Scene.v().getMainClass(); SootMethod sm = getFirstMethod(sc); //G.v().out.println("got first method"); ArrayList<MethInfo> tgts = getTgtMethods(sm, true); //G.v().out.println("got tgt methods"); ArrayList<MethInfo> srcs = getSrcMethods(sm, true); //G.v().out.println("got src methods"); CallGraphInfo info = new CallGraphInfo(sm, tgts, srcs); //G.v().out.println("will handle new call graph"); InteractionHandler.v().handleCallGraphStart(info, this); } }