[Soot-list] Generating code for enumaration

Bodden, Eric eric.bodden at sit.fraunhofer.de
Mon Feb 2 17:09:45 EST 2015


Hi Daniele.

It looks to me like the Jimple code you generate is ill-structured. Try to enable the -validate command line switch in Soot. That might help you pinpoint the problem.

Cheers,
Eric

> On 02.02.2015, at 15:37, Daniele Altomare <daniele.altomare at sysmosoft.com> wrote:
> 
> Hi Steven,
> 
> thanks for getting back to me. If I run the transformed executable (APK) I get a java.lang.VerifyError exception and this is the root cause:
> 
> 02-02 15:49:39.170: W/dalvikvm(19074): VFY: register1 v7 holds uninitialized ref
> 02-02 15:49:39.170: W/dalvikvm(19074): VFY: bad arg 1 (into Ljava/net/Proxy$Type;)
> 02-02 15:49:39.170: W/dalvikvm(19074): VFY:  rejecting call to Ljava/net/Proxy;.<init> (Ljava/net/Proxy$Type;Ljava/net/SocketAddress;)V
> 02-02 15:49:39.170: W/dalvikvm(19074): VFY:  rejecting opcode 0x70 at 0x0015
> 02-02 15:49:39.170: W/dalvikvm(19074): VFY:  rejected
> 
> Please notice that I'm trying to init a Proxy instance:
> specialinvoke $r5.<java.net.Proxy: void <init>(java.net.Proxy$Type,java.net.SocketAddress)>($r6, $r7);
> 
> 
> If I run the driver class on this transformed APK (so I can print the body to check my transformation), I get this error:
> local type not allowed in final code: bottom_type local: $r6
> 
> 
> In fact, if I check the body I see "bottom_type $r6;" instead of "java.net.Proxy$Type $r6;" as expected.
> 
> 
> Thanks again,
> Daniele
> 
> From: Steven Arzt [Steven.Arzt at cased.de]
> Sent: Monday, February 02, 2015 5:16 PM
> To: Daniele Altomare; soot-list at CS.McGill.CA
> Subject: AW: [Soot-list] Generating code for enumaration
> 
> Hi Daniele,
> 
> To answer this question, we would need more information. What do you mean by “does not work”? The code you wrote should give you a new local of the correct type – but it’s hard to tell what else may be wrong if one does not know how you use this local and where the problem shows up.
> 
> Best regards,
>   Steven
> 
> 
> M.Sc. M.Sc. Steven Arzt
> Secure Software Engineering Group (SSE)
> European Center for Security and Privacy by Design (EC SPRIDE)
> Rheinstraße 75
> D-64293 Darmstadt
> Phone: +49 61 51 869-336
> Fax: +49 61 51 16-72118
> eMail: steven.arzt at ec-spride.de
> Web: http://sse.ec-spride.de
> 
> 
> 
> Von: soot-list-bounces at CS.McGill.CA [mailto:soot-list-bounces at CS.McGill.CA] Im Auftrag von Daniele Altomare
> Gesendet: Montag, 2. Februar 2015 17:14
> An: soot-list at CS.McGill.CA
> Betreff: [Soot-list] Generating code for enumaration
> 
> Hi all,
> 
> I'm getting stuck at generating code for an enum in a BodyTransformer.
> 
> I have to pass the the proxy type to a method and that's defined by an enum.
> If I run the driver class for a java program where I define the proxy (so I can see the Jimple code) I get this for the method body:
> 
> $r6 = <java.net.Proxy$Type: java.net.Proxy$Type HTTP>;
> 
> 
> 
> I've tried in this way but it doesn't work:
> 
> SootClass clsProxyType = Scene.v().getSootClass("java.net.Proxy$Type");
> 
> Local proxyType = Jimple.v().newLocal("proxyType", RefType.v(clsProxyType));
> 
> b.getLocals().add(proxyType);
> 
> 
> 
> Can someone help me with this?
> 
> 
> 
> Thanks!
> 
> Daniele
> 
> 
> _______________________________________________
> Soot-list mailing list
> Soot-list at CS.McGill.CA
> https://mailman.CS.McGill.CA/mailman/listinfo/soot-list

--
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/20150202/ccc012d5/attachment-0001.bin 


More information about the Soot-list mailing list