Il2CppInterop icon indicating copy to clipboard operation
Il2CppInterop copied to clipboard

Metadata 27+ Xref crash fix

Open HookedBehemoth opened this issue 1 year ago • 9 comments

On previous versions, one call per method instantiated all globals used. Now there is one call per global. Instead of a method-handle, the pointers are passed directly. With method inlining, multiple of these blocks are added into one method

This bug would manifest as hard crashes during xref on methods that weren't fully initialized by the runtime.

TODO: Only one of the flags is set and we might check the wrong one

I got distracted and never properly implemented this. I hope these patches can help you.

HookedBehemoth avatar Oct 26 '23 20:10 HookedBehemoth

I think the pointers where just polluted so I couldn't just null check, but I'm not sure anymore

HookedBehemoth avatar Oct 26 '23 20:10 HookedBehemoth

This is still too brittle... I'm getting crashes with some functions again.

HookedBehemoth avatar Nov 12 '23 17:11 HookedBehemoth

Did anyone get a chance to look into this PR or the issue at hand? It would be nice to get the issue resolved upstream.

HookedBehemoth avatar Jan 15 '24 00:01 HookedBehemoth

Any updates on this? @HookedBehemoth I wasn't able to find you on Melon or BepInEx's server anymore

krulci avatar Apr 08 '24 20:04 krulci

Works but the maintainers here don't seem to be interested in having this upstream

HookedBehemoth avatar Apr 08 '24 21:04 HookedBehemoth

Works but the maintainers here don't seem to be interested in having this upstream

In some version, I am getting Op0Kind = Register

krulci avatar Apr 08 '24 21:04 krulci

Do you actually know what this patch is for or do you just use this issue to report a bug that has nothing to do with this?

HookedBehemoth avatar Apr 08 '24 21:04 HookedBehemoth

Do you actually know what this patch is for or do you just use this issue to report a bug that has nothing to do with this?

I am not entirely sure if is related. But, using this PR or the original with Metadata 29, I get Argument out of range on certain xref. The op0kind is register. I supposed the address decoder has some issue.

krulci avatar Apr 09 '24 10:04 krulci

So it probably has nothing to do with this patch?

HookedBehemoth avatar Apr 09 '24 11:04 HookedBehemoth