[Soot-list] Generating code for enumaration

Daniele Altomare daniele.altomare at sysmosoft.com
Mon Feb 2 15:37:09 EST 2015


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<mailto:steven.arzt at ec-spride.de>
Web: http://sse.ec-spride.de<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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20150202/29c81f7a/attachment.html 


More information about the Soot-list mailing list