public ulong GetTailAddress(PointerResult pointerResult, MappedSectionList mappedSectionList)
        {
            ulong tailAddress = pointerResult.GetBaseAddress(mappedSectionList);

            if (pointerResult.Offsets.Length > 0)
            {
                int     j       = 0;
                Pointer pointer = new Pointer();
                int     index   = GetPointerByAddress(tailAddress, ref pointer);
                if (index < 0)
                {
                    return(0);
                }
                tailAddress = pointer.PointerValue;
                for (j = 0; j < pointerResult.Offsets.Length - 1; ++j)
                {
                    index = GetPointerByAddress((ulong)((long)tailAddress + pointerResult.Offsets[j]), ref pointer);
                    if (index < 0)
                    {
                        return(0);
                    }
                    tailAddress = pointer.PointerValue;
                }

                tailAddress = (ulong)((long)tailAddress + pointerResult.Offsets[j]);
            }

            return(tailAddress);
        }
Exemple #2
0
        /// <summary>
        /// Invoke thread-safe calls with a delegate event
        /// </summary>
        private void NextFinderWorkerEvent(PointerList pointerList, PointerFinderWorkerArgs pointerFinderWorkerArgs)
        {
            if (InvokeRequired)
            {
                NextFinderHandler ng = new NextFinderHandler(NextFinderWorkerEvent);
                this.Invoke(ng, pointerList, pointerFinderWorkerArgs);
            }
            else
            {
                List <PointerResult> newPointerResultList = new List <PointerResult>();
                pointer_list_view.Rows.Clear();

                for (int i = 0; i < pointerResults.Count; ++i)
                {
                    if (i % 100 == 0)
                    {
                        next_pointer_finder_worker.ReportProgress((int)(30 * (float)(i) / pointerResults.Count) + 70);
                    }

                    PointerResult pointerResult = pointerResults[i];
                    ulong         tailAddress   = pointerList.GetTailAddress(pointerResult, processManager.MappedSectionList);
                    if (tailAddress == pointerFinderWorkerArgs.Address)
                    {
                        newPointerResultList.Add(pointerResult);
                        ++result_counter;

                        if (result_counter < 2000)
                        {
                            int row_index = pointer_list_view.Rows.Add();
                            DataGridViewCellCollection row = pointer_list_view.Rows[row_index].Cells;

                            for (int j = 0; j < pointerResult.Offsets.Length; ++j)
                            {
                                row[j].Value = (pointerResult.Offsets[j].ToString("X"));                           //offset
                            }

                            if (pointerResult.Offsets.Length > 0)
                            {
                                row[row.Count - 2].Value = (pointerResult.GetBaseAddress(processManager.MappedSectionList).ToString("X"));   //address
                                row[row.Count - 1].Value = (processManager.MappedSectionList.GetSectionName(pointerResult.BaseSectionID));   //section
                            }
                        }
                    }
                }
                if (newPointerResultList.Count == 0 && MessageBox.Show("Whether to continue?", "Next Scan results are zero", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes ||
                    newPointerResultList.Count > 0)
                {
                    pointerResults = newPointerResultList;
                }

                next_pointer_finder_worker.ReportProgress(100);
            }
        }
Exemple #3
0
        private void pointer_list_view_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0)
            {
                return;
            }
            PointerResult pointerResult = pointerResults[e.RowIndex];

            ulong  baseAddress = pointerResult.GetBaseAddress(processManager.MappedSectionList);
            ulong  tailAddress = pointerList.GetTailAddress(pointerResult, processManager.MappedSectionList);
            string data        = MemoryHelper.BytesToString(MemoryHelper.GetBytesByType(tailAddress));
            string dataType    = MemoryHelper.GetStringOfValueType(MemoryHelper.ValueType);

            mainForm.new_pointer_cheat(baseAddress, pointerResult.Offsets.ToList(), dataType, data, false, "");
        }
Exemple #4
0
        private void pointer_list_view_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0)
            {
                return;
            }
            PointerResult pointerResult = pointerResults[e.RowIndex];

            ulong  baseAddress = pointerResult.GetBaseAddress(processManager.MappedSectionList);
            ulong  tailAddress = pointerList.GetTailAddress(pointerResult, processManager.MappedSectionList);
            string data        = MemoryHelper.BytesToString(MemoryHelper.GetBytesByType(tailAddress));
            string dataType    = MemoryHelper.GetStringOfValueType(MemoryHelper.ValueType);
            string description = "";

            for (int oIdx = 0; oIdx < pointerResult.Offsets.Length; ++oIdx)
            {
                description += "+" + pointerResult.Offsets[oIdx].ToString("X");
            }
            description = (string)baseAddress.ToString("X") + description;
            mainForm.new_pointer_cheat(baseAddress, pointerResult.Offsets.ToList(), dataType, data, false, description);
        }
Exemple #5
0
        private void next_pointer_finder_worker_DoWork(object sender, DoWorkEventArgs e)
        {
            PointerFinderWorkerArgs pointerFinderWorkerArgs = (PointerFinderWorkerArgs)e.Argument;

            result_counter = 0;
            pointerList.Clear();
            next_pointer_finder_worker.ReportProgress(0);
            for (int section_idx = 0; section_idx < processManager.MappedSectionList.Count; ++section_idx)
            {
                if (next_pointer_finder_worker.CancellationPending)
                {
                    break;
                }
                MappedSection mappedSection = processManager.MappedSectionList[section_idx];
                if (mappedSection.Name.StartsWith("libSce"))
                {
                    continue;
                }
                mappedSection.PointerSearchInit(processManager, MemoryHelper, pointerList);
                next_pointer_finder_worker.ReportProgress((int)(((float)section_idx / processManager.MappedSectionList.Count) * 30));
            }

            if (next_pointer_finder_worker.CancellationPending)
            {
                return;
            }

            next_pointer_finder_worker.ReportProgress(30);
            pointerList.Init();
            next_pointer_finder_worker.ReportProgress(50);

            List <PointerResult> newPointerResultList = new List <PointerResult>();

            pointer_list_view.Rows.Clear();

            for (int i = 0; i < pointerResults.Count; ++i)
            {
                if (i % 100 == 0)
                {
                    next_pointer_finder_worker.ReportProgress((int)(50 * (float)(i) / pointerResults.Count) + 50);
                }

                PointerResult pointerResult = pointerResults[i];

                if (pointerList.GetTailAddress(pointerResult, processManager.MappedSectionList) == pointerFinderWorkerArgs.Address)
                {
                    newPointerResultList.Add(pointerResult);
                    ++result_counter;

                    if (result_counter < 2000)
                    {
                        int row_index = pointer_list_view.Rows.Add();
                        DataGridViewCellCollection row = pointer_list_view.Rows[row_index].Cells;

                        for (int j = 0; j < pointerResult.Offsets.Length; ++j)
                        {
                            row[j].Value = (pointerResult.Offsets[j].ToString("X"));                           //offset
                        }

                        if (pointerResult.Offsets.Length > 0)
                        {
                            row[row.Count - 2].Value = (pointerResult.GetBaseAddress(processManager.MappedSectionList).ToString("X"));   //address
                            row[row.Count - 1].Value = (processManager.MappedSectionList.GetSectionName(pointerResult.BaseSectionID));   //section
                        }
                    }
                }
            }

            pointerResults = newPointerResultList;


            next_pointer_finder_worker.ReportProgress(100);
        }