示例#1
0
        private void update_result_list_view_ui(WorkerReturn ret)
        {
            lvResult.Items.Clear();
            lvResult.BeginUpdate();
            lvResult.Items.AddRange(ret.ListViewItems.ToArray());
            lvResult.EndUpdate();

            for (int i = 0; i < lstSection.Items.Count; ++i)
            {
                lstSection.SetItemChecked(i, ret.MappedSectionCheckeSet[i]);
            }
            lblMsg.Text = ret.Results + " results";
        }
示例#2
0
        private void update_result_list_view_ui(WorkerReturn ret)
        {
            result_list_view.Items.Clear();
            result_list_view.BeginUpdate();
            result_list_view.Items.AddRange(ret.ListViewItems.ToArray());
            result_list_view.EndUpdate();

            for (int i = 0; i < section_list_box.Items.Count; ++i)
            {
                section_list_box.SetItemChecked(i, ret.MappedSectionCheckeSet[i]);
            }
            msg.Text = ret.Results + " results";
        }
示例#3
0
        private void update_result_list_view(BackgroundWorker worker, string value_type, bool refresh, int start, float percent)
        {
            worker.ReportProgress(start, 0);

            List <ListViewItem> listViewItems          = new List <ListViewItem>();
            HashSet <int>       mappedSectionCheckeSet = new HashSet <int>();

            ulong totalAddressCount = processManager.TotalAddressCount();
            ulong curAddressCount   = 0;

            for (int idx = 0; idx < processManager.mapped_section_list.Count; ++idx)
            {
                MappedSection mapped_section = processManager.mapped_section_list[idx];
                AddressList   address_list   = mapped_section.AddressList;
                if (address_list.Count > 0)
                {
                    mappedSectionCheckeSet.Add(idx);
                }
                for (int i = 0; i < address_list.Count; i++)
                {
                    if (curAddressCount >= 0x10000)
                    {
                        break;
                    }

                    curAddressCount++;
                    ListViewItem lvi = new ListViewItem();

                    lvi.Text = String.Format("{0:X}", address_list[i].AddressOffset + mapped_section.Start);

                    byte[] match_bytes = BitConverter.GetBytes(address_list[i].MemoryValue);

                    if (refresh)
                    {
                        match_bytes = processManager.MemoryHelper.GetBytesByType(address_list[i].AddressOffset + mapped_section.Start);
                        Address address_tmp = new Address();
                        address_tmp.AddressOffset = address_list[i].AddressOffset;
                        address_tmp.MemoryValue   = processManager.MemoryHelper.BytesToUint(match_bytes);
                        address_list[i]           = address_tmp;
                    }

                    string value_output = processManager.MemoryHelper.BytesToString(match_bytes);

                    lvi.SubItems.Add(value_type);
                    lvi.SubItems.Add(value_output);
                    lvi.SubItems.Add(processManager.MemoryHelper.PrintBytesByHex(match_bytes));
                    lvi.SubItems.Add(processManager.GetSectionName(idx));

                    listViewItems.Add(lvi);

                    if (i % 500 == 0)
                    {
                        worker.ReportProgress(start + (int)(i / (float)curAddressCount * 100 * percent));
                    }
                }
            }

            WorkerReturn workerReturn = new WorkerReturn();

            workerReturn.ListViewItems          = listViewItems;
            workerReturn.MappedSectionCheckeSet = mappedSectionCheckeSet;
            workerReturn.Results = totalAddressCount;

            worker.ReportProgress(start + (int)(100 * percent), workerReturn);
        }
示例#4
0
        private void update_result_list_view(BackgroundWorker worker, bool refresh, int start, float percent)
        {
            worker.ReportProgress(start);

            List <ListViewItem> listViewItems = new List <ListViewItem>();

            bool[] mappedSectionCheckeSet = new bool[processManager.MappedSectionList.Count];

            ulong  totalResultCount = processManager.MappedSectionList.TotalResultCount();
            ulong  curResultCount   = 0;
            string value_type       = MemoryHelper.GetStringOfValueType(memoryHelper.ValueType);

            const int MAX_RESULTS_NUM = 0x1000;

            for (int idx = 0; idx < processManager.MappedSectionList.Count; ++idx)
            {
                MappedSection mapped_section = processManager.MappedSectionList[idx];
                ResultList    result_list    = mapped_section.ResultList;
                if (result_list == null)
                {
                    continue;
                }
                if (!mapped_section.Check)
                {
                    continue;
                }

                mappedSectionCheckeSet[idx] = result_list.Count > 0;

                for (result_list.Begin(); !result_list.End(); result_list.Next())
                {
                    if (curResultCount >= MAX_RESULTS_NUM)
                    {
                        break;
                    }

                    uint   memory_address_offset = 0;
                    byte[] memory_value          = null;

                    result_list.Get(ref memory_address_offset, ref memory_value);

                    curResultCount++;
                    ListViewItem lvi = new ListViewItem();

                    lvi.Text = String.Format("{0:X}", memory_address_offset + mapped_section.Start);

                    if (refresh && !worker.CancellationPending)
                    {
                        memory_value = memoryHelper.GetBytesByType(memory_address_offset + mapped_section.Start);
                        result_list.Set(memory_value);
                        worker.ReportProgress(start + (int)(100.0f * curResultCount / MAX_RESULTS_NUM));
                    }

                    lvi.SubItems.Add(value_type);
                    lvi.SubItems.Add(memoryHelper.BytesToString(memory_value));
                    lvi.SubItems.Add(memoryHelper.BytesToHexString(memory_value));
                    lvi.SubItems.Add(processManager.MappedSectionList.GetSectionName(idx));

                    listViewItems.Add(lvi);
                }
            }

            WorkerReturn workerReturn = new WorkerReturn();

            workerReturn.ListViewItems          = listViewItems;
            workerReturn.MappedSectionCheckeSet = mappedSectionCheckeSet;
            workerReturn.Results = totalResultCount;

            worker.ReportProgress(start + (int)(100 * percent), workerReturn);
        }