[Soot-list] jtp is not invoked for certain class files

Diptikalyan Saha diptikalyan at gmail.com
Tue Jul 22 07:41:23 EDT 2014


Here is my code

Main.java:

public static void setSootClassPath(String dir_class_files){ String jhome =
System.getProperty( "java.home" ); String libPath = jhome + File.separator
+ "lib" + File.separator + "rt.jar"; String libPath1 = jhome +
File.separator + "lib" + File.separator + "jsse.jar"; String libPath2 =
jhome + File.separator + "lib" + File.separator + "jce.jar"; String l =
libPath + ";" + libPath1 + ";" + libPath2;
Scene.v().setSootClassPath(dir_class_files+";"+l); }

void driver(String dir_class_files){
List<String> argsList = new ArrayList<String>();
String[] args;

argsList.addAll(Arrays.asList(new String[]{
"-src-prec","only-class",
     "-no-bodies-for-excluded",
      "-process-dir",
      dir_class_files,
       "-d",dir_class_files
    }));

args = argsList.toArray(new String[0]);

Pack jtp = PackManager.v().getPack("jtp");
jtp.add(new Transform("jtp.instrumenter",
new MethodVisitor()));
soot.Main.main(args);
System.out.println(Scene.v().getApplicationClasses().size());
}



public class MethodVisitor extends BodyTransformer {
@Override
protected void internalTransform(Body arg0, String arg1, Map arg2) {
SootMethod m = arg0.getMethod();
System.out.println("Visiting " + m.getName() + " " +
m.getDeclaringClass().getName());
...
..instrumentation code...
}

I invoke
Main m = new Main();
Main.setSootClassPath(dir);
      m.driver(dir);
where dir is the path to the "classes" directory in the attachment.

This is the output I get.

Soot started on Tue Jul 22 17:05:47 IST 2014
Warning: java.dyn.InvokeDynamic is a phantom class!
Soot finished on Tue Jul 22 17:05:47 IST 2014
Soot has run for 0 min. 0 sec.
0
It does not invoke MethodVisitor.

whereas if I invoke this program with other class files it does invoke
MethodVisitor.

Please help.

Regards,
Dipti.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20140722/eb68eb08/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: classes.rar
Type: application/rar
Size: 98057 bytes
Desc: not available
Url : http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20140722/eb68eb08/attachment-0001.bin 


More information about the Soot-list mailing list