private void attachToolStripMenuItem_Click(object sender, EventArgs e) { FormSelectProgram fSelecProgram = new FormSelectProgram(); fSelecProgram.StartPosition = FormStartPosition.CenterParent; fSelecProgram.ShowDialog(); if (fSelecProgram.returnedValue == null) { return; } NktProcess process = fSelecProgram.returnedValue; bool hookedSuccessful = Program.hook.HookProcess(process); if (hookedSuccessful) { FormInfo fInfo = new FormInfo("Hook successful", 0, FormInfo.IconType.OK); fInfo.StartPosition = FormStartPosition.CenterParent; fInfo.Show(Program.formMain); Program.LogThis("Core", "Process " + process.Name + " hooked successfully"); } else { FormInfo fInfo = new FormInfo("Error hooking", 0, FormInfo.IconType.Error); fInfo.StartPosition = FormStartPosition.CenterParent; fInfo.Show(Program.formMain); Program.LogThis("Core", "Error hooking " + process.Name); } }
private void unhookToolStripMenuItem_Click(object sender, EventArgs e) { if (Program.hook.process == null) { return; } bool r = Program.hook.UnHook(); if (r) { FormInfo fInfo = new FormInfo("Unhooked!", 0, FormInfo.IconType.OK); fInfo.StartPosition = FormStartPosition.CenterParent; fInfo.Show(Program.formMain); Program.LogThis("Core", "Process " + Program.hook.process.Name + " unhooked"); Program.hook.process = null; } else { FormInfo fInfo = new FormInfo("Error hooking", 0, FormInfo.IconType.Error); fInfo.StartPosition = FormStartPosition.CenterParent; fInfo.Show(Program.formMain); Program.LogThis("Core", "Error hooking " + Program.hook.process.Name); } }
private void openToolStripMenuItem_Click(object sender, EventArgs e) { FormOpenProcess fop = new FormOpenProcess(); fop.ShowDialog(); if (fop.p != null) { bool r = true; try { r = fop.p.Start(); } catch { //MessageBox.Show(ex.Message); r = false; } if (r == false) { MessageBox.Show("Error starting " + fop.p.StartInfo.FileName); } else { try { // Puede dar una excepcion si la app no tiene una interfaz grafica fop.p.WaitForInputIdle(1000); } catch { } foreach (NktProcess process in Program.hook.spyMgr.Processes()) { if (process.Id == fop.p.Id) { bool hookedSuccessful = Program.hook.HookProcess(process); if (hookedSuccessful) { FormInfo fInfo = new FormInfo("Hook successful", 0, FormInfo.IconType.OK); fInfo.StartPosition = FormStartPosition.CenterParent; fInfo.Show(Program.formMain); Program.LogThis("Core", "Process " + process.Name + " hooked successfully"); } else { FormInfo fInfo = new FormInfo("Error hooking", 0, FormInfo.IconType.Error); fInfo.StartPosition = FormStartPosition.CenterParent; fInfo.Show(Program.formMain); Program.LogThis("Core", "Error hooking " + process.Name); } break; } } } } }
private void unhookToolStripMenuItem_Click(object sender, EventArgs e) { if (Program.hook.process == null) return; bool r = Program.hook.UnHook(); if (r) { FormInfo fInfo = new FormInfo("Unhooked!", 0, FormInfo.IconType.OK); fInfo.StartPosition = FormStartPosition.CenterParent; fInfo.Show(Program.formMain); Program.LogThis("Core", "Process " + Program.hook.process.Name + " unhooked"); Program.hook.process = null; } else { FormInfo fInfo = new FormInfo("Error hooking", 0, FormInfo.IconType.Error); fInfo.StartPosition = FormStartPosition.CenterParent; fInfo.Show(Program.formMain); Program.LogThis("Core", "Error hooking " + Program.hook.process.Name); } }
private void openToolStripMenuItem_Click(object sender, EventArgs e) { FormOpenProcess fop = new FormOpenProcess(); fop.ShowDialog(); if (fop.p != null) { bool r = true; try { r = fop.p.Start(); } catch { //MessageBox.Show(ex.Message); r = false; } if (r == false) MessageBox.Show("Error starting " + fop.p.StartInfo.FileName); else { try { // Puede dar una excepcion si la app no tiene una interfaz grafica fop.p.WaitForInputIdle(1000); } catch { } foreach (NktProcess process in Program.hook.spyMgr.Processes()) { if (process.Id == fop.p.Id) { bool hookedSuccessful = Program.hook.HookProcess(process); if (hookedSuccessful) { FormInfo fInfo = new FormInfo("Hook successful", 0, FormInfo.IconType.OK); fInfo.StartPosition = FormStartPosition.CenterParent; fInfo.Show(Program.formMain); Program.LogThis("Core", "Process " + process.Name + " hooked successfully"); } else { FormInfo fInfo = new FormInfo("Error hooking", 0, FormInfo.IconType.Error); fInfo.StartPosition = FormStartPosition.CenterParent; fInfo.Show(Program.formMain); Program.LogThis("Core", "Error hooking " + process.Name); } break; } } } } }
private void attachToolStripMenuItem_Click(object sender, EventArgs e) { FormSelectProgram fSelecProgram = new FormSelectProgram(); fSelecProgram.StartPosition = FormStartPosition.CenterParent; fSelecProgram.ShowDialog(); if (fSelecProgram.returnedValue == null) return; NktProcess process = fSelecProgram.returnedValue; bool hookedSuccessful = Program.hook.HookProcess(process); if (hookedSuccessful) { FormInfo fInfo = new FormInfo("Hook successful", 0, FormInfo.IconType.OK); fInfo.StartPosition = FormStartPosition.CenterParent; fInfo.Show(Program.formMain); Program.LogThis("Core", "Process " + process.Name + " hooked successfully"); } else { FormInfo fInfo = new FormInfo("Error hooking", 0, FormInfo.IconType.Error); fInfo.StartPosition = FormStartPosition.CenterParent; fInfo.Show(Program.formMain); Program.LogThis("Core", "Error hooking " + process.Name ); } }