Esempio n. 1
0
        public static void Init()
        {
            MessageBoxPatch.Replace("tp9+kFO7LOSD0AZ5zUBHrA==", Resources.Disclaimer);

            var factory = new ChannelFactory <ILauncherService>(new NetNamedPipeBinding(), "net.pipe://localhost/LauncherService");

            LauncherService = factory.CreateChannel();

            ServiceHost host = new ServiceHost(typeof(InjectorService), new Uri("net.pipe://localhost/InjectorService"));

            host.AddServiceEndpoint(typeof(IInjectorService), new NetNamedPipeBinding(), "");
            host.Open();

            LauncherService.SendInjectorSettings();

            var harmony  = HarmonyInstance.Create("me.failedshack.usbhelperinjector");
            var assembly = Assembly.GetExecutingAssembly();

            assembly.GetTypes()
            .Where(type => VersionSpecific.Applies(type, HelperVersion) && !(Overrides.DisableOptionalPatches && Optional.IsOptional(type)))
            .Do(type =>
            {
                var parentMethodInfos = type.GetHarmonyMethods();
                if (parentMethodInfos != null && parentMethodInfos.Count() > 0)
                {
                    var info      = HarmonyMethod.Merge(parentMethodInfos);
                    var processor = new PatchProcessor(harmony, type, info);
                    processor.Patch();
                }
            });
        }
Esempio n. 2
0
        public static void Init()
        {
            MessageBoxPatch.Replace("tp9+kFO7LOSD0AZ5zUBHrA==", Resources.Disclaimer);

            server = new PipeServerListener();
            server.Listen();
        }
Esempio n. 3
0
        public static void Init()
        {
            MessageBoxPatch.Replace("tp9+kFO7LOSD0AZ5zUBHrA==", Resources.Disclaimer);

            var factory = new ChannelFactory <ILauncherService>(new NetNamedPipeBinding(), "net.pipe://localhost/LauncherService");

            LauncherService = factory.CreateChannel();

            ServiceHost host = new ServiceHost(typeof(InjectorService), new Uri("net.pipe://localhost/InjectorService"));

            host.AddServiceEndpoint(typeof(IInjectorService), new NetNamedPipeBinding(), "");
            host.Open();

            Task.Run(async() => await LauncherService.SendInjectorSettings());
        }