/// <summary> /// Creates an image reader that scans all available memory in the segment. /// </summary> /// <param name="platform"></param> /// <returns></returns> public ImageReader CreateImageReader(IProcessorArchitecture arch) { var addrBegin = Address.Max(this.Address, this.MemoryArea.BaseAddress); var addrEnd = Address.Min(this.Address + this.Size, this.MemoryArea.EndAddress); return(arch.CreateImageReader(this.MemoryArea, addrBegin, addrEnd)); }
private static Address MinBaseAddr(ImageSegment[] segments) { if (segments.Length == 0) { throw new ArgumentException("At least one ImageSegment must be provided."); } var addr = segments[0].Address; for (int i = 1; i < segments.Length; ++i) { addr = Address.Min(addr, segments[i].Address); } return(addr); }