void injectDLL() { if (isInjecting) { return; } isInjecting = true; Logger.Instance.WriteLine("NoitaMod.NoitaModForm.injectDLL()"); var Dlls = new string[][] { //new string[]{ $@"{Directory.GetCurrentDirectory()}\NoitaMod.Log.dll"}, //new string[]{ $@"{Directory.GetCurrentDirectory()}\NoitaMod.API.dll"}, //new string[]{ $@"{Directory.GetCurrentDirectory()}\NoitaMod.Memory.dll"}, new string[] { $@"{Directory.GetCurrentDirectory()}\NoitaMod.Core.dll", "Entry" }, }; for (int i = 0; i < Dlls.Length; i++) { DLLInjectionResult result = Injector.Instance.Inject(processName, Dlls[i][0], Dlls[i].Length > 1 ? Dlls[i][1] : ""); if (i == Dlls.Length - 1) { switch (result) { case DLLInjectionResult.DLL_NOT_FOUND: InjectionStatus = StatusStrings.INSTALLATION_WRONG; break; case DLLInjectionResult.GAME_PROCESS_NOT_FOUND: InjectionStatus = StatusStrings.PROCESS_NOT_ACTIVE; break; case DLLInjectionResult.INJECTION_FAILED: InjectionStatus = StatusStrings.INJECTION_FAILED; break; case DLLInjectionResult.SUCCESS: InjectionStatus = StatusStrings.INJECTED; isInjected = true; break; } } Logger.Instance.WriteLine($"NoitaMod.NoitaModForm.injectDLL {Dlls[i][0]} {result}"); } isInjecting = false; }
void injectDLL() { DLLInjectionResult result = DllInjector.Instance.Inject("RocketLeague", bakkesModDirectory + "" + "bakkesmod.dll"); switch (result) { case DLLInjectionResult.DLL_NOT_FOUND: InjectionStatus = StatusStrings.INSTALLATION_WRONG; break; case DLLInjectionResult.GAME_PROCESS_NOT_FOUND: InjectionStatus = StatusStrings.PROCESS_NOT_ACTIVE; break; case DLLInjectionResult.INJECTION_FAILED: InjectionStatus = StatusStrings.INJECTION_FAILED; break; case DLLInjectionResult.SUCCESS: InjectionStatus = StatusStrings.INJECTED; isInjected = true; break; } }