示例#1
0
 public HexEditForm(Int32 initAddress, MemoryModifier m, MainForm formPtr)
 {
     InitializeComponent();
     form1Pointer         = formPtr;
     memoryModifier       = m;
     selectedAddress      = initAddress;
     highlightedTextBoxes = new List <TextBox>();
     initForm(initAddress, true);
 }
        private void AttachToProcess(Process p)
        {
            attachedProcess     = p;
            memoryModifier      = new MemoryModifier(attachedProcess);
            processReadEnabled  = true;
            processWriteEnabled = false;

            UpdatePanels();
            updateTimer.Start();
        }
        private void DetachFromProcess()
        {
            attachedProcess     = null;
            memoryModifier      = null;
            processReadEnabled  = false;
            processWriteEnabled = false;

            UpdatePanels();
            updateTimer.Stop();
        }
示例#4
0
        public void UpdateActualValueLabel(MemoryModifier m)
        {
            int bytesToRead = -1;

            switch (modAddress.type)
            {
            case (int)ModAddress.dataTypes.Byte:
            {
                bytesToRead = 1;
                byte av = m.ReadFromAddress(modAddress.address, bytesToRead)[0];
                lbl_actual_value.Text = av.ToString();
                break;
            }

            case (int)ModAddress.dataTypes.UInt16:
            {
                bytesToRead = 2;
                UInt16 av = BitConverter.ToUInt16(m.ReadFromAddress(modAddress.address, bytesToRead), 0);
                lbl_actual_value.Text = av.ToString();
                break;
            }

            case (int)ModAddress.dataTypes.Int16:
            {
                bytesToRead = 2;
                Int16 av = BitConverter.ToInt16(m.ReadFromAddress(modAddress.address, bytesToRead), 0);
                lbl_actual_value.Text = av.ToString();
                break;
            }

            case (int)ModAddress.dataTypes.UInt32:
            {
                bytesToRead = 4;
                UInt32 av = BitConverter.ToUInt32(m.ReadFromAddress(modAddress.address, bytesToRead), 0);
                lbl_actual_value.Text = av.ToString();
                break;
            }

            case (int)ModAddress.dataTypes.Int32:
            {
                bytesToRead = 4;
                Int32 av = BitConverter.ToInt32(m.ReadFromAddress(modAddress.address, bytesToRead), 0);
                lbl_actual_value.Text = av.ToString();
                break;
            }

            case (int)ModAddress.dataTypes.UInt64:
            {
                bytesToRead = 8;
                UInt64 av = BitConverter.ToUInt64(m.ReadFromAddress(modAddress.address, bytesToRead), 0);
                lbl_actual_value.Text = av.ToString();
                break;
            }

            case (int)ModAddress.dataTypes.Int64:
            {
                bytesToRead = 8;
                Int64 av = BitConverter.ToInt64(m.ReadFromAddress(modAddress.address, bytesToRead), 0);
                lbl_actual_value.Text = av.ToString();
                break;
            }

            case (int)ModAddress.dataTypes.Float:
            {
                bytesToRead = 4;
                float av = BitConverter.ToSingle(m.ReadFromAddress(modAddress.address, bytesToRead), 0);
                lbl_actual_value.Text = av.ToString();
                break;
            }

            case (int)ModAddress.dataTypes.Double:
            {
                bytesToRead = 8;
                double av = BitConverter.ToDouble(m.ReadFromAddress(modAddress.address, bytesToRead), 0);
                lbl_actual_value.Text = av.ToString();
                break;
            }

            default: bytesToRead = -1; break;
            }
        }