예제 #1
0
        private void UpdateDisplay(ulong address, byte[] memory)
        {
            for (var i = memory.Length - NativeIntegerSize; i >= 0; i -= (int)NativeIntegerSize)
            {
                ulong value = MainForm.ToLong(memory, (uint)i, NativeIntegerSize);

                var at     = address + (ulong)i;
                var offset = StackFrame - at;

                var entry = new StackEntry()
                {
                    Address  = BasePlatform.ToHex(at, NativeIntegerSize),
                    HexValue = BasePlatform.ToHex(value, NativeIntegerSize),
                    Value    = value,
                    Offset   = Platform.StackFrame.Name.ToUpperInvariant() +
                               (offset >= 0
                                                ? "-" + BasePlatform.ToHex(offset, 1)
                                                : "+" + BasePlatform.ToHex(-(long)offset, 1)),
                    Index = stackentries.Count,
                    Info  = MainForm.GetAddressInfo(value)
                };

                stackentries.Add(entry);
            }
        }
예제 #2
0
        private void UpdateDisplay(ulong address, byte[] memory)
        {
            uint size = NativeIntegerSize;

            for (int i = memory.Length - NativeIntegerSize; i >= 0; i -= (int)size)
            {
                // FIXME: for 64 bit
                ulong value = (ulong)(memory[i] | (memory[i + 1] << 8) | (memory[i + 2] << 16) | (memory[i + 3] << 24));

                var at = address + (ulong)i;

                var offset = (long)(Platform.StackFrame.Value - at);

                var entry = new StackEntry()
                {
                    Address  = BasePlatform.ToHex(at, size),
                    HexValue = BasePlatform.ToHex(value, size),
                    Value    = value,
                    Offset   = Platform.StackFrame.Name.ToUpper() +
                               (offset >= 0
                                                ? "-" + BasePlatform.ToHex((ulong)offset, 1)
                                                : "+" + BasePlatform.ToHex((ulong)-offset, 1)),
                    Index = stackentries.Count,
                };

                stackentries.Add(entry);
            }
        }
예제 #3
0
        private void UpdateDisplay(ulong address, byte[] bytes)
        {
            foreach (var watch in Watches)
            {
                if (watch.Watch.Address != address || watch.Size != bytes.Length)
                {
                    continue;
                }

                watch.Value    = ToLong(bytes);
                watch.HexValue = BasePlatform.ToHex(watch.Value, watch.Size);
            }

            Refresh();
        }
예제 #4
0
        private void UpdateDisplay(ulong address, byte[] memory)
        {
            var parameters = DebugSource.GetMethodParameters(method);

            if (parameters == null || parameters.Count == 0)
            {
                return;
            }

            long offset = (long)(address - StackFrame);

            foreach (var parameter in parameters)
            {
                var type = DebugSource.GetTypeInfo(parameter.ParameterTypeID);

                uint size = (parameter.Size == NativeIntegerSize || parameter.Size == NativeIntegerSize * 2) ? parameter.Size : 0;

                if (size == 0 && parameter.Size <= NativeIntegerSize)
                {
                    size = NativeIntegerSize;
                }

                ulong value = (size != 0) ? MainForm.ToLong(memory, parameter.Offset, size) : 0;

                var entry = new StackEntry()
                {
                    Index  = (int)parameter.Index,
                    Name   = parameter.Name,
                    Offset = Platform.StackFrame.Name.ToUpperInvariant() +
                             (offset >= 0
                                                ? "+" + BasePlatform.ToHex(offset + parameter.Offset, 1)
                                                : "-" + BasePlatform.ToHex(-offset + parameter.Offset, 1)),
                    Address  = BasePlatform.ToHex(StackFrame + parameter.Offset, size),
                    Size     = size,
                    Value    = value,
                    HexValue = BasePlatform.ToHex(value, size),
                    Type     = type.FullName,
                    Info     = MainForm.GetAddressInfo(value)
                };

                stackentries.Add(entry);
            }
        }
예제 #5
0
        private void UpdateDisplay(ulong address, byte[] memory)
        {
            uint size = 4;             // fixme

            for (int i = memory.Length - 4; i > 0; i = i - (int)size)
            {
                ulong value = (ulong)(memory[i] | (memory[i + 1] << 8) | (memory[i + 2] << 16) | (memory[i + 3] << 24));

                var at = address + (ulong)i;

                var entry = new StackEntry()
                {
                    Address  = BasePlatform.ToHex(at, size),
                    HexValue = BasePlatform.ToHex(value, size),
                    Value    = value,
                    Offset   = Platform.StackFrame.Name.ToUpper() + "-" + (Platform.StackFrame.Value - at).ToString().PadLeft(2, '0'),
                    Index    = stackentries.Count,
                };

                stackentries.Add(entry);
            }
        }
예제 #6
0
 public string ToHex()
 {
     return(BasePlatform.ToHex(Value, Size));
 }