コード例 #1
0
ファイル: GUI_Main.cs プロジェクト: ibrahim-elsakka/LiveDump
        private void proc_btn_select_Click(object sender, EventArgs e)
        {
            gui_procSelector              = new GUI_ProcSelect();
            gui_procSelector.FormClosing += new FormClosingEventHandler(delegate(object ev_sender, FormClosingEventArgs ev_e)
            {
                selected_proc = gui_procSelector.SelectedProcess; //set the selected proc on close
                if (selected_proc != null)
                {
                    dmpr = new Dumper(selected_proc);
                    dmpr.DumpingStatusChanged += dmpr_DumpingStatusChanged;
                    dmpr.RaiseMessagebox      += dmpr_RaiseMessagebox;
                    proc_picbox_icon.Image     = gui_procSelector.SelectedProcess.IconAsBitmap;
                    proc_txtbox_name.Text      = selected_proc.iProcess.ProcessName;
                    group_mem.Enabled          = true;

                    btn_BeginDump.Enabled = true;
                    btn_DumpOnce.Enabled  = true;
                }
                else
                {
                    dmpr = null;
                    proc_picbox_icon.Image = Properties.Resources.AppWindow;
                    proc_txtbox_name.Text  = String.Empty;
                    group_mem.Enabled      = false;

                    btn_BeginDump.Enabled = false;
                    btn_DumpOnce.Enabled  = false;
                }
            });
            gui_procSelector.ShowDialog();
        }
コード例 #2
0
        private void PopulateProcessList()
        {
            //grab the list of processes
            Process[]       proc_list    = Process.GetProcesses();
            List <CProcess> Raw_procList = new List <CProcess>(proc_list.Length); //can only be as much as the proclist and less

            //grab their icons
            for (int p = 0; p < proc_list.Length; p++)
            {
                Process proc = proc_list[p];
                try
                {
                    String filePID   = String.Format("{0}-{1}", Utilities.ToHexPID(proc.Id), proc.ProcessName);
                    String filePath  = proc.Modules[0].FileName;
                    Icon   proc_icon = IconTools.GetIconForFile(filePath, ShellIconSize.LargeIcon);
                    if (proc_icon == null)
                    {
                        throw new Exception("unable to get icon for proc");
                    }
                    Raw_procList.Add(new CProcess(proc, proc_icon));
                }
                catch
                {
                    //Console.WriteLine("Populate Process List Exception: " + ex.Message + "=>" + proc.ProcessName);
                }
            }

            //sort by PID
            List <CProcess> Sorted_procList = Raw_procList.OrderBy(o => o.iProcess.Id).ToList();

            //finally populate the list
            for (int i = 0; i < Sorted_procList.Count; i++)
            {
                CProcess current = Sorted_procList[i];

                //Format a nice name to display
                String ProcName = String.Format("{0}-{1}", Utilities.ToHexPID(current.iProcess.Id), current.iProcess.ProcessName);

                //add the icon to our imagelist
                iconList.Images.Add(current.IconAsBitmap);

                ListViewItem list_item = new ListViewItem(ProcName, iconList.Images.Count - 1); //(ICON) Name
                ListViewItem.ListViewSubItem sub_item_Path = new ListViewItem.ListViewSubItem(list_item, current.iProcess.Modules[0].FileName);

                list_item.SubItems.Add(sub_item_Path); //add subItem
                list_item.Tag = current;               //add our proc as a Tag

                procListView.Items.Add(list_item);     //add to list
            }

            //select the first item
            if (procListView.Items.Count > 0)
            {
                procListView.Items[0].Selected = true;
                procListView.Select();
            }
        }
コード例 #3
0
 private void btn_select_Click(object sender, EventArgs e)
 {
     if (procListView.SelectedItems.Count > 0)
     {
         ListViewItem itm = procListView.SelectedItems[0];
         _proc = (CProcess)itm.Tag;
     }
     this.Close();
 }
コード例 #4
0
ファイル: CProcess.cs プロジェクト: ibrahim-elsakka/LiveDump
 public CProcess(CProcess copy)
 {
     this._process = copy._process;
     this._icon    = copy._icon;
 }
コード例 #5
0
 public Dumper(CProcess proc)
 {
     rm = new RemoteMemory(proc.iProcess.Id);
 }
コード例 #6
0
 private void btn_close_Click(object sender, EventArgs e)
 {
     _proc = null;
     this.Close();
 }