internal InjectionManager(string processName, string dllPath, InjectionMethod injectionMethod, InjectionFlags injectionFlags) { _injectionWrapper = new InjectionWrapper(GetProcess(processName), dllPath, injectionMethod, injectionFlags); ValidationHandler.ValidateDllArchitecture(_injectionWrapper); _ejectDll = new EjectDll(_injectionWrapper); _hideDllFromPeb = new HideDllFromPeb(_injectionWrapper); _injectionMethod = InitialiseInjectionMethod(injectionMethod); }
internal InjectionManager(int processId, byte[] dllBytes, InjectionMethod injectionMethod, InjectionFlags injectionFlags) { _injectionWrapper = new InjectionWrapper(GetProcess(processId), dllBytes, injectionMethod, injectionFlags); ValidationHandler.ValidateDllArchitecture(_injectionWrapper); _ejectDll = new EjectDll(_injectionWrapper); _hideDllFromPeb = new HideDllFromPeb(_injectionWrapper); _injectionMethod = InitialiseInjectionMethod(injectionMethod); }
internal InjectionManager(InjectionMethod injectionMethod, string processName, string dllPath) { _injectionContext = new InjectionContext(); _injectionWrapper = new InjectionWrapper(injectionMethod, processName, dllPath); _injectionExtensionCache = new Dictionary <string, IInjectionExtension> { { "EjectDll", new EjectDll(_injectionWrapper) }, { "HideDllFromPeb", new HideDllFromPeb(_injectionWrapper) }, { "RandomiseDllHeaders", new RandomiseDllHeaders(_injectionWrapper) } }; var injectionMethodType = Type.GetType(string.Concat("Bleak.Injection.Methods.", injectionMethod.ToString())); _injectionMethod = (IInjectionMethod)Activator.CreateInstance(injectionMethodType, _injectionWrapper); // Ensure the architecture of the DLL is valid ValidationHandler.ValidateDllArchitecture(_injectionWrapper); }
internal InjectionManager(InjectionMethod injectionMethod, string processName, byte[] dllBytes) { _injectionContext = new InjectionContext(); _injectionWrapper = new InjectionWrapper(injectionMethod, processName, dllBytes); _injectionExtensionCache = new Dictionary <string, IInjectionExtension> { { nameof(EjectDll), new EjectDll(_injectionWrapper) }, { nameof(HideDllFromPeb), new HideDllFromPeb(_injectionWrapper) }, { nameof(RandomiseDllHeaders), new RandomiseDllHeaders(_injectionWrapper) } }; var injectionMethodType = Type.GetType("Bleak.Injection.Methods." + injectionMethod); _injectionMethod = (IInjectionMethod)Activator.CreateInstance(injectionMethodType, _injectionWrapper); // Ensure the architecture of the DLL is valid ValidationHandler.ValidateDllArchitecture(_injectionWrapper); }
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(); } }
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(); } }