private static byte[] ReadBuffer(View view, Native.MinidumpLocationDescriptor location) { if (location.DataSize == 0) { return(Array.Empty <byte>()); } var buffer = new byte[location.DataSize]; Marshal.Copy(view.GetPointer(location), buffer, startIndex: 0, buffer.Length); return(buffer); }
public nint GetPointer(Native.MinidumpLocationDescriptor location) => GetPointer(location.Rva, location.DataSize);
private static bool FindStream(IReadOnlyList <Native.MinidumpDirectory> directory, Native.MinidumpStreamType streamType, out Native.MinidumpLocationDescriptor location) { var directoryEntry = directory.Where(d => d.StreamType == streamType).SingleOrDefault(); location = directoryEntry.Location; return(directoryEntry.StreamType == streamType); }