public formMain() { InitializeComponent(); // Create the tab manager tabControlMain.TabPages.Clear(); tabManager = new oTabManager(tabControlMain, toolStrip2, panelVisualization, panelPlay, panelMain); // Add the basic tabs tabManager.addIntroTab("Introduction Page", true); //tabManager.addFunctionListTab("Function List: Empty", new oFunctionList( new List<oFunction>()), true ); //tabManager.addAssemblyViewerTab("Assembly Viewer 1",false); //tabManager.addAssemblyViewerTab("Assembly Viewer 2",false); //tabManager.addMemoryViewerTab("Memory Viewer", false); // Main lock the tab control tabManager.mainLock(true); //Hotkey handler (we can register more hotkeys if we need them) hotKey = new SystemHotKey(Keys.F5, SystemHotKey.KeyModifiers.Control, OnHotKey); }
/// <summary> /// Attach process for injection /// </summary> /// <param name="process"></param> private void AttachProcess(Process process) { try { oProcess.clearActiveProcess(tabManager); if (process == null) { FormSelectProcess selectProcess = new FormSelectProcess(); oConsole.printMessage("Prompting user for process to attach to..."); selectProcess.ShowDialog(this); } else { // Set the active process oProcess.activeProcess = process; } // If we have an active process then make our code injections if (oProcess.activeProcess != null) { // Let the user select the modules formSelectModules selectModule = new formSelectModules(); oConsole.printMessage("Prompting user for modules to analyze..."); if (selectModule.ShowDialog(this) == DialogResult.OK) { oConsole.printMessage(oProcess.activeModules.Count + " modules were selected by user."); // Initialize the process information oProcess.generateMemoryMap(); initProcessInformation(); // Let the user modify the selected heaps if desired formSelectHeaps selectHeaps = new formSelectHeaps(oProcess.map, oProcess.activeModules, oProcess.disassemblyMode, this); selectHeaps.ShowDialog(this); if (selectHeaps.DialogResult == DialogResult.OK) { // Begin disassembly process oConsole.printMessage("Disassemblying active modules..."); oProcess.disassembleProcess(this, selectHeaps.getSelectedHeaps()); // Begin the injection process if (oProcess.inject(this, selectHeaps.getInvalidSourceHeaps())) { tabManager.addFunctionListTab("Function List: Full", new oFunctionList(oFunctionMaster.functions), true, false); tabManager.mainLock(false); // release our lock } else { tabManager.mainLock(true); // lock the tab bar oConsole.printMessageShow("ERROR: Failed to inject code."); } } else { tabManager.mainLock(true); // lock the tab bar oConsole.printMessage("The user cancelled at the heap selection menu."); } } else { tabManager.mainLock(true); // lock the tab bar oConsole.printMessage("No modules were selected by user."); } } else { tabManager.mainLock(true); // lock the tab bar } } catch (Exception ex) { tabManager.mainLock(true); // lock the tab bar oConsole.printException(ex); } }