[Soot-list] VerifyError while instrumenting with Chain.insertBefore() method.

Patrick Lam plam at sable.mcgill.ca
Tue Jun 15 15:14:01 EDT 2010


On 15/06/10 03:03 PM, Neetha Maria Sebastian wrote:
> Hi,
>
> The program I work with produces .class files as output and not .jimple
> files. I tried to convert them into jimple, but am not sure how to do
> that. I am attaching the class files produced by the program with this
> email.
>
> I changed the code a bit and am now calling into "myIfBefore" function
> so that you could distinguish between my invokestatic calls and the rest
> of the programs invokestatic calls.
>
> My visitBinaryExpr code has therefore become:
>
> public void visitBinopExpr(SootMethod sm, Chain units, Stmt s, BinopExpr
> expr, BinopExprContext context) {
> nextVisitor.visitBinopExpr(sm, units, s, expr, context);
>          Value left = expr.getOp1();
>          Value right = expr.getOp2();
>          if( s instanceof IfStmt) {
> System.out.println(" Found an if statement : " + s.toString());
>              addCallWithObject(units, s, "myIfBefore", left, false);
> //addCallWithObjectInt(units, s, "myReadBefore", leftOp,
> IntConstant.v(4), true);
>          }
>      }
>
> I am not sure how I can convert a .class file into .jimple. Could you
> also tell me how to do this?

If you can pass arguments to Soot, give it the -f j argument. To go from 
the class file to Jimple, run Soot something like this:

java soot.Main -f j (class file)

making sure to include the appropriate classpath.

Please continue to reply to the soot list.

pat


More information about the Soot-list mailing list