[Soot-list] adding field reference to method

suraj kath surajkath108 at gmail.com
Thu Mar 3 13:47:57 EST 2011


hello


i was trying to add an object of class to its function but it isn't
happennig can u please tell me what is wrong with the code.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20110303/78e514c7/attachment.html 
-------------- next part --------------

public class invoke4 extends BodyTransformer{

SootClass sClass,scl;

static int r=0;
public invoke4()
{


        scl=Scene.v().loadClassAndSupport("pol");
   
}



  protected void internalTransform(Body body, String phase, Map options)
  {



                      
      
      Chain units=body.getUnits();




      Local obj=Jimple.v().newLocal("obj",scl.getType());
                    body.getLocals().add(obj);



                      units.add(Jimple.v().newAssignStmt(obj, Jimple.v().newNewExpr(scl.getType())));




    }



}

public class Main {
  public static void main(String[] args)throws FileNotFoundException,IOException {

  
    Scene.v().setSootClassPath("E:\\classfiles;C:\\Program Files\\Java\\jre6\\lib\\rt.jar;C:\\Program Files\\Java\\jre6\\lib\\jce.jar");


   
    Pack jtp = PackManager.v().getPack("jtp");

    

    jtp.add(new Transform("jtp.instrumenter",
        new invoke4();));




           soot.Main.main(args);

  }

  }


More information about the Soot-list mailing list