[prev in list] [next in list] [prev in thread] [next in thread]
List: soot-list
Subject: Re: [Soot-list] class to jimple convertion question
From: Sergio Ferrero <sferrero () ensoftcorp ! com>
Date: 2013-09-17 12:09:51
Message-ID: CALpL35nOW4sOSx-7SvZdQ+vWpchbXyewjdg4_JwQx6SnKzoKow () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
Hi Eric,
Thanks for the reply.
I needed to do it from java because it needs to be part of an automated
process.
I found a workaround by adding the -allow-phantom-refs option.
Thanks again,
-S
On Mon, Sep 16, 2013 at 10:02 AM, Bodden, Eric <
eric.bodden@sit.fraunhofer.de> wrote:
> 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@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@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
>
>
[Attachment #5 (text/html)]
<div dir="ltr">Hi Eric, <div><br></div><div>Thanks for the reply.</div><div>I needed \
to do it from java because it needs to be part of an automated process.</div><div>I \
found a workaround by adding the -allow-phantom-refs option.</div>
<div><br></div><div>Thanks again, </div><div>-S</div>
<div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On \
Mon, Sep 16, 2013 at 10:02 AM, Bodden, Eric <span dir="ltr"><<a \
href="mailto:eric.bodden@sit.fraunhofer.de" \
target="_blank">eric.bodden@sit.fraunhofer.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">Hi Sergio.<br> <br>
You need no code for this. Just use something like:<br>
<br>
java soot.Main -f J -process-dir log4j.jar<br>
<br>
Cheers,<br>
Eric<br>
<div><div class="h5"><br>
<br>
On 05.08.2013, at 16:08, Sergio Ferrero <<a \
href="mailto:sferrero@ensoftcorp.com">sferrero@ensoftcorp.com</a>> wrote:<br> <br>
> I'd like to generate jimple files for jar files.<br>
> Below is the small program I have written for this:<br>
><br>
> public void jarToJimple(String jarPath, String outputDir) {<br>
> String[] args = new String[] {<br>
> "-src-prec", "class",<br>
> "-f", "jimple",<br>
> "-output-dir", outputDir,<br>
> "-process-dir", jarPath<br>
> };<br>
><br>
> soot.Main.main(args);<br>
><br>
> }<br>
><br>
> I decided to test my program on log4j jar (<a \
href="http://logging.apache.org/log4j/2.x/download.html" \
target="_blank">http://logging.apache.org/log4j/2.x/download.html</a>)<br> > When \
I ran my program I get the following exception:<br> ><br>
> Exception in thread "main" \
soot.SootResolver$SootClassNotFoundException: couldn't find class: \
org.apache.logging.log4j.Level (is your soot-class-path set properly?)<br> ><br>
> at soot.SootResolver.bringToHierarchy(SootResolver.java:216)<br>
><br>
> at soot.SootResolver.bringToSignatures(SootResolver.java:250)<br>
><br>
> at soot.SootResolver.processResolveWorklist(SootResolver.java:165)<br>
><br>
> at soot.SootResolver.resolveClass(SootResolver.java:127)<br>
><br>
> at soot.Scene.loadClass(Scene.java:608)<br>
><br>
> at soot.Scene.loadClassAndSupport(Scene.java:595)<br>
><br>
> at soot.Scene.loadNecessaryClasses(Scene.java:1238)<br>
><br>
> at soot.Main.run(Main.java:167)<br>
><br>
> at soot.Main.main(Main.java:141)<br>
><br>
> 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.<br> ><br>
> 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.<br> \
><br> > 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.<br>
><br>
> Thanks<br>
> Sergio<br>
><br>
><br>
><br>
</div></div>> _______________________________________________<br>
> Soot-list mailing list<br>
> <a href="mailto:Soot-list@sable.mcgill.ca">Soot-list@sable.mcgill.ca</a><br>
> <a href="http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list" \
target="_blank">http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list</a><br> <br>
--<br>
Prof. Eric Bodden, Ph.D., <a href="http://sse.ec-spride.de/" \
target="_blank">http://sse.ec-spride.de/</a> <a href="http://bodden.de/" \
target="_blank">http://bodden.de/</a><br> Head of Secure Software Engineering at \
Fraunhofer SIT, TU Darmstadt and EC SPRIDE<br>
Tel: +49 6151 16-75422 Fax: +49 6151 16-72051<br>
Room 3.2.14, Mornewegstr. 30, 64293 Darmstadt<br>
<br>
</blockquote></div><br></div>
_______________________________________________
Soot-list mailing list
Soot-list@sable.mcgill.ca
http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic