Example #1
0
        public void Deserialize(BinaryReader binaryReader, TargetSystemInfo targetSystemInfo)
        {
            Debug.Assert(binaryReader != null);
            Debug.Assert(targetSystemInfo != null);

            if (targetSystemInfo.Architecture == Common.Architecture._32Bit)
            {
                uint stackDepth = binaryReader.ReadUInt32();
                for (int i = 0; i < stackDepth; i++)
                {
                    Frame newFrame = new Frame();
                    newFrame.Address = (UInt64)binaryReader.ReadUInt32();
                    Frames.Push(newFrame);
                }
            }
            else
            {
                uint stackDepth = binaryReader.ReadUInt32();
                for (int i = 0; i < stackDepth; i++)
                {
                    Frame newFrame = new Frame();
                    newFrame.Address = binaryReader.ReadUInt64();
                    Frames.Push(newFrame);
                }
            }
        }
Example #2
0
        public byte[] Serialize(TargetSystemInfo targetSystemInfo)
        {
            MemoryStream memoryStream = new MemoryStream();
            BinaryWriter binaryWriter = new BinaryWriter(memoryStream);

            binaryWriter.Write(SymbolsPath);

            return memoryStream.ToArray();
        }
Example #3
0
        public byte[] Serialize(TargetSystemInfo targetSystemInfo)
        {
            MemoryStream memoryStream = new MemoryStream();
            BinaryWriter binaryWriter = new BinaryWriter(memoryStream);

            if (Environment.Is64BitProcess)
            {
                binaryWriter.Write(8);
            }
            else
            {
                binaryWriter.Write(4);
            }

            return memoryStream.ToArray();
        }
Example #4
0
        public byte[] Serialize(TargetSystemInfo targetSystemInfo)
        {
            Debug.Assert(targetSystemInfo != null);

            MemoryStream memoryStream = new MemoryStream();
            BinaryWriter binaryWriter = new BinaryWriter(memoryStream);

            if (targetSystemInfo.Architecture == Common.Architecture._32Bit)
            {
                binaryWriter.Write((UInt32)Address);
            }
            else if (targetSystemInfo.Architecture == Common.Architecture._64Bit)
            {
                binaryWriter.Write(Address);
            }

            binaryWriter.Write(HeapId);

            return memoryStream.ToArray();
        }
Example #5
0
        public void Deserialize(BinaryReader binaryReader, TargetSystemInfo targetSystemInfo)
        {
            // Custom read so endianness can be determined
            byte[] buffer = new byte[2];
            binaryReader.Read(buffer, 0, 2);
            UInt16 pointerSize = BitConverter.ToUInt16(buffer, 0);

            if (pointerSize != 4 && pointerSize != 8)
            {
                Endianness = Common.Endianness.BigEndian;
                Common.EndianSwap(ref pointerSize);
            }

            switch (pointerSize)
            {
                case 4:
                    Architecture = Common.Architecture._32Bit; break;
                case 8:
                    Architecture = Common.Architecture._64Bit; break;
            }
        }
Example #6
0
        public void Deserialize(BinaryReader binaryReader, TargetSystemInfo targetSystemInfo)
        {
            Debug.Assert(binaryReader != null);
            Debug.Assert(targetSystemInfo != null);

            // Process the correct number of bytes depending on the target platform
            if (targetSystemInfo.Architecture == Common.Architecture._32Bit)
            {
                Address = binaryReader.ReadUInt32();
            }
            else if (targetSystemInfo.Architecture == Common.Architecture._64Bit)
            {
                Address = binaryReader.ReadUInt64();
            }

            HeapId = binaryReader.ReadUInt32();

            Stack.Deserialize(binaryReader, targetSystemInfo);

            // TODO: User data
        }
Example #7
0
 public void Deserialize(BinaryReader binaryReader, TargetSystemInfo targetSystemInfo)
 {
     UInt16 stringLength = binaryReader.ReadUInt16();
     byte[] rawBytes = binaryReader.ReadBytes(stringLength);
     SymbolsPath = Encoding.Unicode.GetString(rawBytes);
 }
Example #8
0
 public byte[] Serialize(TargetSystemInfo targetSystemInfo)
 {
     throw new NotImplementedException();
 }
Example #9
0
 public void Deserialize(BinaryReader binaryReader, TargetSystemInfo targetSystemInfo)
 {
     throw new NotImplementedException();
 }