[Soot-list] How to change the return type of an method

Steven Arzt Steven.Arzt at cased.de
Mon May 12 09:35:30 EDT 2014


Hi Benedikt,

 

What do you mean by „change the return value”? Do you want to change the implementation of the method to return something else, i.e., change or replace its behavior?

 

Best regards,

  Steven 

 

Von: soot-list-bounces at CS.McGill.CA [mailto:soot-list-bounces at CS.McGill.CA] Im Auftrag von Benedikt Lesch
Gesendet: Montag, 12. Mai 2014 15:18
An: soot-list at CS.McGill.CA
Betreff: [Soot-list] How to change the return type of an method

 

Hi,

I want to change the return value of the filereader.readline() method.

 

all I have is the following

 

@Override

protected void internalTransform(final Body b, String phaseName, @SuppressWarnings("rawtypes") Map options) {

                                               

            Iterator<Unit> iter = b.getUnits().snapshotIterator();

            while (iter.hasNext()) {

                        Stmt s = (Stmt) iter.next();

                        if (s.containsInvokeExpr()) {

                                   SootMethod method = s.getInvokeExpr().getMethod();

                                   String declaringClass = s.getInvokeExpr().getMethod().getDeclaringClass().getName();

                                   if(declaringClass.equals("java.io.BufferedReader") && method.getName().equals("readLine")) {

                                               //change return value

                                   }

                        }

            }

}

 

can you please tell how to change the value from here

 

Thanks

Benedikt

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20140512/1db51a0b/attachment.html 


More information about the Soot-list mailing list