[Soot-list] ***SPAM*** ResolutionFailedException

Bodden, Eric eric.bodden at sit.fraunhofer.de
Thu Apr 9 01:23:15 EDT 2015


Christian, Soot's class loading process is very sensitive. Using loadClassAndSupport is not recommended.

Best call Soot's own main method to load all classes and then hook into Soot using Transformers. That might well solve your problem.

Cheers,
Eric


> On 08.04.2015, at 22:08, christian.grosse at comhem.se wrote:
> 
> I downloaded the latest version of SOOT (nightly build), I still get the same problem.
> 
> So this is part of my code, I try to make soot load all Java libray classes. If this is correct I don’t know, but it loads about 2700 classes.
> 
> Scene.v().loadClassAndSupport("java.lang.Object");
> SootClass sClass = new SootClass("HelloWorld", Modifier.PUBLIC);
> sClass.setApplicationClass();
> sClass.setSuperclass(Scene.v().getSootClass("java.lang.Object"));
> SootMethod method = new SootMethod("main",Arrays.asList(new Type[] {ArrayType.v(RefType.v("java.lang.String"), 1)}),VoidType.v(), Modifier.PUBLIC | Modifier.STATIC);
> 
> sClass.addMethod(method);
> JimpleBody body = Jimple.v().newBody(method);
> method.setActiveBody(body);
> Scene.v().setMainClass(sClass);
> Scene.v().loadNecessaryClasses();
> .
> .
> .
> Then I try to parse and decode the different classes, and in a loop I have this snippet:
> .
> .
> .
> else if (value instanceof JInstanceFieldRef)
> {
>   JInstanceFieldRef ref = (JInstanceFieldRef)value;
>   String javaName = mUtils.generateJavaClassName(method.getDeclaringClass().getName());
>   String varName = mUtils.replaceIllegalChars(ref.getField().getName()); <--------------------------- here I get the resolution exception. The getField() seems to fail.
>   code.append("((" + javaName + "_instvars*)objInstanceStruct->ptrInstanceVariables)->" +  "var_" + varName);
> }
> .
> .
> .
> I try to parse the read() method in java.io.DataInputStream I get  the resolution exception on the line marked down below.
> 
> public final int read(byte[]) throws java.io.IOException
> {
>    java.io.DataInputStream r0;
>    byte[] r1;
>    int $i0, $i1;
>    java.io.InputStream $r2;
> 
>    r0 := @this: java.io.DataInputStream;
>    r1 := @parameter0: byte[];
>    $r2 = r0.<java.io.DataInputStream: java.io.InputStream in>; <------------------------ OFFENDING LINE!!: soot.ResolutionFailedException: Resolved <java.io.DataInputStream: java.io.InputStream in> to <java.lang.System: java.io.InputStream in> which has wrong static-ness
>    $i0 = lengthof r1;
>    $i1 = virtualinvoke $r2.<java.io.InputStream: int read(byte[],int,int)>(r1, 0, $i0);
> 
>    return $i1;
> }
> 
> Hope this helps. If not tell my and I will try to give more information.
> 
> /Christian G.
> 
> 
> 
> -----Original Message----- From: Bodden, Eric
> Sent: Wednesday, April 08, 2015 6:33 PM
> To: christian.grosse at comhem.se
> Cc: soot-list at cs.mcgill.ca
> Subject: Re: [Soot-list] ***SPAM*** ResolutionFailedException
> 

--
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 869-127
Room B5.11, Fraunhofer SIT, Rheinstraße 75, 64295 Darmstadt

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
Url : https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20150409/a66eaeaa/attachment.bin 


More information about the Soot-list mailing list