Advertisement
Guest User

Untitled

a guest
Jul 3rd, 2012
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.60 KB | None | 0 0
  1.         sootOptions.add("-src-prec");
  2.         sootOptions.add("java");
  3.         sootOptions.add("-keep-line-number");
  4.         sootOptions.add("-output-format");
  5.         sootOptions.add("jimple");
  6.         sootOptions.add("-allow-phantom-refs");
  7.         sootOptions.add("-no-bodies-for-excluded");
  8.         sootOptions.add("-time");
  9.         for (String p : processDirs){
  10.             sootOptions.add("-process-path");
  11.             sootOptions.add(p);
  12.         }
  13.         sootOptions.add("-prepend-classpath");
  14.         sootOptions.add("-soot-classpath");
  15.         sootOptions.add(classPath);
  16.        
  17.         ArrayList<String> firstRoundSootOptions = new ArrayList<String>(sootOptions);
  18.         firstRoundSootOptions.add("-phase-option");
  19.         firstRoundSootOptions.add("cg");
  20.         firstRoundSootOptions.add("enabled:false");
  21.        
  22.         //Load the classes
  23.         Scene.v().addBasicClass("javax.servlet.http.HttpServlet",SootClass.SIGNATURES);
  24.         Scene.v().addBasicClass("org.apache.jasper.runtime.HttpJspBase", SootClass.SIGNATURES);
  25.         soot.Main.main(firstRoundSootOptions.toArray(new String[firstRoundSootOptions.size()]));
  26.        
  27.         //Set entry points
  28. //...
  29.         //Call graph phase options
  30.         final String[] phaseOptions = new String[]{
  31.             "cg,enabled:true",
  32.             "cg,verbose:true",
  33.             "cg.spark,enabled:true",
  34.             "cg.spark,geom-pta:true"
  35.             };
  36.         ArrayList<String> phase2Options = new ArrayList<String>();
  37.         for(String po: phaseOptions){
  38.             phase2Options.add("-phase-option");
  39.             for (String opt : po.split(","))
  40.                 phase2Options.add(opt);
  41.         }
  42.        
  43.         logger.debug("Running soot with options: {}", phase2Options);
  44.         soot.Main.main(phase2Options.toArray(new String[phase2Options.size()]));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement