BepInEx / Il2CppInterop

A tool interoperate between CoreCLR and Il2Cpp at runtime
GNU Lesser General Public License v3.0
185 stars 59 forks source link

ClassInjector.SystemTypeFromIl2CppType fails when types are prefixed. #135

Open WNP78 opened 1 month ago

WNP78 commented 1 month ago

ClassInjector.SystemTypeFromIl2CppType finds types by querying IL2CPP for their full name and assembly name and then using the managed Type.GetType on a string constructed from it, which fails when they have the Il2Cpp prefix added to them. I made a hacky fix, which just tries adding Il2Cpp if it fails without it, but there should probably be a better way that somehow checks if it's being prefixed.

ds5678 commented 1 month ago

I am open to reviewing pull requests that resolve this.

ds5678 commented 1 month ago

Enums currently have an original name attribute (when their namespace is prefixed). I would be open to expanding that to all types which had their namespace prefixed.