コード例 #1
0
ファイル: frmMain.cs プロジェクト: EpicFail78/PlayEngine-1
        private void dataGridSavedResults_CellDoubleClick(Object sender, DataGridViewCellEventArgs e)
        {
            var cells            = dataGridSavedResults.Rows[e.RowIndex].Cells;
            var cheatInformation = (CheatInformation)dataGridSavedResults.Rows[e.RowIndex].Tag;
            var frmEditInstance  = new ChildForms.childFrmEditCheat(
                listProcessMemorySections,
                (String)cells[SavedResultsColumnIndex.iDescription].Value,
                (librpc.MemorySection)cells[SavedResultsColumnIndex.iSection].Value,
                cheatInformation.sectionAddressOffset,
                (String)cells[SavedResultsColumnIndex.iValueType].Value,
                cells[SavedResultsColumnIndex.iValue].Value.ToString()
                );

            if (frmEditInstance.ShowDialog() == DialogResult.OK)
            {
                var returnInformation = frmEditInstance.returnInformation;
                cells[SavedResultsColumnIndex.iDescription].Value = returnInformation.description;
                cells[SavedResultsColumnIndex.iSection].Value     = returnInformation.section;
                cheatInformation.sectionAddressOffset             = returnInformation.sectionAddressOffset;
                cells[SavedResultsColumnIndex.iValueType].Value   = returnInformation.valueType;
                cells[SavedResultsColumnIndex.iValue].Value       = returnInformation.value;

                UInt64 runtimeAddress = returnInformation.section.start + returnInformation.sectionAddressOffset;
                Type   varType        = ScanTypeOptions.getValueTypeFromString(returnInformation.valueType);
                Memory.write(
                    processInfo.pid,
                    runtimeAddress,
                    Convert.ChangeType(returnInformation.value, varType),
                    varType
                    );
            }
        }
コード例 #2
0
        private void dataGridSavedResults_CellDoubleClick(Object sender, DataGridViewCellEventArgs e)
        {
            var cells            = dataGridSavedResults.Rows[e.RowIndex].Cells;
            var cheatInformation = (CheatInformation)dataGridSavedResults.Rows[e.RowIndex].Tag;
            var frmEditInstance  = new ChildForms.childFrmEditCheat(
                (String)cells[SavedResultsColumnIndex.iDescription].Value,
                (String)cells[SavedResultsColumnIndex.iSection].Value,
                cheatInformation.sectionAddressOffset,
                (String)cells[SavedResultsColumnIndex.iType].Value,
                cells[SavedResultsColumnIndex.iValue].Value.ToString()
                );

            if (frmEditInstance.ShowDialog() == DialogResult.OK)
            {
                var returnInformation = frmEditInstance.returnInformation;
                cells[SavedResultsColumnIndex.iDescription].Value = returnInformation.description;
                cells[SavedResultsColumnIndex.iSection].Value     = returnInformation.sectionName;
                cheatInformation.sectionAddressOffset             = returnInformation.sectionAddressOffset;
                cells[SavedResultsColumnIndex.iType].Value        = returnInformation.valueType;
                cells[SavedResultsColumnIndex.iValue].Value       = returnInformation.value;

                UInt64 runtimeAddress = 0;
                for (Int32 i = 0; i < ProcessManager.mInstance.MappedSectionList.Count; i++)
                {
                    if (ProcessManager.mInstance.MappedSectionList.GetSectionName(i).Contains(returnInformation.sectionName, StringComparison.OrdinalIgnoreCase))
                    {
                        runtimeAddress = ProcessManager.mInstance.MappedSectionList[i].Start + returnInformation.sectionAddressOffset;
                        break;
                    }
                }
                Memory.write(processInfo.pid, runtimeAddress, Convert.ChangeType(returnInformation.value, ScanTypeOptions.getValueTypeFromString(returnInformation.valueType)));
            }
        }