labbbirder

Results 13 comments of labbbirder

It seems that i faced this issue too in 0.9.7. but i do not have so much task.I processed 28 and successed 17,but in the monitor i can only see...

see https://github.com/bigbaldy1128/DotNetDetour/issues/21#issuecomment-2059344745

不出意外应该是不支持的。根据仓库动态我猜测这个最开始为.Net Framewrok设计的。然而,在dotnet/runtime仓库中,`RuntimeMethodHandle.Value`对应的`MonoMethod*`+8字节后并不是函数入口地址。 如果想要支持需要改写目标地址,获取`ValuePtr(MonoMethod*)`后,`lookup_method(MonoMethod*)`能获取到`JitInfo*`,而lookup_method需要根据code hash查表。遗憾的是lookup_method并不是export function see https://github.com/dotnet/runtime/blob/main/src/mono/mono/mini/mini-runtime.c#L1908 入口查找代码 see https://github.com/dotnet/runtime/blob/8aea53e25f1e78bfbc31f91c6342177eb548eaa5/src/mono/mono/metadata/jit-info.h#L200 JitInfo结构体 好在发现了一个`mono_jit_info_table_find(MonoDomain*,void*)`方法,可以通过ftnptr获取jitInfo。第一个参数接收MonoDomain,直接使用AppDomain.CurrentDomain肯定是不行的,需要拿到底层对象的地址,这就需要另外一个`mono_domain_get`函数。 最终的代码如下,可供参考: ```csharp // Unity 编辑器环境 [DllImport("mono-2.0-bdwgc", EntryPoint = "mono_jit_info_table_find", CharSet = CharSet.Unicode)] extern static IntPtr FindJitInfo(IntPtr ptrDomain, IntPtr...

btw, 可以参考[MonoHook](https://github.com/Misaka-Mikoto-Tech/MonoHook/blob/master/Assets/Scripts/UnityHook/CodePatcher.cs#L70)的实现,不修改入口,直接修改originMethod jit code。也是一个可行的方法。

see https://github.com/bigbaldy1128/DotNetDetour/issues/21#issuecomment-2059344745

你好,@RudAns 。感谢你的分享,这个问题我之后会留意

> Thanks - now with parsing inolved I think it'd be good to extract getting analyzers to separate method and wrap it in error handling. It's in quite critical part...

I retried to repro it, but the problem no longer occurs, even I recovered my workspace with `git reset --hard` to that point. The issue first arose when I initially...

我自己也有混合Odin使用,没有出现问题。 可以看一下你的代码吗?