| 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 JavaIoObjectInputStreamNative extends NativeMethodClass { 34 public JavaIoObjectInputStreamNative( 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.ClassLoader latestUserDefinedLoader()")){ 49 java_io_ObjectInputStream_latestUserDefinedLoader(method, 50 thisVar, 51 returnVar, 52 params); 53 return; 54 55 } else if (subSignature.equals("java.lang.Object allocateNewObject(java.lang.Class,java.lang.Class)")) { 56 java_io_ObjectInputStream_allocateNewObject(method, 57 thisVar, 58 returnVar, 59 params); 60 return; 61 62 } else if (subSignature.equals("java.lang.Object allocateNewArray(java.lang.Class,int)")){ 63 java_io_ObjectInputStream_allocateNewArray(method, 64 thisVar, 65 returnVar, 66 params); 67 return; 68 69 } else { 70 defaultMethod(method, thisVar, returnVar, params); 71 return; 72 73 } 74 } 75 76 77 84 public 85 void java_io_ObjectInputStream_latestUserDefinedLoader( 86 SootMethod method, 87 ReferenceVariable thisVar, 88 ReferenceVariable returnVar, 89 ReferenceVariable params[]){ 90 helper.assignObjectTo(returnVar, Environment.v().getClassLoaderObject()); 91 } 92 93 102 public 103 void java_io_ObjectInputStream_allocateNewObject( 104 SootMethod method, 105 ReferenceVariable thisVar, 106 ReferenceVariable returnVar, 107 ReferenceVariable params[]){ 108 throw new NativeMethodNotSupportedException(method); 109 } 110 111 115 public 116 void java_io_ObjectInputStream_allocateNewArray( 117 SootMethod method, 118 ReferenceVariable thisVar, 119 ReferenceVariable returnVar, 120 ReferenceVariable params[]){ 121 throw new NativeMethodNotSupportedException(method); 122 } 123 124 140 141 } 142 | Popular Tags |