private void InjectButton_Click(object sender, EventArgs e)
        {
            Process[] pros = Process.GetProcessesByName("TslGame");
            Console.WriteLine(pros.Length);
            // SANITY CHECKS
            if (pros.Length == 0)
            {
                Log.ShowError("请先运行游戏,并且匹配成功进入游戏等待倒计时大厅", "错误");
                return;
            }
            // LOAD EXPLOITABLE DRIVER
            bool driverLoaded = false;

            if (!(driverLoaded = ElevateHandle.Driver.Load()))
            {
                Log.ShowError("CPUZ141.sys failed to load", "lol f**k");
                return;
            }

            ElevateHandle.UpdateDynamicData(); // UPDATE KERNEL OFFSETS
            ElevateHandle.Attach();            // ATTACH TO CURRENT PROCESS
            ElevateHandle.Elevate((ulong)pros[0].Handle, 0x1fffff);


            InjectionOptions options = new InjectionOptions()
            {
                ElevateHandle         = true,
                EraseHeaders          = true,
                CreateLoaderReference = false,
                LoaderImagePath       = Environment.CurrentDirectory + "\\ts.dll"
            };

            ExecutionType executionType = ExecutionType.HijackThread;

            IInjectionMethod injectionMethod = new ManualMapInjection(pros[0], executionType, options);

            //IInjectionMethod injectionMethod = new LoadLibraryInjection(g_SelectedProcess, executionType, options);
            injectionMethod.InjectImage(Environment.CurrentDirectory + "\\ts.dll");

            if (driverLoaded)
            {
                ElevateHandle.Driver.Unload();
            }
        }
Beispiel #2
0
        private void ButtonInitiateInjection_Click(object sender, EventArgs e)
        {
            // SANITY CHECKS
            if (g_SelectedProcess == null)
            {
                Log.ShowError("Please select a process!", "Lol are you f*****g retarded");
                return;
            }
            if (listImageListView.Items.Count == 0)
            {
                Log.ShowError("Please select atleast one image to inject!", "Lol are you f*****g retarded");
                return;
            }

            // Theme Song ;)
            // SoundPlayer soundPlayer = new SoundPlayer(Resources.Le_Bretonniere);
            // soundPlayer.Play();

            // LOAD EXPLOITABLE DRIVER
            bool driverLoaded = false;

            if (chkElevateHandle.Checked)
            {
                if (!(driverLoaded = ElevateHandle.Driver.Load()))
                {
                    Log.ShowError("CPUZ141.sys failed to load", "lol f**k");
                    return;
                }

                ElevateHandle.UpdateDynamicData(); // UPDATE KERNEL OFFSETS
                ElevateHandle.Attach();            // ATTACH TO CURRENT PROCESS
                ElevateHandle.Elevate((ulong)g_SelectedProcess.Handle, 0x1fffff);
            }

            InjectionOptions options = new InjectionOptions()
            {
                ElevateHandle         = chkElevateHandle.Checked,
                EraseHeaders          = chkEraseHeaders.Checked,
                CreateLoaderReference = false
            };

            ExecutionType executionType = 0;

            switch (comboExecutionMethod.SelectedIndex)
            {
            case 0:
                executionType = ExecutionType.CreateThread;
                break;

            case 1:
                executionType = ExecutionType.HijackThread;
                break;
            }

            IInjectionMethod injectionMethod = null;

            switch (comboInjectionMethod.SelectedIndex)
            {
            case 0:     // LOAD LIBRARY
                injectionMethod = new LoadLibraryInjection(g_SelectedProcess, executionType, options);
                break;

            case 1:     // MANUAL MAP
                injectionMethod = new ManualMapInjection(g_SelectedProcess, executionType, options);
                break;
            }

            foreach (ListViewItem item in listImageListView.Items)
            {
                if (injectionMethod.InjectImage(item.Text))
                {
                    Log.ShowInformation($"Successfully injected {item.Text} -> {g_SelectedProcess.ProcessName}", "Success");
                }
                else
                {
                    Log.ShowError($"Failed injection {item.Text} -> {g_SelectedProcess.ProcessName}", "f**k");
                }
            }

            if (driverLoaded)
            {
                ElevateHandle.Driver.Unload();
            }
        }
Beispiel #3
0
        private void InjectButton_Click(object sender, EventArgs e)
        {
            // SANITY CHECKS
            if (g_SelectedProcess == null)
            {
                Log.ShowError("Select a process!", "Error");
                return;
            }

            OpenFileDialog fileDialog = new OpenFileDialog()
            {
                Filter      = "Dynamic Link Library|*.dll",
                Multiselect = false
            };

            if (fileDialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            // LOAD EXPLOITABLE DRIVER
            bool driverLoaded = false;

            if (ElevateHandleCheckbox.Checked)
            {
                if (!(driverLoaded = ElevateHandle.Driver.Load()))
                {
                    Log.ShowError("CPUZ141.sys failed to load", "lol f**k");
                    return;
                }

                ElevateHandle.UpdateDynamicData(); // UPDATE KERNEL OFFSETS
                ElevateHandle.Attach();            // ATTACH TO CURRENT PROCESS
                ElevateHandle.Elevate((ulong)g_SelectedProcess.Handle, 0x1fffff);
            }

            InjectionOptions options = new InjectionOptions()
            {
                ElevateHandle         = ElevateHandleCheckbox.Checked,
                EraseHeaders          = EraseHeadersCheckbox.Checked,
                CreateLoaderReference = LinkModuleCheckbox.Checked,
                LoaderImagePath       = fileDialog.FileName
            };

            ExecutionType executionType = 0;

            switch (TypeCombo.SelectedIndex)
            {
            case 0:
                executionType = ExecutionType.CreateThread;
                break;

            case 1:
                executionType = ExecutionType.HijackThread;
                break;
            }

            IInjectionMethod injectionMethod = null;

            switch (ModeCombo.SelectedIndex)
            {
            case 0:     // MANUAL MAP
                injectionMethod = new ManualMapInjection(g_SelectedProcess, executionType, options);
                break;

            case 1:     // LOAD LIBRARY
                injectionMethod = new LoadLibraryInjection(g_SelectedProcess, executionType, options);
                break;
            }

            injectionMethod.InjectImage(fileDialog.FileName);

            if (driverLoaded)
            {
                ElevateHandle.Driver.Unload();
            }
        }