private void btnClearStartupFiles_Click(object sender, EventArgs e) { if (lvClearStartupFiles.Items.Count == 0) { MessageBox.Show("您还未进行启动项扫描,请先扫描!", "RepairTools 启动项修复", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { if (lvClearStartupFiles.CheckedItems.Count == 0) { MessageBox.Show("您未选定任何启动项,无法执行修复工作", "RepairTools 启动项修复", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { DialogResult response = MessageBox.Show("确定清除选定的启动项?", "RepairTools 启动项修复", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); { if (response == DialogResult.OK) { foreach (ListViewItem lvi in lvClearStartupFiles.CheckedItems) { RegistryOperate.deleteStartupFiles(lvi.Text); lvi.Remove(); } MessageBox.Show("已成功修复您选定的启动项!", "RepairTools 启动项修复", MessageBoxButtons.OK, MessageBoxIcon.Information); lvStartupFileList.Items.Clear(); } } } } }
private void btnImageHiijkClear_Click(object sender, EventArgs e) { if (lvImageHiijkClear.Items.Count == 0) { MessageBox.Show("您还未进行映像劫持状态扫描,请先扫描状态!", "RepairTools 映像劫持修复", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { if (lvImageHiijkClear.CheckedItems.Count == 0) { MessageBox.Show("您未选定任何映像劫持项,无法执行修复工作", "RepairTools 映像劫持修复", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { DialogResult response = MessageBox.Show("确定要清除选定的项目?", "RepairTools 映像劫持修复", MessageBoxButtons.OK, MessageBoxIcon.Question); { if (response == DialogResult.OK) { foreach (ListViewItem lvi in lvImageHiijkClear.CheckedItems) { RegistryOperate.deleteSubKey(lvi.Text); lvi.Remove(); } lvImageHijacks.Items.Clear(); MessageBox.Show("已成功修复您选定的映像劫持项!", "RepairTools 映像劫持修复", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } } }
private void btnCheckRegistry_Click(object sender, EventArgs e) { IsCheckRegistry = 1; if (RegistryOperate.registryRead() == true) { this.pBoxRegistryState.Image = RepairTools_2._0.Properties.Resources.checkok; this.lblRegistryState.Text = "注册表状态正常"; this.lblRegistryState.ForeColor = Color.Green; this.pboxRepairHidenRegistry.Image = RepairTools_2._0.Properties.Resources.checkok; this.lblRepairHidenFileRegistryState.Text = "注册表状态正常"; this.lblRepairHidenFileRegistryState.ForeColor = Color.Green; this.btnRepairHidenRegistry.Enabled = false; this.lblRepairHidenRegistryTip.Visible = false; if (btnEnableRegMonitor.Enabled == true) { notifyIcon.ShowBalloon("RepairTools 安全工具", "注册表正常,您可以打开注册表实时监控来保护关键位置!", NotifyIconEx.NotifyInfoFlags.Info, 2); } } else if (RegistryOperate.registryRead() == false) { this.pBoxRegistryState.Image = RepairTools_2._0.Properties.Resources.checkno; this.lblRegistryState.Text = "注册表状态异常,请即时修复"; this.lblRegistryState.ForeColor = Color.Red; this.pboxRepairHidenRegistry.Image = RepairTools_2._0.Properties.Resources.checkno; this.lblRepairHidenFileRegistryState.Text = "注册表状态异常,请即时修复"; this.lblRepairHidenFileRegistryState.ForeColor = Color.Red; this.btnRepairHidenRegistry.Enabled = true; this.btnGoHiddenRegistryRepair.Enabled = true; } }
private void btnEnableRegMonitor_Click(object sender, EventArgs e) { pboxRegMonitor.Image = RepairTools_2._0.Properties.Resources.reg; btnEnableRegMonitor.Enabled = false; btnDisableRegMonitor.Enabled = true; notifyIcon.ShowBalloon("RepairTools 安全工具", "您开启了关键位置注册表实时监控,实时保护您的计算机安全!", NotifyIconEx.NotifyInfoFlags.Info, 2); registryMonitorRun = new RegistryMonitor(RegistryOperate.getRun()); registryMonitorRun.RegChanged += new EventHandler(OnRegChanged); registryMonitorRun.Error += new System.IO.ErrorEventHandler(OnError); registryMonitorRun.Start(); }
private void btnRepairHidenRegistry_Click(object sender, EventArgs e) { if (IsCheckRegistry == 0) { MessageBox.Show("您还未检测注册表状态,请先检测!", "RepairTools 注册表修复", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { RegistryOperate.registrySetValue("CheckedValue", 1); this.pboxRepairHidenRegistry.Image = RepairTools_2._0.Properties.Resources.checkok; this.lblRepairHidenFileRegistryState.Text = "注册表修复成功!"; this.btnRepairHidenRegistry.Enabled = false; this.pBoxRegistryState.Image = RepairTools_2._0.Properties.Resources.checknot; this.lblRegistryState.Text = "状态未检测"; notifyIcon.ShowBalloon("RepairTools 安全工具", "修复注册表后,您可以打开注册表实时监控来保护关键位置!", NotifyIconEx.NotifyInfoFlags.Info, 2); } }
private void btnReadImageHijack_Click(object sender, EventArgs e) { ListViewItem lvi; ListViewItem.ListViewSubItem lvsi; try { lvImageHijacks.BeginUpdate(); lvImageHiijkClear.BeginUpdate(); lvImageHijacks.Items.Clear(); lvImageHiijkClear.Items.Clear(); foreach (string str in RegistryOperate.strRegistry()) { if (RegistryOperate.checkImageValue(str)) { RegistryKey temp = RegistryOperate.getImage().OpenSubKey(str); string sourceApp = temp.GetValue("Debugger").ToString(); if (sourceApp == null) { sourceApp = temp.GetValue("debugger").ToString(); } lvi = new ListViewItem(); lvsi = new ListViewItem.ListViewSubItem(); lvi.Text = str; lvsi.Text = sourceApp; lvsi.Tag = sourceApp; lvi.SubItems.Add(lvsi); lvImageHijacks.Items.Add(lvi); lvImageHiijkClear.Items.Add((ListViewItem)lvi.Clone()); } } lvImageHijacks.EndUpdate(); lvImageHiijkClear.EndUpdate(); } catch { } if (lvImageHijacks.Items.Count == 0) { MessageBox.Show("没有检测到映像劫持项!\n如果杀毒软件还不能打开,请重新安装!", "RepairTools 映像劫持检测", MessageBoxButtons.OK, MessageBoxIcon.Information); btnGoImageHiijacksClear.Enabled = false; return; } this.btnGoImageHiijacksClear.Enabled = true; }
private void btnRunSearch_Click(object sender, EventArgs e) { lvClearStartupFiles.Items.Clear(); try { ListViewItem lvi; ListViewItem.ListViewSubItem lvsi; showSystemIcon showIcon = new showSystemIcon(); this.lvStartupFileList.Items.Clear(); lvStartupFileList.BeginUpdate(); lvClearStartupFiles.BeginUpdate(); foreach (string str in RegistryOperate.strRunRegistry()) { string str1 = RegistryOperate.getRun().GetValue(str).ToString(); string str2 = stringChecker.stringReplacer(str1); showIcon.ListViewSysImages(lvStartupFileList); lvi = new ListViewItem(); lvi.Text = str; int systemIconIndex = showIcon.FileIconIndex(@str2); if (systemIconIndex != 0) { lvi.ImageIndex = systemIconIndex; } else { lvi.ImageIndex = 3; } lvsi = new ListViewItem.ListViewSubItem(); lvsi.Text = str2; lvi.SubItems.Add(lvsi); lvStartupFileList.Items.Add(lvi); lvClearStartupFiles.Items.Add((ListViewItem)lvi.Clone()); } lvStartupFileList.EndUpdate(); lvClearStartupFiles.EndUpdate(); } catch { } this.btnGoStartupClear.Enabled = true; }
private void btnNotAddAutorun_Click(object sender, EventArgs e) { RegistryOperate.deleteRunKey(); MessageBox.Show("删除启动项成功,软件在您下次开机时不再自动运行!", "RepairTools 安全工具", MessageBoxButtons.OK, MessageBoxIcon.Information); }
private void btnAddAutorun_Click(object sender, EventArgs e) { RegistryOperate.setRunKey(Application.StartupPath + "\\RepairTools 2.0.exe"); MessageBox.Show("添加启动项成功,软件在您下次启动机器时自动运行!", "RepairTools 安全工具", MessageBoxButtons.OK, MessageBoxIcon.Information); }