Exemplo n.º 1
0
        static void Main()
        {
            var shouter = new HelloWorldShouter();

            InjectorHelper.LogToFileInCurrentDir("nothing");
            Console.WriteLine(shouter.SayHelloWorld());

            Console.ReadLine();
        }
Exemplo n.º 2
0
 private static void Attach(WindowInfo windowInfo)
 {
     Mouse.OverrideCursor = Cursors.Wait;
     try
     {
         InjectorHelper.InjectLaunch(windowInfo,
                                     typeof(ProcessInfoWindow).Assembly,
                                     typeof(ProcessInfoWindow).FullName,
                                     nameof(ProcessInfoWindow.ShowInfo));
     }
     catch (Exception e)
     {
         MessageBox.Show("Failed to attach:" + e);
     }
     finally
     {
         Mouse.OverrideCursor = null;
     }
 }
Exemplo n.º 3
0
        private static IList <ProcessModuleInfo> GetProcessModuleInfos(Process process, ProcessInfoViewModel processInfoViewModel)
        {
            var isX64 = processInfoViewModel.IsX64;

            if (isX64 == null)
            {
                return(new List <ProcessModuleInfo>());
            }

            try
            {
                if ((Environment.Is64BitProcess && isX64 == true) || (!Environment.Is64BitProcess && isX64 == false))
                {
                    return(process.Modules.OfType <ProcessModule>()
                           .Select(m => new ProcessModuleInfo {
                        Name = m.ModuleName
                    })
                           .ToList());
                }
                else
                {
                    var modules = new List <ProcessModuleInfo>();
                    var proc    = InjectorHelper.GetLaunchProcess(InjectAction.ProcessInfo, isX64.Value, process.Id);
                    proc.Start();
                    while (!proc.StandardOutput.EndOfStream)
                    {
                        string line = proc.StandardOutput.ReadLine();
                        modules.Add(new ProcessModuleInfo {
                            Name = line
                        });
                    }

                    return(modules);
                }
            }
            catch (Exception ex)
            {
                processInfoViewModel.Error = ex.Message;

                return(new List <ProcessModuleInfo>());
            }
        }
 public GameManagerScript(SceneLoaderScript sceneLoader, InjectorHelper injectorHelper, SignalBus signalBus)
 {
     this.sceneLoader    = sceneLoader;
     this.injectorHelper = injectorHelper;
     this.signalBus      = signalBus;
 }