Пример #1
0
 private static void PrepareAndInject()
 {
     FileChecks();
     SettingsCheck();
     _mutexEvent.Close();
     Launch.Run();
 }
Пример #2
0
        static void MainTwo()
        {
            // Setting culture for float etc (. instead of ,)
            CultureInfo.DefaultThreadCurrentCulture   = CultureInfo.InvariantCulture;
            CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.InvariantCulture;
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            // ClassicFramework cant be run alone!
            if (Process.GetCurrentProcess().ProcessName.StartsWith("ClassicFramework"))
            {
                if (!Assembly.GetExecutingAssembly().Location.ToLower().Contains("internal"))
                {
                    MessageBox.Show("Your file structure is corrupt. Please redownload ClassicFramework");
                    Environment.Exit(-1);
                }
                // Do the settings exist?
                if (!File.Exists(".\\Settings.xml"))
                {
                    OpenFileDialog loc = new OpenFileDialog();
                    loc.CheckFileExists = true;
                    loc.CheckPathExists = true;
                    loc.Filter          = "executable (*.exe)|*.exe";
                    loc.FilterIndex     = 1;
                    loc.Title           = "Please locate your WoW.exe";
                    if (loc.ShowDialog() == DialogResult.OK)
                    {
                        OOP.Settings.Recreate(loc.FileName);
                    }
                }
                Launch.Run();
                Environment.Exit(0);
            }
            WinImports.LoadLibrary(
                Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\FastCallDll.dll"
                );
            //WinImports.AllocConsole();
            //Logger.Append("We are injected now!");

            string    path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            XDocument doc  = XDocument.Load(path + "\\Settings.xml");
            XElement  loot = doc.Element("Settings").Element("AutoLoot");

            LuaFunctions.CustomFuncs.AutoLoot.enabled = Convert.ToBoolean(loot.Value);
            Memory.Init();
            RegisterFunctionHook.Init();
            UnregisterFunctionHook.Init();
            if (LuaFunctions.CustomFuncs.AutoLoot.enabled)
            {
                OnRightClickUnitHook.Apply();
                OnRightClickObjectHook.Apply();
            }
            Singleton.Initialise();
            while (true)
            {
                Thread.Sleep(250);
            }
            // Run the GUI
            //Application.Run(new Main());
        }
Пример #3
0
        private static void PrepareAndInject(int?pId = null)
        {
            if (!Directory.Exists("mmaps"))
            {
                QuitWithMessage("Download the mmaps first please");
            }
            if (Directory.GetFileSystemEntries("mmaps").Length < 1000)
            {
                QuitWithMessage("Download the mmaps first please");
            }
            else
            {
                if (!File.Exists("mmaps\\Version.ini"))
                {
                    QuitWithMessage("Wrong mmaps version! Please redownload");
                }

                int mmapVersion;
                var result = int.TryParse(File.ReadAllText("mmaps\\Version.ini"), out mmapVersion);
                if (!result)
                {
                    QuitWithMessage("Bad mmaps version identifier! Please check mmaps\\Version.ini");
                }

                if (mmapVersion != mmapVersionConst)
                {
                    QuitWithMessage("Wrong mmaps version! Please redownload");
                }
            }
            if (GetMD5AsBase64("Fasm.NET.dll") != Resources.FasmNetMd5)
            {
                QuitWithMessage("Fastm.NET.dll is broken. Please redownload");
            }

            // Do the settings exist?
            if (!File.Exists("..\\Settings\\Settings.xml"))
            {
                while (true)
                {
                    var loc = new OpenFileDialog
                    {
                        CheckFileExists = true,
                        CheckPathExists = true,
                        Filter          = "executable (*.exe)|*.exe",
                        FilterIndex     = 1,
                        Title           = "Please locate your WoW.exe"
                    };
                    if (loc.ShowDialog() == DialogResult.OK)
                    {
                        if (loc.FileName == Assembly.GetExecutingAssembly().Location)
                        {
                            MessageBox.Show(
                                "FFS DIDNT THE WINDOW TITLE STATE TO TARGET THE WOW.EXE? WHY THE FCK SHOULD YOU SELECT THE ZZUKBOT.EXE?!?! FFS");
                        }
                        else
                        {
                            OOP.Settings.Recreate(loc.FileName);
                            break;
                        }
                    }
                    else
                    {
                        break;
                    }
                }
            }
            s_event.Close();
            Launch.Run(pId);
        }