1 19 20 26 27 package soot.jimple.toolkits.pointer.nativemethods; 28 29 import soot.*; 30 import soot.jimple.toolkits.pointer.representations.*; 31 import soot.jimple.toolkits.pointer.util.*; 32 33 public class JavaNetInetAddressImplNative extends NativeMethodClass { 34 public JavaNetInetAddressImplNative( NativeHelper helper ) { super(helper); } 35 36 41 public void simulateMethod(SootMethod method, 42 ReferenceVariable thisVar, 43 ReferenceVariable returnVar, 44 ReferenceVariable params[]){ 45 46 String subSignature = method.getSubSignature(); 47 48 if (subSignature.equals("java.lang.String getLocalHostName()")){ 49 java_net_InetAddressImpl_getLocalHostName(method, thisVar, 50 returnVar, params); 51 return; 52 53 } else if (subSignature.equals("java.lang.String getHostByAddress(int)")){ 54 java_net_InetAddressImpl_getHostByAddr(method, thisVar, 55 returnVar, params); 56 return; 57 58 } else { 59 defaultMethod(method, thisVar, returnVar, params); 60 return; 61 62 } 63 } 64 65 66 78 public 79 void java_net_InetAddressImpl_getLocalHostName( 80 SootMethod method, 81 ReferenceVariable thisVar, 82 ReferenceVariable returnVar, 83 ReferenceVariable params[]){ 84 helper.assignObjectTo(returnVar, Environment.v().getStringObject()); 85 } 86 87 93 public 94 void java_net_InetAddressImpl_getHostByAddr(SootMethod method, 95 ReferenceVariable thisVar, 96 ReferenceVariable returnVar, 97 ReferenceVariable params[]) { 98 helper.assignObjectTo(returnVar, Environment.v().getStringObject()); 99 } 100 101 110 111 } 112 | Popular Tags |