[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">&lt;<a \
href="mailto:eric.bodden@sit.fraunhofer.de" \
target="_blank">eric.bodden@sit.fraunhofer.de</a>&gt;</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 &lt;<a \
href="mailto:sferrero@ensoftcorp.com">sferrero@ensoftcorp.com</a>&gt; wrote:<br> <br>
&gt; I&#39;d like to generate jimple files for jar files.<br>
&gt; Below is the small program I have written for this:<br>
&gt;<br>
&gt; public void jarToJimple(String jarPath, String outputDir) {<br>
&gt;          String[] args = new String[] {<br>
&gt;                      &quot;-src-prec&quot;, &quot;class&quot;,<br>
&gt;                      &quot;-f&quot;, &quot;jimple&quot;,<br>
&gt;                      &quot;-output-dir&quot;, outputDir,<br>
&gt;                      &quot;-process-dir&quot;, jarPath<br>
&gt;          };<br>
&gt;<br>
&gt;          soot.Main.main(args);<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; 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> &gt; When \
I ran my program I get the following exception:<br> &gt;<br>
&gt; Exception in thread &quot;main&quot; \
soot.SootResolver$SootClassNotFoundException: couldn&#39;t find class: \
org.apache.logging.log4j.Level (is your soot-class-path set properly?)<br> &gt;<br>
&gt; at soot.SootResolver.bringToHierarchy(SootResolver.java:216)<br>
&gt;<br>
&gt; at soot.SootResolver.bringToSignatures(SootResolver.java:250)<br>
&gt;<br>
&gt; at soot.SootResolver.processResolveWorklist(SootResolver.java:165)<br>
&gt;<br>
&gt; at soot.SootResolver.resolveClass(SootResolver.java:127)<br>
&gt;<br>
&gt; at soot.Scene.loadClass(Scene.java:608)<br>
&gt;<br>
&gt; at soot.Scene.loadClassAndSupport(Scene.java:595)<br>
&gt;<br>
&gt; at soot.Scene.loadNecessaryClasses(Scene.java:1238)<br>
&gt;<br>
&gt; at soot.Main.run(Main.java:167)<br>
&gt;<br>
&gt; at soot.Main.main(Main.java:141)<br>
&gt;<br>
&gt; 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&#39;s an application \
class.<br> &gt;<br>
&gt; 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> \
&gt;<br> &gt; However, I&#39;d like to understand why I get the error if I don&#39;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>


&gt;<br>
&gt; Thanks<br>
&gt; Sergio<br>
&gt;<br>
&gt;<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; Soot-list mailing list<br>
&gt; <a href="mailto:Soot-list@sable.mcgill.ca">Soot-list@sable.mcgill.ca</a><br>
&gt; <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