[Soot-list] Java static analysis with eclipse (Urgent)

hesam ghafouri hsmghfr at yahoo.com
Thu Sep 22 18:10:57 EDT 2016


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/20160922/85eb2942/attachment.html 


More information about the Soot-list mailing list