[Soot-list] class to jimple convertion question

Bodden, Eric eric.bodden at sit.fraunhofer.de
Mon Sep 16 09:02:58 EDT 2013


Hi Sergio.

You need no code for this. Just use something like:

java soot.Main -f J -process-dir log4j.jar

Cheers,
Eric


On 05.08.2013, at 16:08, Sergio Ferrero <sferrero at ensoftcorp.com> wrote:

> 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-refs option is the right workaround. Any help is greatly appreciated.
> 
> Thanks
> Sergio
> 
> 
> 
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list

--
Prof. Eric Bodden, Ph.D., http://sse.ec-spride.de/ http://bodden.de/
Head of Secure Software Engineering  at Fraunhofer SIT, TU Darmstadt and EC SPRIDE
Tel: +49 6151 16-75422    Fax: +49 6151 16-72051
Room 3.2.14, Mornewegstr. 30, 64293 Darmstadt

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
Url : http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20130916/32b27431/attachment-0001.bin 


More information about the Soot-list mailing list