[Soot-list] How to transform a Grimp file into class file
Yongzhi Wang
wang.yongzhi2009 at gmail.com
Thu Oct 24 17:43:08 EDT 2013
Dear All,
I want to transform java program into a class file with some manipulations.
My original transformation step is as follows. The transformation is
performed in "jtp" step.
Java --> Jimple --> class
However, since Jimple can only accommodate three operators in each
expression. I create some Grimp expressions (using Grimp.v().newXXX()
function) during the java to jimple transformation. Therefore, the
generated jimple file contains statements containing more than three
operators. When I transform the generated Jimple into class, I got the
following error.
My question is how can I transform my generated jimple file (containing
multiple operators) into class file? Or I simply shouldn't use the
Grimp.v().newXXX() functions in the jtp transformation step? I know I can
transform the generated expressions into jimple standard three operator
format. However, I just want to see if there's any quicker way as I tried.
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at ca.mcgill.sable.soot.launching.SootThread.run(SootThread.java:138)
Caused by: java.lang.ClassCastException: soot.grimp.internal.GAddExpr
cannot be cast to soot.jimple.ConvertToBaf
at
soot.jimple.internal.AbstractStaticInvokeExpr.convertToBaf(AbstractStaticInvokeExpr.java:135)
at soot.jimple.internal.JIfStmt.convertToBaf(JIfStmt.java:277)
at soot.baf.BafBody.<init>(BafBody.java:104)
at soot.baf.Baf.newBody(Baf.java:560)
at soot.PackManager.runBodyPacks(PackManager.java:793)
at soot.PackManager.runBodyPacks(PackManager.java:463)
at soot.PackManager.runBodyPacks(PackManager.java:380)
at soot.PackManager.runPacks(PackManager.java:357)
at soot.Main.run(Main.java:198)
at soot.Main.main(Main.java:141)
Thanks!
Yongzhi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20131024/c19e111a/attachment.html
More information about the Soot-list
mailing list