示例#1
0
        //TODO: Parse type and get it to box separately

        unsafe private void button2_Click(object sender, EventArgs e)
        {
            List <string> handle   = new List <string>();
            List <string> handlers = new List <string>();
            List <string> types    = new List <string>();

            var CurInd = dataGridView1.CurrentCell.RowIndex;

            int sel_pid = Convert.ToInt32(dataGridView1.Rows[CurInd].Cells[1].Value);

            if (sel_pid == 0)
            {
                return;
            }

            char *str = null;

            InfoOfProcesses.GetHandlesByPID(sel_pid, &str, 4 * 1024);

            string result_handles = new string(str);
            string tmpstr         = result_handles;
            string tmptmp         = result_handles;
            var    pattern        = "[*\n]";
            var    ptrn           = "[:*\n]"; ////tmpstr  "[0x4]Directory : \\KnownDlls " string

            string[] substrings = Regex.Split(tmpstr, pattern);
            string[] substr     = Regex.Split(tmptmp, ptrn);
            string[] subtypes   = new string[substr.Length];

            int j = 0;

            for (int i = 0; i < substr.Length; ++i)
            {
                if (i % 2 == 0)
                {
                    subtypes[j] = substr[i];
                    j++;
                }
            }

            foreach (string strs in substrings)
            {
                handlers.Add(strs);
            }

            foreach (string strs in subtypes)
            {
                types.Add(strs);
            }

            for (int i = 0; i < ListOfModules[CurInd].Count; ++i)
            {
                handle.Add(ListOfModules[CurInd][i].ModuleName);
            }

            var ShowModule = new DLLs(handle, handlers, types);

            ShowModule.Show();
        }