[Soot-list] NullPointerException in soot.SootMethod.getBodyFromMethodSource

Marc-Andre Laverdiere-Papineau marc-andre.laverdiere-papineau at polymtl.ca
Tue Jul 3 12:11:55 EDT 2012


Hello,

I work with servlet entry points. I find all classes that are subclasses 
of HttpServlet and then the doGet, etc. methods

Code is like this:

final SootClass servletClass = 
Scene.v().loadClassAndSupport("javax.servlet.http.HttpServlet");
	
FastHierarchy fh = Scene.v().getOrMakeFastHierarchy();
final String[] servletMethods = new String[]{
//HTTP Servlet
"doGet", "doPost", "doPut", "doDelete", "init", "destroy", 
"getServletInfo",
//From JspC
"_jspInit", "_jspDestroy", "_jspService"
};
for (SootClass sc : Scene.v().getApplicationClasses()){
	if (!sc.isInterface() && fh.isSubclass(sc, servletClass)){
    logger.debug("Servlet detected: {}", sc.toString());
	for(String method : servletMethods){
	if (sc.declaresMethodByName(method))
		entryPoints.add(sc.getMethodByName(method));
}
}
}

On 2012-07-03 11:51, Eric Bodden wrote:
> Hi all.
>
> G.reset() resets all static state. But that's not Marc-Andre's
> problem. His problem is that Soot also releases all the method bodies
> after they were written out. Calling G.reset() does not undo this
> "garbage collection".
>
> Marc: How do you compute entry points, i.e., based on which conditions?
>
> Eric
>
> On 3 July 2012 16:45, Patrick Lam <p.lam at ece.uwaterloo.ca> wrote:
>> On 07/03/2012 10:20 AM, Marc-Andre Laverdiere-Papineau wrote:
>>> So what would be the proper way of picking my entry points then?
>>
>> G.reset() ought to work, but maybe it doesn't. You could run Soot once,
>> save the results, quit the JVM, and run Soot again, loading the results.
>> At least that will tell you if it works or not.
>>
>> pat
>> _______________________________________________
>> Soot-list mailing list
>> Soot-list at sable.mcgill.ca
>> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
>
>


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




More information about the Soot-list mailing list