[prev in list] [next in list] [prev in thread] [next in thread] 

List:       soot-list
Subject:    Re: [Soot-list] ***SPAM*** ResolutionFailedException
From:       "Bodden, Eric" <eric.bodden () sit ! fraunhofer ! de>
Date:       2015-04-09 5:23:15
Message-ID: 42072573-6587-4957-99D6-8ACD38176A67 () sit ! fraunhofer ! de
[Download RAW message or body]

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@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@comhem.se
> Cc: soot-list@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


["signature.asc" (signature.asc)]

-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVJgzFAAoJEBflvf1oEO7RWZAQAKQYLjQWnVXV73eePOoFMzRY
ExbphvQmo8rlrFUHX8AnuCbogNfC/qHWos465JTUPaNPaVFycuawGvWD0o2h48j1
FVGO589B4bOG9/73YWuPvy8BAh6PwWVWA5DqnxLA+0HYABD8DR89v+CwngqV2JBR
NcoVKvQz/uHqm6zKb7cnQELo6ehcxVoCy4thi3TY5IhUk34Y81TFje3oJIxMnIcV
ft1YUJO5GdSV/pGENLVdu4aaU+B0gq1Fad8SZMXxm2prYK2B21qpYGw8rfV9+aai
5JUaxCSEmFkKB9H/ZqjrbX24IO48h7jdioWJvMr2gn4In0uANghzCsDfIttkMJpQ
12ufxzM6TXlHb/EvRyZgqv/WdHCSjd2LTVBJaPRAuczQQenfaaLgUKwIZ8nl4CUz
Dl4kVURQnWp8W9xUie5fCa2AJB09Pf/i2AT+SCBacahfVu644NnbiUvWeeq4cTyN
1GLoDCHGenfsLLej7c77/vTQXrWdbc941mWKd1ecEShiud38PEcc2cp9mvVnqkaj
61OnjgAS/325U5M5KoqL4AxgAcVuPKvTRhl4uIuM2HhrtDdkyIkypW4K5l6jW6Kd
b1F5s3eXJptOaLmAUIkGkMfvuYyPCJ3zgnCX3CjzqYwh11ge0dT/W2idkWSaS4d+
CNhkFvd14tHMTypbMydh
=26do
-----END PGP SIGNATURE-----


_______________________________________________
Soot-list mailing list
Soot-list@CS.McGill.CA
https://mailman.CS.McGill.CA/mailman/listinfo/soot-list

--===============6854526262119737451==--

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic