Пример #1
0
        public async Task <InjectionResult> Inject(string dllLocation, IProgress <string> progress,
                                                   CancellationToken cancellationToken)
        {
            while (GetOsuProcess() != null)
            {
                await Task.Delay(2000, cancellationToken);

                progress?.Report("Waiting for osu! process to close");
            }

            Process process;

            do
            {
                await Task.Delay(2000, cancellationToken);

                progress?.Report("Waiting for osu! process to start");
            } while (!(
                         (process = GetOsuProcess()) != null &&
                         !process.MainWindowTitle.Contains("osu! updater") &&
                         !string.IsNullOrEmpty(process.MainWindowTitle))
                     );

            progress?.Report("Injecting");

            DllInjector dllInjector = DllInjector.GetInstance;
            var         result      = dllInjector.Inject("osu!", dllLocation);

            return(new InjectionResult(result.InjectionResult, result.errorCode, result.Win32Error, "_"));
        }
Пример #2
0
        private DllInjectionResult Inject(string dllLocation)
        {
            DllInjector dllInjector = DllInjector.GetInstance;

            return(dllInjector.Inject("osu!", dllLocation));
        }
Пример #3
0
        private (DllInjectionResult InjectionResult, int ErrorCode, int Win32Error) Inject(string dllLocation)
        {
            DllInjector dllInjector = DllInjector.GetInstance;

            return(dllInjector.Inject("osu!", dllLocation));
        }