Beispiel #1
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        /// <param name="args"></param>
        public static void Main(string[] args)
        {
            #if DEBUG
            Debugger.Launch();
            #endif

            // Find Assemblies Manually if necessary (Deprecate app.config)
            AppDomain.CurrentDomain.AssemblyResolve += AssemblyFinder.CurrentDomain_AssemblyResolve;

            /* - Initialization - */
            IgnoreSquirrel();
            ParseArguments(args);

            LoaderConsole.Initialize();
            SetuplibReloadedBindings();
            Banner.Execute();
            Controllers.PrintControllerOrder();
            DllUnlocker.UnblockDlls();          // Removes Zone Information which may prevent DLL injection if DLL was downloaded from e.g. Internet Explorer
            LoaderServer.SetupServer();

            /* - Boot up Reloaded Assembler, Get the Game Process running/attached and with mods running. - */
            Assembler.Assemble(new string[] { "use32", "nop eax" }); // Startup Assembler (So a running instance/open handle does not bother devs working on mods)
            GetGameProcess(args);
            InjectMods(args);

            // Resume game after injection if we are NOT in attach mode.
            if (_attachTargetName == null)
            {
                _gameProcess.ResumeAllThreads();
            }

            // Stay alive in the background
            AppDomain.CurrentDomain.ProcessExit += Shutdown;
            Console.CancelKeyPress += Shutdown;

            // Wait infinitely.
            while (true)
            {
                Console.ReadLine();
            }
        }