[Soot-list] class to jimple convertion question

Sergio Ferrero sferrero at ensoftcorp.com
Mon Aug 5 10:08:48 EDT 2013


I'd like to generate jimple files for jar files.
Below is the small program I have written for this:

public void jarToJimple(String jarPath, String outputDir) {
String[] args = new String[] {
 "-src-prec", "class",
"-f", "jimple",
 "-output-dir", outputDir,
"-process-dir", jarPath
 };
 soot.Main.main(args);

}


I decided to test my program on log4j jar (
http://logging.apache.org/log4j/2.x/download.html)
When I ran my program I get the following exception:

Exception in thread "main" soot.SootResolver$SootClassNotFoundException:
couldn't find class: org.apache.logging.log4j.Level (is your
soot-class-path set properly?)

at soot.SootResolver.bringToHierarchy(SootResolver.java:216)

at soot.SootResolver.bringToSignatures(SootResolver.java:250)

at soot.SootResolver.processResolveWorklist(SootResolver.java:165)

at soot.SootResolver.resolveClass(SootResolver.java:127)

at soot.Scene.loadClass(Scene.java:608)

at soot.Scene.loadClassAndSupport(Scene.java:595)

at soot.Scene.loadNecessaryClasses(Scene.java:1238)

at soot.Main.run(Main.java:167)

at soot.Main.main(Main.java:141)

The org.apache.logging.log4j.Level class is one of the classes that should
be converted to Jimple, so I expected Soot to find it since it's an
application class.

I realized that if I use the -allow-phantom-refs option then Soot generates
Jimple files without any error. It includes some warnings about phantom
classes.

However, I'd like to understand why I get the error if I don't use the
-allow-phantom-refs option and confirm that using the
-allow-phantom-refsoption is the right workaround. Any
help is greatly appreciated.

Thanks
Sergio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20130805/db41ea0e/attachment.html 


More information about the Soot-list mailing list