public ReachableMethods getReachableMethods() { if (reachableMethods == null) { reachableMethods = new ReachableMethods(getCallGraph(), new ArrayList<MethodOrMethodContext>(getEntryPoints())); } reachableMethods.update(); return reachableMethods; }
public CallChain getNextCallChainBetween(SootMethod start, SootMethod goal, List previouslyFound) { // callChains.add(new LinkedList()); // Represents the one way to get from goal to goal (which is to already be there) // Is this worthwhile? Fast? Slow? Broken? Applicable inside the recursive method? // If method is unreachable, don't bother trying to make chains // CACHEABLE? ReachableMethods rm = null; if (rmCache.containsKey(start)) { rm = rmCache.get(start); } else { List<MethodOrMethodContext> entryPoints = new ArrayList<MethodOrMethodContext>(); entryPoints.add(start); rm = new ReachableMethods(cg, entryPoints); rm.update(); rmCache.put(start, rm); } if (rm.contains(goal)) { // Set methodsInAnyChain = new HashSet(); // methodsInAnyChain.add(goal); return getNextCallChainBetween(rm, start, goal, null, null, previouslyFound); } return null; // new ArrayList(); }
private void processReachables() { reachableMethods.update(); while (reachablesReader.hasNext()) { MethodOrMethodContext m = reachablesReader.next(); MethodPAG mpag = MethodPAG.v(pag, m.method()); mpag.build(); mpag.addToPAG(m.context()); } }
public void processReachables() { while (true) { if (!worklist.hasNext()) { rm.update(); if (!worklist.hasNext()) { break; } } MethodOrMethodContext momc = worklist.next(); SootMethod m = momc.method(); if (appOnly && !m.getDeclaringClass().isApplicationClass()) { continue; } if (analyzedMethods.add(m)) { processNewMethod(m); } processNewMethodContext(momc); } }
ReachableMethods reachableMethods = new ReachableMethods(cg, Collections.<MethodOrMethodContext>singletonList(container)); reachableMethods.update(); for (Iterator<MethodOrMethodContext> iterator = reachableMethods.listener(); iterator.hasNext();) { SootMethod m = (SootMethod) iterator.next();
while (true) { ofcgb.processReachables(); reachables.update(); if (!worklist.hasNext()) { break;
ofcg.build(); reachables = ofcg.reachableMethods(); reachables.update(); } else { callEdges = cgb.getCallGraph().listener();
public ReachableMethods getReachableMethods() { if( reachableMethods == null ) { reachableMethods = new ReachableMethods( getCallGraph(), new ArrayList<MethodOrMethodContext>(getEntryPoints()) ); } reachableMethods.update(); return reachableMethods; } public void setReachableMethods( ReachableMethods rm ) {
public ReachableMethods getReachableMethods() { if( reachableMethods == null ) { reachableMethods = new ReachableMethods( getCallGraph(), new ArrayList<MethodOrMethodContext>(getEntryPoints()) ); } reachableMethods.update(); return reachableMethods; } public void setReachableMethods( ReachableMethods rm ) {
public CallChain getNextCallChainBetween(SootMethod start, SootMethod goal, List previouslyFound) { // callChains.add(new LinkedList()); // Represents the one way to get from goal to goal (which is to already be there) // Is this worthwhile? Fast? Slow? Broken? Applicable inside the recursive method? // If method is unreachable, don't bother trying to make chains // CACHEABLE? ReachableMethods rm = null; if(rmCache.containsKey(start)) rm = rmCache.get(start); else { List<MethodOrMethodContext> entryPoints = new ArrayList<MethodOrMethodContext>(); entryPoints.add(start); rm = new ReachableMethods(cg, entryPoints); rm.update(); rmCache.put(start, rm); } if(rm.contains(goal)) { // Set methodsInAnyChain = new HashSet(); // methodsInAnyChain.add(goal); return getNextCallChainBetween(rm, start, goal, null, null, previouslyFound); } return null; // new ArrayList(); }
public CallChain getNextCallChainBetween(SootMethod start, SootMethod goal, List previouslyFound) { // callChains.add(new LinkedList()); // Represents the one way to get from goal to goal (which is to already be there) // Is this worthwhile? Fast? Slow? Broken? Applicable inside the recursive method? // If method is unreachable, don't bother trying to make chains // CACHEABLE? ReachableMethods rm = null; if(rmCache.containsKey(start)) rm = rmCache.get(start); else { List<MethodOrMethodContext> entryPoints = new ArrayList<MethodOrMethodContext>(); entryPoints.add(start); rm = new ReachableMethods(cg, entryPoints); rm.update(); rmCache.put(start, rm); } if(rm.contains(goal)) { // Set methodsInAnyChain = new HashSet(); // methodsInAnyChain.add(goal); return getNextCallChainBetween(rm, start, goal, null, null, previouslyFound); } return null; // new ArrayList(); }
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; }
ReachableMethods reachableMethods = new ReachableMethods(Scene.v().getCallGraph(), eps.iterator(), null); reachableMethods.update(); for (Iterator<MethodOrMethodContext> iter = reachableMethods.listener(); iter.hasNext();) { SootMethod ep = iter.next().method();
while(true) { ofcgb.processReachables(); reachables.update(); if( !worklist.hasNext() ) break; MethodOrMethodContext momc = (MethodOrMethodContext) worklist.next();
while(true) { ofcgb.processReachables(); reachables.update(); if( !worklist.hasNext() ) break; MethodOrMethodContext momc = (MethodOrMethodContext) worklist.next();
public void processReachables() { while(true) { 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 ); } } public boolean wantTypes( Local receiver ) {
public void processReachables() { while(true) { 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 ); } } public boolean wantTypes( Local receiver ) {
reachableMethods.update(); for (Iterator<MethodOrMethodContext> iterator = reachableMethods.listener(); iterator.hasNext();) { SootMethod m = (SootMethod) iterator.next();
reachableMethods.update(); for (Iterator<MethodOrMethodContext> iterator = reachableMethods.listener(); iterator.hasNext();) { SootMethod m = (SootMethod) iterator.next();
ReachableMethods reachableMethods = new ReachableMethods(Scene.v().getCallGraph(), eps.iterator(), null); reachableMethods.update(); long reachableStatements = 0; for (Iterator<MethodOrMethodContext> iter = reachableMethods.listener(); iter.hasNext();) {