可以留意到,MethodInfo里还有个函数指针字段:virtualMethodPointer,这个指针看代码this是引用类型和methodPointer是一样的,但值类型会指向AdjustorThunk方法,AdjustorThunk又是什么?简单看个例子: IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t MyStruct_Add_mB860BC1DB3698275F3F9AFD21611C5E4D13D0401 (SSS_t6A4B0324...
;void*L_2=___2_methodPtr;InvokerActionInvoker2<Il2CppFullySharedGenericAny,Il2CppFullySharedGenericAny*>::Invoke(il2cpp_codegen_get_direct_method_pointer((constRuntimeMethod*)L_2),(constRuntimeMethod*)L_2,(il2cpp_codegen_class_is_value_type(il2cpp_rgctx_data_no_init(method->rgctx_data,...
Invoker_method:为C#函数对应的上层调用函数地址,Unity的IL2CPP机制按照不同C#函数参数定义了不同的上层C调用函数(其中调用方式为间接调用)。 通过_FDynamicSceneTrigger_OnTriggerEnter_m25168_MethodInfo结构可知_FDynamicSceneTrigger_OnTriggerEnter_m25168函数的上层调用RuntimeInvoker_Void_t2689_Object_t(MethodInfo const...
il2cpp_codegen_raise_exception(il2cpp_codegen_get_not_supported_exception("Unableto find method for p/invoke: 'Increment'")); } } int32_t _return_value = _il2cpp_pinvoke_func(___value); return _return_value; } 首先,我们来一个typedef: typedef int32_t (DEFAULT_CALL *PInvokeFunc) (int...
var methodInfo = typeof(Important).GetMethod("Method"); methodInfo.Invoke(important, new object[] {question}); } private static Important ImportantFactory() { var important = new Important(); 有了这些以后,我们就可以开始了。还记得所有生成的C++代码都会临时存放 在TempStagingAreaDatail2cppOutput目录...
NotSupportedException: IL2CPP does not support marshaling delegates that point to instance methods to native code. The method we're attempting to marshal is: Win32WindowExtensions+<>c__DisplayClass0_0::<FindVisibleWindows>g__OnWindowEnum|0 at Lsj.Util.Win32.User32.EnumWindows (Lsj.Util.Win32...
MethodInfo*inflatedMethod=(MethodInfo*)MetadataCalloc(1,sizeof(MethodInfo)); inflatedMethod->name=StringUtils::StringDuplicate(genericArrayMethod.name.c_str()); inflatedMethod->klass=klass; constMethodInfo*methodToCopyDataFrom=genericArrayMethod.method; ...
AnswerFinderInterface_t11_il2cpp_TypeInfo_var = il2cpp_codegen_class_from_type(&AnswerFinderInterface_t11_0_0_0);s_Il2CppMethodIntialized =true;} {int32_t L_0 = (int32_t)InterfaceFuncInvoker0<int32_t>::Invoke(0/* System.Int32 HelloWorld/AnswerFinderInterface::ComputeAnswer() */, Answe...
_il2cpp_pinvoke_func) { _il2cpp_pinvoke_func = (PInvokeFunc)Increment; if (_il2cpp_pinvoke_func == NULL) { il2cpp_codegen_raise_exception(il2cpp_codegen_get_not_supported_exception("Unable to find method for p/invoke: 'Increment'")); } } int32_t _return_value = _il2cpp_pinvoke_...
str().c_str()) //save file *mOs << imageOutput.str(); return orig_il2cpp_runtime_invoke(method, obj, params, exc); } 打印效果如下,大量方法都会进行回溯 ,在游戏里的对局也会有函数调用 : 1 2 3 4 5 6 7 8 9 10 11 12 13 2023-04-13 13:49:58.773 3635-4153/? E/Zhenxi: [...