[Soot-list] Generating code for enumaration

Steven Arzt Steven.Arzt at cased.de
Tue Feb 3 03:25:38 EST 2015


Hi Daniele,

 

Isn’t there a variable holding the HTTP constant for the enum type? Can you
send us the Proxy class as complete Jimple source? My guess is that there is
some field from which you can get the correct values for the enum instances
and assign them to your local.

 

Best regards,

  Steven

 

Von: soot-list-bounces at CS.McGill.CA [mailto:soot-list-bounces at CS.McGill.CA]
Im Auftrag von Daniele Altomare
Gesendet: Dienstag, 3. Februar 2015 09:21
An: Bodden, Eric
Cc: soot-list at CS.McGill.CA; Steven Arzt
Betreff: Re: [Soot-list] Generating code for enumaration

 

Thanks Eric,

in fact I added -validate to the command and I've got a "no defs for value:
proxyType!" error 

 

To get rid of it, I tried to assign to proxyType a value but I think
something is wrong, because I don't think it's the correct value to set a
enum value to a Local.

 

My code:

SootClass clsProxyType = Scene.v().getSootClass("java.net.Proxy$Type");

Local proxyType = Jimple.v().newLocal("proxyType", RefType.v(clsProxyType));

b.getLocals().add(proxyType);

probe.add(Jimple.v().newAssignStmt(proxyType, Jimple.v().

newNewExpr(clsProxyType.getType())));

 

 

What a correct assignment is represented in Jimple:

$r6 = <java.net.Proxy$Type: java.net.Proxy$Type HTTP>;

 

Basically I just need to pass enum value Proxy.Type.HTTP as a parameter of
the Proxy constructor method.

 

 

Thanks,

Daniele



________________________________________
From: Bodden, Eric [eric.bodden at sit.fraunhofer.de]
Sent: Monday, February 02, 2015 11:09 PM
To: Daniele Altomare
Cc: Steven Arzt; soot-list at CS.McGill.CA
Subject: Re: [Soot-list] Generating code for enumaration

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 --------------
An HTML attachment was scrubbed...
URL: https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20150203/ca4b678d/attachment-0001.html 


More information about the Soot-list mailing list