static StackObject* AwaitUnsafeOnCompleted_3(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj) { ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject* ptr_of_this_method; StackObject* __ret = ILIntepreter.Minus(__esp, 3); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); global::IAsyncStateMachineAdapter.Adaptor @stateMachine = (global::IAsyncStateMachineAdapter.Adaptor)typeof(global::IAsyncStateMachineAdapter.Adaptor).CheckCLRTypes(__intp.RetriveObject(ptr_of_this_method, __mStack)); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); System.Runtime.CompilerServices.TaskAwaiter<System.String> @awaiter = (System.Runtime.CompilerServices.TaskAwaiter<System.String>)typeof(System.Runtime.CompilerServices.TaskAwaiter<System.String>).CheckCLRTypes(__intp.RetriveObject(ptr_of_this_method, __mStack)); ptr_of_this_method = ILIntepreter.Minus(__esp, 3); ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method); System.Runtime.CompilerServices.AsyncTaskMethodBuilder<ILRuntime.Runtime.Intepreter.ILTypeInstance> instance_of_this_method = (System.Runtime.CompilerServices.AsyncTaskMethodBuilder<ILRuntime.Runtime.Intepreter.ILTypeInstance>)typeof(System.Runtime.CompilerServices.AsyncTaskMethodBuilder<ILRuntime.Runtime.Intepreter.ILTypeInstance>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); instance_of_this_method.AwaitUnsafeOnCompleted<System.Runtime.CompilerServices.TaskAwaiter<System.String>, global::IAsyncStateMachineAdapter.Adaptor>(ref @awaiter, ref @stateMachine); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); switch(ptr_of_this_method->ObjectType) { case ObjectTypes.StackObjectReference: { var ___dst = ILIntepreter.ResolveReference(ptr_of_this_method); object ___obj = @stateMachine; if (___dst->ObjectType >= ObjectTypes.Object) { if (___obj is CrossBindingAdaptorType) ___obj = ((CrossBindingAdaptorType)___obj).ILInstance; __mStack[___dst->Value] = ___obj; } else { ILIntepreter.UnboxObject(___dst, ___obj, __mStack, __domain); } } break; case ObjectTypes.FieldReference: { var ___obj = __mStack[ptr_of_this_method->Value]; if(___obj is ILTypeInstance) { ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = @stateMachine; } else { var ___type = __domain.GetType(___obj.GetType()) as CLRType; ___type.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, @stateMachine); } } break; case ObjectTypes.StaticFieldReference: { var ___type = __domain.GetType(ptr_of_this_method->Value); if(___type is ILType) { ((ILType)___type).StaticInstance[ptr_of_this_method->ValueLow] = @stateMachine; } else { ((CLRType)___type).SetStaticFieldValue(ptr_of_this_method->ValueLow, @stateMachine); } } break; case ObjectTypes.ArrayReference: { var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as global::IAsyncStateMachineAdapter.Adaptor[]; instance_of_arrayReference[ptr_of_this_method->ValueLow] = @stateMachine; } break; } __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); switch(ptr_of_this_method->ObjectType) { case ObjectTypes.StackObjectReference: { var ___dst = ILIntepreter.ResolveReference(ptr_of_this_method); object ___obj = @awaiter; if (___dst->ObjectType >= ObjectTypes.Object) { if (___obj is CrossBindingAdaptorType) ___obj = ((CrossBindingAdaptorType)___obj).ILInstance; __mStack[___dst->Value] = ___obj; } else { ILIntepreter.UnboxObject(___dst, ___obj, __mStack, __domain); } } break; case ObjectTypes.FieldReference: { var ___obj = __mStack[ptr_of_this_method->Value]; if(___obj is ILTypeInstance) { ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = @awaiter; } else { var ___type = __domain.GetType(___obj.GetType()) as CLRType; ___type.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, @awaiter); } } break; case ObjectTypes.StaticFieldReference: { var ___type = __domain.GetType(ptr_of_this_method->Value); if(___type is ILType) { ((ILType)___type).StaticInstance[ptr_of_this_method->ValueLow] = @awaiter; } else { ((CLRType)___type).SetStaticFieldValue(ptr_of_this_method->ValueLow, @awaiter); } } break; case ObjectTypes.ArrayReference: { var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as System.Runtime.CompilerServices.TaskAwaiter<System.String>[]; instance_of_arrayReference[ptr_of_this_method->ValueLow] = @awaiter; } break; } __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 3); WriteBackInstance(__domain, ptr_of_this_method, __mStack, ref instance_of_this_method); __intp.Free(ptr_of_this_method); return __ret; }
static StackObject *AssignFromStack_fitHeight_3(ref object o, ILIntepreter __intp, StackObject *ptr_of_this_method, IList <object> __mStack) { ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; System.Boolean @fitHeight = ptr_of_this_method->Value == 1; ((global::UIRoot)o).fitHeight = @fitHeight; return(ptr_of_this_method); }
static StackObject *CopyToStack_manualWidth_1(ref object o, ILIntepreter __intp, StackObject *__ret, IList <object> __mStack) { var result_of_this_method = ((global::UIRoot)o).manualWidth; __ret->ObjectType = ObjectTypes.Integer; __ret->Value = result_of_this_method; return(__ret + 1); }
static StackObject *getString_0(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj) { ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject *ptr_of_this_method; StackObject *__ret = ILIntepreter.Minus(__esp, 2); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.Int32 @length = ptr_of_this_method->Value; ptr_of_this_method = ILIntepreter.Minus(__esp, 2); System.Int32 @startIndex = __intp.RetriveInt32(ptr_of_this_method, __mStack); var result_of_this_method = ILRuntimeTest.TestFramework.TestClass3.getString(ref @startIndex, @length); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); switch (ptr_of_this_method->ObjectType) { case ObjectTypes.StackObjectReference: { var ___dst = ILIntepreter.ResolveReference(ptr_of_this_method); ___dst->ObjectType = ObjectTypes.Integer; ___dst->Value = @startIndex; } break; case ObjectTypes.FieldReference: { var ___obj = __mStack[ptr_of_this_method->Value]; if (___obj is ILTypeInstance) { ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = @startIndex; } else { var ___type = __domain.GetType(___obj.GetType()) as CLRType; ___type.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, @startIndex); } } break; case ObjectTypes.StaticFieldReference: { var ___type = __domain.GetType(ptr_of_this_method->Value); if (___type is ILType) { ((ILType)___type).StaticInstance[ptr_of_this_method->ValueLow] = @startIndex; } else { ((CLRType)___type).SetStaticFieldValue(ptr_of_this_method->ValueLow, @startIndex); } } break; case ObjectTypes.ArrayReference: { var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as System.Int32[]; instance_of_arrayReference[ptr_of_this_method->ValueLow] = @startIndex; } break; } __intp.Free(ptr_of_this_method); return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method)); }
//IL2CPP can't process esp->ToObject() properly, so I can only use static function for this public static unsafe object ToObject(StackObject *esp, ILRuntime.Runtime.Enviorment.AppDomain appdomain, IList <object> mStack) { switch (esp->ObjectType) { case ObjectTypes.Integer: return(esp->Value); case ObjectTypes.Long: { return(*(long *)&esp->Value); } case ObjectTypes.Float: { return(*(float *)&esp->Value); } case ObjectTypes.Double: { return(*(double *)&esp->Value); } case ObjectTypes.Object: return(mStack[esp->Value]); case ObjectTypes.FieldReference: { ILTypeInstance instance = mStack[esp->Value] as ILTypeInstance; if (instance != null) { return(instance[esp->ValueLow]); } else { var obj = mStack[esp->Value]; IType t = null; if (obj is CrossBindingAdaptorType) { t = appdomain.GetType(((CrossBindingAdaptor)((CrossBindingAdaptorType)obj).ILInstance.Type.FirstCLRBaseType).BaseCLRType); } else { t = appdomain.GetType(obj.GetType()); } return(((CLRType)t).GetFieldValue(esp->ValueLow, obj)); } } case ObjectTypes.ArrayReference: { Array instance = mStack[esp->Value] as Array; return(instance.GetValue(esp->ValueLow)); } case ObjectTypes.StaticFieldReference: { var t = appdomain.GetType(esp->Value); if (t is CLR.TypeSystem.ILType) { CLR.TypeSystem.ILType type = (CLR.TypeSystem.ILType)t; return(type.StaticInstance[esp->ValueLow]); } else { CLR.TypeSystem.CLRType type = (CLR.TypeSystem.CLRType)t; return(type.GetFieldValue(esp->ValueLow, null)); } } case ObjectTypes.StackObjectReference: { return(ToObject((ILIntepreter.ResolveReference(esp)), appdomain, mStack)); } case ObjectTypes.ValueTypeObjectReference: { StackObject *dst = ILIntepreter.ResolveReference(esp); IType type = appdomain.GetTypeByIndex(dst->Value); if (type is ILType) { ILType iltype = (ILType)type; var ins = iltype.Instantiate(false); for (int i = 0; i < dst->ValueLow; i++) { var addr = ILIntepreter.Minus(dst, i + 1); ins.AssignFromStack(i, addr, appdomain, mStack); } return(ins); } else { return(((CLRType)type).ValueTypeBinder.ToObject(dst, mStack)); } } case ObjectTypes.Null: return(null); default: throw new NotImplementedException(); } }
static System.Int32 GetInstance(ILRuntime.Runtime.Enviorment.AppDomain __domain, StackObject *ptr_of_this_method, IList <object> __mStack) { ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method); System.Int32 instance_of_this_method; switch (ptr_of_this_method->ObjectType) { case ObjectTypes.FieldReference: { var instance_of_fieldReference = __mStack[ptr_of_this_method->Value]; if (instance_of_fieldReference is ILTypeInstance) { instance_of_this_method = (System.Int32) typeof(System.Int32).CheckCLRTypes(((ILTypeInstance)instance_of_fieldReference)[ptr_of_this_method->ValueLow]); } else { var t = __domain.GetType(instance_of_fieldReference.GetType()) as CLRType; instance_of_this_method = (System.Int32)t.GetFieldValue(ptr_of_this_method->ValueLow, instance_of_fieldReference); } } break; case ObjectTypes.StaticFieldReference: { var t = __domain.GetType(ptr_of_this_method->Value); if (t is ILType) { instance_of_this_method = (System.Int32) typeof(System.Int32).CheckCLRTypes(((ILType)t).StaticInstance[ptr_of_this_method->ValueLow]); } else { instance_of_this_method = (System.Int32)((CLRType)t).GetFieldValue(ptr_of_this_method->ValueLow, null); } } break; case ObjectTypes.ArrayReference: { var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as System.Int32[]; instance_of_this_method = instance_of_arrayReference[ptr_of_this_method->ValueLow]; } break; default: instance_of_this_method = ptr_of_this_method->Value; break; } return(instance_of_this_method); }
static StackObject *CopyToStack_Struct_0(ref object o, ILIntepreter __intp, StackObject *__ret, IList <object> __mStack) { var result_of_this_method = ((ILRuntimeTest.TestFramework.TestClass3)o).Struct; return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method)); }
static StackObject *CopyToStack_AuthType_0(ref object o, ILIntepreter __intp, StackObject *__ret, IList <object> __mStack) { var result_of_this_method = ((CloudBase.AuthState)o).AuthType; return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method)); }
unsafe StackObject *Add(StackObject *a, int b) { return((StackObject *)((long)a + sizeof(StackObject) * b)); }
static StackObject* CopyToStack_onClick_0(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack) { var result_of_this_method = ((BDFramework.UFlux.IButton)o).onClick; return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method); }
static StackObject* AssignFromStack_onClick_0(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack) { ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; BDFramework.UFlux.IComponentOnClick @onClick = (BDFramework.UFlux.IComponentOnClick)typeof(BDFramework.UFlux.IComponentOnClick).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); ((BDFramework.UFlux.IButton)o).onClick = @onClick; return ptr_of_this_method; }
static StackObject *AssignFromStack_FightBGLayer_Unity_3(ref object o, ILIntepreter __intp, StackObject *ptr_of_this_method, IList <object> __mStack) { ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; System.Int32 @FightBGLayer_Unity = ptr_of_this_method->Value; global::LayerManager.FightBGLayer_Unity = @FightBGLayer_Unity; return(ptr_of_this_method); }
static StackObject *CopyToStack_FightBGLayer_Unity_3(ref object o, ILIntepreter __intp, StackObject *__ret, IList <object> __mStack) { var result_of_this_method = global::LayerManager.FightBGLayer_Unity; __ret->ObjectType = ObjectTypes.Integer; __ret->Value = result_of_this_method; return(__ret + 1); }
static StackObject *TryParse_4(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj) { ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject *ptr_of_this_method; StackObject *__ret = ILIntepreter.Minus(__esp, 2); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.Int32 @result = __intp.RetriveInt32(ptr_of_this_method, __mStack); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); System.String @s = (System.String) typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags) 0); var result_of_this_method = System.Int32.TryParse(@s, out @result); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); switch (ptr_of_this_method->ObjectType) { case ObjectTypes.StackObjectReference: { var ___dst = ILIntepreter.ResolveReference(ptr_of_this_method); ___dst->ObjectType = ObjectTypes.Integer; ___dst->Value = @result; } break; case ObjectTypes.FieldReference: { var ___obj = __mStack[ptr_of_this_method->Value]; if (___obj is ILTypeInstance) { ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = @result; } else { var ___type = __domain.GetType(___obj.GetType()) as CLRType; ___type.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, @result); } } break; case ObjectTypes.StaticFieldReference: { var ___type = __domain.GetType(ptr_of_this_method->Value); if (___type is ILType) { ((ILType)___type).StaticInstance[ptr_of_this_method->ValueLow] = @result; } else { ((CLRType)___type).SetStaticFieldValue(ptr_of_this_method->ValueLow, @result); } } break; case ObjectTypes.ArrayReference: { var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as System.Int32[]; instance_of_arrayReference[ptr_of_this_method->ValueLow] = @result; } break; } __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); __intp.Free(ptr_of_this_method); __ret->ObjectType = ObjectTypes.Integer; __ret->Value = result_of_this_method ? 1 : 0; return(__ret + 1); }
static void WriteBackInstance(ILRuntime.Runtime.Enviorment.AppDomain __domain, StackObject *ptr_of_this_method, IList <object> __mStack, ref System.Runtime.CompilerServices.TaskAwaiter <Google.Protobuf.Adapt_IMessage.Adaptor> instance_of_this_method) { ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method); switch (ptr_of_this_method->ObjectType) { case ObjectTypes.Object: { __mStack[ptr_of_this_method->Value] = instance_of_this_method; } break; case ObjectTypes.FieldReference: { var ___obj = __mStack[ptr_of_this_method->Value]; if (___obj is ILTypeInstance) { ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = instance_of_this_method; } else { var t = __domain.GetType(___obj.GetType()) as CLRType; t.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, instance_of_this_method); } } break; case ObjectTypes.StaticFieldReference: { var t = __domain.GetType(ptr_of_this_method->Value); if (t is ILType) { ((ILType)t).StaticInstance[ptr_of_this_method->ValueLow] = instance_of_this_method; } else { ((CLRType)t).SetStaticFieldValue(ptr_of_this_method->ValueLow, instance_of_this_method); } } break; case ObjectTypes.ArrayReference: { var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as System.Runtime.CompilerServices.TaskAwaiter <Google.Protobuf.Adapt_IMessage.Adaptor>[]; instance_of_arrayReference[ptr_of_this_method->ValueLow] = instance_of_this_method; } break; } }
unsafe StackObject *Minus(StackObject *a, int b) { return((StackObject *)((long)a - sizeof(StackObject) * b)); }
static void WriteBackInstance(CSHotFix.Runtime.Enviorment.AppDomain __domain, StackObject *ptr_of_this_method, IList <object> __mStack, ref UnityEngine.NetworkViewID instance_of_this_method) { ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method); switch (ptr_of_this_method->ObjectType) { case ObjectTypes.Object: { __mStack[ptr_of_this_method->Value] = instance_of_this_method; } break; case ObjectTypes.FieldReference: { var ___obj = __mStack[ptr_of_this_method->Value]; if (___obj is ILTypeInstance) { ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = instance_of_this_method; } else { var t = __domain.GetType(___obj.GetType()) as CLRType; t.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, instance_of_this_method); } } break; case ObjectTypes.StaticFieldReference: { var t = __domain.GetType(ptr_of_this_method->Value); if (t is ILType) { ((ILType)t).StaticInstance[ptr_of_this_method->ValueLow] = instance_of_this_method; } else { ((CLRType)t).SetStaticFieldValue(ptr_of_this_method->ValueLow, instance_of_this_method); } } break; case ObjectTypes.ArrayReference: { var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as UnityEngine.NetworkViewID[]; instance_of_arrayReference[ptr_of_this_method->ValueLow] = instance_of_this_method; } break; } }
internal unsafe void DumpStack(StackObject *esp, RuntimeStack stack) { var start = stack.StackBase; var end = esp + 10; var frames = stack.Frames; var mStack = stack.ManagedStack; var valuePointerEnd = stack.ValueTypeStackPointer; StringBuilder final = new StringBuilder(); HashSet <long> leakVObj = new HashSet <long>(); for (var i = stack.ValueTypeStackBase; i > stack.ValueTypeStackPointer;) { leakVObj.Add((long)i); i = Minus(i, i->ValueLow + 1); } for (var i = start; i <= end; i++) { StringBuilder sb = new StringBuilder(); ILMethod localMethod = null, baseMethod = null; bool isLocal = false; bool isBase = false; int localIdx = 0; if (i == esp) { sb.Append("->"); } foreach (var j in frames) { if (i >= j.LocalVarPointer && i < j.BasePointer) { isLocal = true; localIdx = (int)(i - j.LocalVarPointer); localMethod = j.Method; } else if (i == j.BasePointer) { isBase = true; baseMethod = j.Method; } } sb.Append(string.Format("(0x{0:X8}) Type:{1} ", (long)i, i->ObjectType)); GetStackObjectText(sb, i, mStack, valuePointerEnd); if (i < esp) { if (i->ObjectType == ObjectTypes.ValueTypeObjectReference) { VisitValueTypeReference(*(StackObject **)&i->Value, leakVObj); } } if (isLocal) { sb.Append(string.Format("|Loc:{0}", localIdx)); if (localIdx == 0) { sb.Append(" Method:"); sb.Append(localMethod.ToString()); } } if (isBase) { sb.Append("|Base"); sb.Append(" Method:"); sb.Append(baseMethod.ToString()); } final.AppendLine(sb.ToString()); } for (var i = stack.ValueTypeStackBase; i > stack.ValueTypeStackPointer;) { var vt = domain.GetType(i->Value); var cnt = i->ValueLow; bool leak = leakVObj.Contains((long)i); final.AppendLine("----------------------------------------------"); final.AppendLine(string.Format("{2}(0x{0:X8}){1}", (long)i, vt, leak ? "*" : "")); for (int j = 0; j < cnt; j++) { StringBuilder sb = new StringBuilder(); var ptr = Minus(i, j + 1); sb.Append(string.Format("(0x{0:X8}) Type:{1} ", (long)ptr, ptr->ObjectType)); GetStackObjectText(sb, ptr, mStack, valuePointerEnd); final.AppendLine(sb.ToString()); } i = Minus(i, i->ValueLow + 1); } final.AppendLine("Managed Objects:"); for (int i = 0; i < mStack.Count; i++) { final.AppendLine(string.Format("({0}){1}", i, mStack[i])); } #if !UNITY_5 && !UNITY_2017 && !UNITY_4 System.Diagnostics.Debug.Print(final.ToString()); #else UnityEngine.Debug.LogWarning(final.ToString()); #endif }
static StackObject *AwaitUnsafeOnCompleted_7(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj) { ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject *ptr_of_this_method; StackObject *__ret = ILIntepreter.Minus(__esp, 3); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); ETModel.IAsyncStateMachineClassInheritanceAdaptor.IAsyncStateMachineAdaptor @stateMachine = (ETModel.IAsyncStateMachineClassInheritanceAdaptor.IAsyncStateMachineAdaptor) typeof(ETModel.IAsyncStateMachineClassInheritanceAdaptor.IAsyncStateMachineAdaptor).CheckCLRTypes(__intp.RetriveObject(ptr_of_this_method, __mStack)); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); ETModel.ETTask <ETModel.IResponse> .Awaiter @awaiter = (ETModel.ETTask <ETModel.IResponse> .Awaiter) typeof(ETModel.ETTask <ETModel.IResponse> .Awaiter).CheckCLRTypes(__intp.RetriveObject(ptr_of_this_method, __mStack)); ptr_of_this_method = ILIntepreter.Minus(__esp, 3); ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method); ETModel.AsyncETVoidMethodBuilder instance_of_this_method = (ETModel.AsyncETVoidMethodBuilder) typeof(ETModel.AsyncETVoidMethodBuilder).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); instance_of_this_method.AwaitUnsafeOnCompleted <ETModel.ETTask <ETModel.IResponse> .Awaiter, ETModel.IAsyncStateMachineClassInheritanceAdaptor.IAsyncStateMachineAdaptor>(ref @awaiter, ref @stateMachine); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); switch (ptr_of_this_method->ObjectType) { case ObjectTypes.StackObjectReference: { var ___dst = ILIntepreter.ResolveReference(ptr_of_this_method); object ___obj = @stateMachine; if (___dst->ObjectType >= ObjectTypes.Object) { if (___obj is CrossBindingAdaptorType) { ___obj = ((CrossBindingAdaptorType)___obj).ILInstance; } __mStack[___dst->Value] = ___obj; } else { ILIntepreter.UnboxObject(___dst, ___obj, __mStack, __domain); } } break; case ObjectTypes.FieldReference: { var ___obj = __mStack[ptr_of_this_method->Value]; if (___obj is ILTypeInstance) { ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = @stateMachine; } else { var ___type = __domain.GetType(___obj.GetType()) as CLRType; ___type.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, @stateMachine); } } break; case ObjectTypes.StaticFieldReference: { var ___type = __domain.GetType(ptr_of_this_method->Value); if (___type is ILType) { ((ILType)___type).StaticInstance[ptr_of_this_method->ValueLow] = @stateMachine; } else { ((CLRType)___type).SetStaticFieldValue(ptr_of_this_method->ValueLow, @stateMachine); } } break; case ObjectTypes.ArrayReference: { var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as ETModel.IAsyncStateMachineClassInheritanceAdaptor.IAsyncStateMachineAdaptor[]; instance_of_arrayReference[ptr_of_this_method->ValueLow] = @stateMachine; } break; } __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); switch (ptr_of_this_method->ObjectType) { case ObjectTypes.StackObjectReference: { var ___dst = ILIntepreter.ResolveReference(ptr_of_this_method); object ___obj = @awaiter; if (___dst->ObjectType >= ObjectTypes.Object) { if (___obj is CrossBindingAdaptorType) { ___obj = ((CrossBindingAdaptorType)___obj).ILInstance; } __mStack[___dst->Value] = ___obj; } else { ILIntepreter.UnboxObject(___dst, ___obj, __mStack, __domain); } } break; case ObjectTypes.FieldReference: { var ___obj = __mStack[ptr_of_this_method->Value]; if (___obj is ILTypeInstance) { ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = @awaiter; } else { var ___type = __domain.GetType(___obj.GetType()) as CLRType; ___type.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, @awaiter); } } break; case ObjectTypes.StaticFieldReference: { var ___type = __domain.GetType(ptr_of_this_method->Value); if (___type is ILType) { ((ILType)___type).StaticInstance[ptr_of_this_method->ValueLow] = @awaiter; } else { ((CLRType)___type).SetStaticFieldValue(ptr_of_this_method->ValueLow, @awaiter); } } break; case ObjectTypes.ArrayReference: { var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as ETModel.ETTask <ETModel.IResponse> .Awaiter[]; instance_of_arrayReference[ptr_of_this_method->ValueLow] = @awaiter; } break; } __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 3); WriteBackInstance(__domain, ptr_of_this_method, __mStack, ref instance_of_this_method); __intp.Free(ptr_of_this_method); return(__ret); }
unsafe void GetStackObjectText(StringBuilder sb, StackObject *esp, IList <object> mStack, StackObject *valueTypeEnd) { string text = "null"; switch (esp->ObjectType) { case ObjectTypes.StackObjectReference: { sb.Append(string.Format("Value:0x{0:X8}", (long)*(StackObject **)&esp->Value)); } break; case ObjectTypes.ValueTypeObjectReference: { object obj = null; var dst = *(StackObject **)&esp->Value; if (dst > valueTypeEnd) { obj = StackObject.ToObject(esp, domain, mStack); } if (obj != null) { text = obj.ToString(); } text += string.Format("({0})", domain.GetType(dst->Value)); } sb.Append(string.Format("Value:0x{0:X8} Text:{1} ", (long)*(StackObject **)&esp->Value, text)); break; default: { if (esp->ObjectType >= ObjectTypes.Null && esp->ObjectType <= ObjectTypes.ArrayReference) { if (esp->ObjectType < ObjectTypes.Object || esp->Value < mStack.Count) { var obj = StackObject.ToObject(esp, domain, mStack); if (obj != null) { text = obj.ToString(); } } } sb.Append(string.Format("Value:{0} ValueLow:{1} Text:{2} ", esp->Value, esp->ValueLow, text)); } break; } }
static StackObject *AssignFromStack_Struct_0(ref object o, ILIntepreter __intp, StackObject *ptr_of_this_method, IList <object> __mStack) { ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; ILRuntimeTest.TestFramework.TestStruct @Struct = (ILRuntimeTest.TestFramework.TestStruct) typeof(ILRuntimeTest.TestFramework.TestStruct).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags) 16); ((ILRuntimeTest.TestFramework.TestClass3)o).Struct = @Struct; return(ptr_of_this_method); }
public unsafe object this[int index] { get { if (index < fields.Length && index >= 0) { fixed(StackObject *ptr = fields) { StackObject *esp = &ptr[index]; return(StackObject.ToObject(esp, null, managedObjs)); } } else { if (Type.FirstCLRBaseType != null && Type.FirstCLRBaseType is Enviorment.CrossBindingAdaptor) { CLRType clrType = type.AppDomain.GetType(((Enviorment.CrossBindingAdaptor)Type.FirstCLRBaseType).BaseCLRType) as CLRType; return(clrType.GetFieldValue(index, clrInstance)); } else { throw new TypeLoadException(); } } } set { value = ILIntepreter.CheckAndCloneValueType(value, type.AppDomain); if (index < fields.Length && index >= 0) { fixed(StackObject *ptr = fields) { StackObject *esp = &ptr[index]; if (value != null) { if (value.GetType().IsPrimitive) { ILIntepreter.UnboxObject(esp, value, managedObjs, type.AppDomain); } else { esp->ObjectType = ObjectTypes.Object; esp->Value = index; managedObjs[index] = value; } } else { *esp = StackObject.Null; } } } else { if (Type.FirstCLRBaseType != null && Type.FirstCLRBaseType is Enviorment.CrossBindingAdaptor) { CLRType clrType = type.AppDomain.GetType(((Enviorment.CrossBindingAdaptor)Type.FirstCLRBaseType).BaseCLRType) as CLRType; clrType.SetFieldValue(index, ref clrInstance, value); } else { throw new TypeLoadException(); } } } }
static void WriteBackInstance(ILRuntime.Runtime.Enviorment.AppDomain __domain, StackObject *ptr_of_this_method, IList <object> __mStack, ref System.Collections.Generic.KeyValuePair <System.Int64, ETModel.Card[]> instance_of_this_method) { ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method); switch (ptr_of_this_method->ObjectType) { case ObjectTypes.Object: { __mStack[ptr_of_this_method->Value] = instance_of_this_method; } break; case ObjectTypes.FieldReference: { var ___obj = __mStack[ptr_of_this_method->Value]; if (___obj is ILTypeInstance) { ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = instance_of_this_method; } else { var t = __domain.GetType(___obj.GetType()) as CLRType; t.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, instance_of_this_method); } } break; case ObjectTypes.StaticFieldReference: { var t = __domain.GetType(ptr_of_this_method->Value); if (t is ILType) { ((ILType)t).StaticInstance[ptr_of_this_method->ValueLow] = instance_of_this_method; } else { ((CLRType)t).SetStaticFieldValue(ptr_of_this_method->ValueLow, instance_of_this_method); } } break; case ObjectTypes.ArrayReference: { var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as System.Collections.Generic.KeyValuePair <System.Int64, ETModel.Card[]>[]; instance_of_arrayReference[ptr_of_this_method->ValueLow] = instance_of_this_method; } break; } }
static StackObject *ScreenPointToLocalPointInRectangle_5(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj) { CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject *ptr_of_this_method; StackObject *__ret = ILIntepreter.Minus(__esp, 4); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); UnityEngine.Vector2 @localPoint = (UnityEngine.Vector2) typeof(UnityEngine.Vector2).CheckCLRTypes(__intp.RetriveObject(ptr_of_this_method, __mStack)); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); UnityEngine.Camera @cam = (UnityEngine.Camera) typeof(UnityEngine.Camera).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 3); UnityEngine.Vector2 @screenPoint = (UnityEngine.Vector2) typeof(UnityEngine.Vector2).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 4); UnityEngine.RectTransform @rect = (UnityEngine.RectTransform) typeof(UnityEngine.RectTransform).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); var result_of_this_method = UnityEngine.RectTransformUtility.ScreenPointToLocalPointInRectangle(@rect, @screenPoint, @cam, out @localPoint); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); switch (ptr_of_this_method->ObjectType) { case ObjectTypes.StackObjectReference: { var ___dst = *(StackObject **)&ptr_of_this_method->Value; object ___obj = localPoint; if (___dst->ObjectType >= ObjectTypes.Object) { if (___obj is CrossBindingAdaptorType) { ___obj = ((CrossBindingAdaptorType)___obj).ILInstance; } __mStack[___dst->Value] = ___obj; } else { ILIntepreter.UnboxObject(___dst, ___obj, __mStack, __domain); } } break; case ObjectTypes.FieldReference: { var ___obj = __mStack[ptr_of_this_method->Value]; if (___obj is ILTypeInstance) { ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = localPoint; } else { var ___type = __domain.GetType(___obj.GetType()) as CLRType; ___type.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, localPoint); } } break; case ObjectTypes.StaticFieldReference: { var ___type = __domain.GetType(ptr_of_this_method->Value); if (___type is ILType) { ((ILType)___type).StaticInstance[ptr_of_this_method->ValueLow] = localPoint; } else { ((CLRType)___type).SetStaticFieldValue(ptr_of_this_method->ValueLow, localPoint); } } break; case ObjectTypes.ArrayReference: { var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as UnityEngine.Vector2[]; instance_of_arrayReference[ptr_of_this_method->ValueLow] = localPoint; } break; } __ret->ObjectType = ObjectTypes.Integer; __ret->Value = result_of_this_method ? 1 : 0; return(__ret + 1); }
static StackObject *CopyToStack_fitHeight_3(ref object o, ILIntepreter __intp, StackObject *__ret, IList <object> __mStack) { var result_of_this_method = ((global::UIRoot)o).fitHeight; __ret->ObjectType = ObjectTypes.Integer; __ret->Value = result_of_this_method ? 1 : 0; return(__ret + 1); }
static StackObject *CalculateRelativeRectTransformBounds_9(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj) { CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject *ptr_of_this_method; StackObject *__ret = ILIntepreter.Minus(__esp, 1); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); UnityEngine.Transform @trans = (UnityEngine.Transform) typeof(UnityEngine.Transform).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); var result_of_this_method = UnityEngine.RectTransformUtility.CalculateRelativeRectTransformBounds(@trans); return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method)); }
static StackObject *AssignFromStack_list_0(ref object o, ILIntepreter __intp, StackObject *ptr_of_this_method, IList <object> __mStack) { ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; System.Collections.Generic.List <global::UIRoot> @list = (System.Collections.Generic.List <global::UIRoot>) typeof(System.Collections.Generic.List <global::UIRoot>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); global::UIRoot.list = @list; return(ptr_of_this_method); }
static StackObject *TryGetValue_6(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj) { ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject *ptr_of_this_method; StackObject *__ret = ILIntepreter.Minus(__esp, 3); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); ILRuntime.Runtime.Intepreter.ILTypeInstance @value = (ILRuntime.Runtime.Intepreter.ILTypeInstance) typeof(ILRuntime.Runtime.Intepreter.ILTypeInstance).CheckCLRTypes(__intp.RetriveObject(ptr_of_this_method, __mStack), (CLR.Utils.Extensions.TypeFlags) 0); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); System.Type @key = (System.Type) typeof(System.Type).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags) 0); ptr_of_this_method = ILIntepreter.Minus(__esp, 3); System.Collections.Generic.Dictionary <System.Type, ILRuntime.Runtime.Intepreter.ILTypeInstance> instance_of_this_method = (System.Collections.Generic.Dictionary <System.Type, ILRuntime.Runtime.Intepreter.ILTypeInstance>) typeof(System.Collections.Generic.Dictionary <System.Type, ILRuntime.Runtime.Intepreter.ILTypeInstance>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags) 0); var result_of_this_method = instance_of_this_method.TryGetValue(@key, out @value); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); switch (ptr_of_this_method->ObjectType) { case ObjectTypes.StackObjectReference: { var ___dst = ILIntepreter.ResolveReference(ptr_of_this_method); object ___obj = @value; if (___dst->ObjectType >= ObjectTypes.Object) { if (___obj is CrossBindingAdaptorType) { ___obj = ((CrossBindingAdaptorType)___obj).ILInstance; } __mStack[___dst->Value] = ___obj; } else { ILIntepreter.UnboxObject(___dst, ___obj, __mStack, __domain); } } break; case ObjectTypes.FieldReference: { var ___obj = __mStack[ptr_of_this_method->Value]; if (___obj is ILTypeInstance) { ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = @value; } else { var ___type = __domain.GetType(___obj.GetType()) as CLRType; ___type.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, @value); } } break; case ObjectTypes.StaticFieldReference: { var ___type = __domain.GetType(ptr_of_this_method->Value); if (___type is ILType) { ((ILType)___type).StaticInstance[ptr_of_this_method->ValueLow] = @value; } else { ((CLRType)___type).SetStaticFieldValue(ptr_of_this_method->ValueLow, @value); } } break; case ObjectTypes.ArrayReference: { var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as ILRuntime.Runtime.Intepreter.ILTypeInstance[]; instance_of_arrayReference[ptr_of_this_method->ValueLow] = @value; } break; } __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 3); __intp.Free(ptr_of_this_method); __ret->ObjectType = ObjectTypes.Integer; __ret->Value = result_of_this_method ? 1 : 0; return(__ret + 1); }
static StackObject *AssignFromStack_manualWidth_1(ref object o, ILIntepreter __intp, StackObject *ptr_of_this_method, IList <object> __mStack) { ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; System.Int32 @manualWidth = ptr_of_this_method->Value; ((global::UIRoot)o).manualWidth = @manualWidth; return(ptr_of_this_method); }
static StackObject *CopyToStack_vertex_BR_0(ref object o, ILIntepreter __intp, StackObject *__ret, IList <object> __mStack) { var result_of_this_method = ((TMPro.TMP_CharacterInfo)o).vertex_BR; return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method)); }