[Soot-list] Java static analysis with eclipse (Urgent)
xwlin.roy at gmail.com
xwlin.roy at gmail.com
Tue Sep 27 09:46:09 EDT 2016
Hi,Hesam
First,you need to compile sample.java into .class file.
Then,put the sample.class file into project source directory.
At last,use
Options.v().set_soot_classpath(new File("").getAbsolutePath
());
to set soot class path to contain your sample.class.
Hope this can help you.
在 2016年9月23日星期五 UTC+8上午6:11:45,hesam ghafouri写道:
>
> Hello all,
>
> It is very urgent. I searched a lot to find out how to load a java class
> to analyze using eclipse but I really couldn't find any solution. I want to
> do some static analyze on a java file (/Desktop/sampleFolder/sample.java).
> I think I need to add this file (or its path) into my soot-class path, how
> can I do that in eclipse??? I know how to do it in command line.
> What should I add in eclipse arguments?? Please help me if some one knows
> about that, its very urgent. Thank you in advance
>
>
> Here is my code: (the only thing I want to know is how to load the sample
> class, I know the rest analysis)
>
> public static void main(String[] args) {
> // TODO Auto-generated method stub
>
> Options.v().set_keep_line_number(true);
>
> Options.v().set_whole_program(true);
>
> Options.v().set_allow_phantom_refs(true);
>
> Options.v().set_src_prec(Options.src_prec_java);
>
> Options.v().set_output_format(Options.output_format_jimple);
>
> Options.v().setPhaseOption("cg.cha", "on");
>
> SootClass sootClass = Scene.v().loadClassAndSupport("sample");
> //I copied the sample.java file in project src directory
> sootClass.setApplicationClass();
>
> for(SootMethod method : sootClass.getMethods())
> {
> //analyze codes
> }
>
> soot.Main.main(args);
> }
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20160927/45f78af3/attachment-0001.html
More information about the Soot-list
mailing list