import com.ibm.wala.classLoader.IClass; import com.ibm.wala.ipa.callgraph.*; import com.ibm.wala.ipa.cha.ClassHierarchy; import com.ibm.wala.util.config.AnalysisScopeReader; import com.ibm.wala.util.io.FileProvider; import java.io.File; import java.io.IOException; public class WALAShrikeExample { public static void main(String[] args) throws IOException, ClassHierarchyException, CallGraphBuilderCancelException { AnalysisScope scope = AnalysisScopeReader.readJavaScope("path/to/classfiles", new File("Exclusions.txt"), WALAShrikeExample.class.getClassLoader()); ClassHierarchy cha = ClassHierarchy.make(scope); AnalysisOptions options = new AnalysisOptions(); options.setReflectionOptions(ReflectionOptions.NONE); CallGraphBuilder builder = Util.makeZeroOneContainerCFABuilder(options, CallGraphBuilder.FACTORY, cha, scope); CallGraph callGraph = builder.makeCallGraph(options); for(CGNode node : callGraph) { System.out.println(node); System.out.println(callGraph.getSuccNodeCount(node)); } } } [1] https://github.com/wala/WALA


上一篇:
下一篇:
切换中文