knah / Il2CppAssemblyUnhollower

A tool to generate Managed->IL2CPP proxy assemblies
GNU Lesser General Public License v3.0
499 stars 88 forks source link

netcore support #67

Open shalzuth opened 3 years ago

shalzuth commented 3 years ago

note - this also forces all types to not be sequential. need to filter better. this pr addresses https://github.com/knah/Il2CppAssemblyUnhollower/issues/44

ds5678 commented 3 years ago

As I understand things, now that 0.4.15.3 has been released, all changes should be directed to the v0.5.x-wip branch.

One of the goals for v0.5 is generation of assemblies that are compatible with dot net 5. For example, Pass 24 has already been removed in eeaa230376d1ff8348ad11b682b61c51d87515e2

You can view more information about v0.5 in the documentation folder.

shalzuth commented 3 years ago

I’ll look at 0.5. Will keep this open in the meantime for discussion if that’s okay.

shalzuth commented 3 years ago

https://github.com/knah/Il2CppAssemblyUnhollower/blob/eeaa230376d1ff8348ad11b682b61c51d87515e2/UnhollowerBaseLib/ClassInjector.cs#L457 is also invalid .net (where mono doesn't care). I think we can remove it without any issue, and this looks like a bug anyway. If any method in an injected class returns a non-void value, it would return here instead of actually returning the result.

shalzuth commented 3 years ago

My GC was free'ing the TypeToClassDelegate from https://github.com/knah/Il2CppAssemblyUnhollower/blob/eeaa230376d1ff8348ad11b682b61c51d87515e2/UnhollowerBaseLib/ClassInjector.cs#L509 as well. This delegate should be alloc'd, or made static, correct? Doing so fixes my implementation. The other delegate hookedClassFromName is static, so it doesn't get GC'd ever.

Edit - nvm, fixed here https://github.com/knah/Il2CppAssemblyUnhollower/blob/eeaa230376d1ff8348ad11b682b61c51d87515e2/UnhollowerBaseLib/ClassInjector.cs#L591