After PR #220 I am crashing on calls to il2cpp_image_get_name. The runtime is calling free() on the returned pointer, which is invalid because all pointers returned by il2cpp_image_get_name are pointers into the middle of global-metadata.dat. This is in a .NET 8.0 runtime. I believe this is because marshaling is expecting that when a char* is returned and marshaled to a string it was heap/malloc() allocated and needs to be freed after being converted into a managed string.
I think all of the string related marshaling in IL2CPP.cs should be reconsidered since the il2cpp_* API is generally not returning heap/malloc() allocated strings.