1 19 20 25 26 package soot.jimple.toolkits.pointer.nativemethods; 27 28 import soot.*; 29 import soot.jimple.toolkits.pointer.representations.*; 30 import soot.jimple.toolkits.pointer.util.*; 31 32 public class JavaLangObjectNative extends NativeMethodClass { 33 public JavaLangObjectNative( NativeHelper helper ) { super(helper); } 34 35 40 public void simulateMethod(SootMethod method, 41 ReferenceVariable thisVar, 42 ReferenceVariable returnVar, 43 ReferenceVariable params[]){ 44 String subSignature = method.getSubSignature(); 45 46 47 48 if (subSignature.equals("java.lang.Class getClass()")) { 49 java_lang_Object_getClass(method, thisVar, returnVar, params); 50 return; 51 52 } else if (subSignature.equals("java.lang.Object clone()")) { 53 java_lang_Object_clone(method, thisVar, returnVar, params); 54 return; 55 56 } else { 57 defaultMethod(method, thisVar, returnVar, params); 58 return; 59 } 60 } 61 62 63 69 public void java_lang_Object_getClass(SootMethod method, 70 ReferenceVariable thisVar, 71 ReferenceVariable returnVar, 72 ReferenceVariable params[]) { 73 helper.assignObjectTo(returnVar, Environment.v().getClassObject()); 74 } 75 76 104 public void java_lang_Object_clone(SootMethod method, 105 ReferenceVariable thisVar, 106 ReferenceVariable returnVar, 107 ReferenceVariable params[]) { 108 ReferenceVariable newVar = helper.cloneObject(thisVar); 109 helper.assign(returnVar, newVar); 110 } 111 112 122 123 } 124 | Popular Tags |