warbler / SharpMonoInjector

A tool for injecting assemblies into Mono embedded applications, commonly Unity Engine based games
MIT License
310 stars 108 forks source link

Example assembly problem #3

Closed trolloos closed 5 years ago

trolloos commented 6 years ago

So I used Visual Studio Installer to include the game development with unity workload and I even added the optional "Unity 2017.2 64-bit Editor". So then I opened the example assembly but the reference to UnityEngine was broken somehow? It did not automatically get the reference right so I added it manually "C:\Program Files\Unity\Editor\Data\Managed\UnityEngine.dll". So then the example assembly compiles fine but the .dll is only 4kb? That can not be right? It also just crashes on injection so something must be wrong. Or am I using the wrong version of the UnityEngine.dll compared to the process I am injecting to? I don't know if they should be the same?? I also tried the "Embed Interop Types" but then it won't compile because of the errors.

Igie commented 6 years ago

They should be the same. Reference UnityEngine.dll from the game directory, everything should work fine

trolloos commented 6 years ago

I fixed it by adding a reference to UnityEngine.CoreModule.dll the class object or gameobject wasn't available in UnityEngine.dll. And I guess you also need UnityEngine.IMGUIModule.dll.

But then again my exampleassembly.dll is still only 4kb so it is still not injecting properly and working. It just crashes.

stadnitchii commented 6 years ago

I am crashing as well. Using debug it crashes during in [Injector.cs, line 83].

Trying to attach example Assembly to a game called 360 No Scope Arena. The game, dll, and Form are all build to target x64.

Additionally if I continue the debugger it shows me this error message. ERROR: Injection Failed: GetImageFromAssembly() = 0

Although this is not where the game crashes. It crashes at OpenImageFromData()

jpitty03 commented 6 years ago

I'm getting the same error as Raptor2277. ERROR: Injection Failed: GetImageFromAssembly() = 0

JamesRoche commented 5 years ago

Same issue here, any help?

waltcobb commented 5 years ago

Any updates or fixes to this?

warbler commented 5 years ago

Sorry about the late response. If any of you see this, please try injecting with the latest release and let me know how it goes.