[Soot-list] Class Hierarchy with no entry point - catch 22?

Marc-Andre Laverdiere-Papineau marc-andre.laverdiere-papineau at polymtl.ca
Tue Jun 12 14:46:40 EDT 2012


Hello,

I am trying to find all the servlets in my program, so that I can set 
those as entry points.

Now, a good way to doo that, I think, is to use the class hierarchy.

Sadly, I get an exception, "java.lang.RuntimeException: There is no main 
class set!".
Is there a way to  deal with this without having a dummy main class?


P.S. My code:

//Work in whole-program mode
Options.v().set_whole_program(true);
Options.v().set_exclude(Arrays.asList("java", "javax", "org.hibernate", 
"sun"));
// General Options
Options.v().set_allow_phantom_refs(true);
Options.v().set_no_bodies_for_excluded(true);
Options.v().set_time(true);
Options.v().set_verbose(false);

//First, do a simple class hierarchy analysis
Options.v().setPhaseOption("cg", "enabled:true");
Options.v().setPhaseOption("cg.cha", "enabled:true");
Options.v().setPhaseOption("cg.spark", "enabled:false");
Options.v().setPhaseOption("cg", "implicit-entry:true");
Options.v().setPhaseOption("cg", "all-reachable:true");

Scene.v().loadNecessaryClasses();
PackManager.v().runPacks();

final String servletClassName = "javax.servlet.http.HttpServlet";
for (SootClass sc :
Scene.v().getActiveHierarchy().getSubclassesOf(Scene.v().loadClassAndSupport(servletClassName))){
System.err.println("Servlet class: " + sc.getShortJavaStyleName());
}


-- 
Marc-André Laverdière-Papineau
Étudiant au doctorat - PhD Student



More information about the Soot-list mailing list