private void fillMemoryWithAValueToolStripMenuItem_Click(object sender, EventArgs e) { ulong?cellAddress = getSelectedCellAddress(); if (cellAddress == null) { return; } MemoryRangeDialog dialog = new MemoryRangeDialog(); dialog.Range.Start = (ulong)cellAddress; dialog.updateFields(); MixedValueDialog mvDialog = new MixedValueDialog("Value to insert"); if (dialog.ShowDialog() == DialogResult.OK && mvDialog.ShowDialog() == DialogResult.OK) { dynamic newVariable = Convert.ChangeType(mvDialog.Variable, mvDialog.VariableType); ulong newVariableSize = (ulong)Marshal.SizeOf(newVariable); for (ulong address = dialog.Range.Start; address < dialog.Range.End; address += newVariableSize) { API.write(address, newVariable); } refresh(null, true, false); } }
private void enterNewValueToolStripMenuItem_Click(object sender, EventArgs e) { ulong?cellAddress = getSelectedCellAddress(); if (cellAddress == null) { return; } MixedValueDialog dialog = new MixedValueDialog("Write to memory"); if (dialog.ShowDialog() == DialogResult.OK) { dynamic newVariable = Convert.ChangeType(dialog.Variable, dialog.VariableType); API.write((ulong)cellAddress, newVariable); refresh(null, true, false); } }